diff --git a/testing/file_test/BUILD b/testing/file_test/BUILD index 6560c8a8129f..7646198aff65 100644 --- a/testing/file_test/BUILD +++ b/testing/file_test/BUILD @@ -26,6 +26,19 @@ cc_library( ], ) +cc_library( + name = "file_system", + testonly = 1, + srcs = [ + "file_system.cpp", + ], + hdrs = ["file_system.h"], + deps = [ + "//common:error", + "@llvm-project//llvm:Support", + ], +) + cc_library( name = "file_test_base", testonly = 1, @@ -39,6 +52,7 @@ cc_library( hdrs = ["file_test_base.h"], deps = [ ":autoupdate", + ":file_system", ":manifest", "//common:check", "//common:error", diff --git a/testing/file_test/README.md b/testing/file_test/README.md index 9fe588726e56..a7a49adfda89 100644 --- a/testing/file_test/README.md +++ b/testing/file_test/README.md @@ -195,6 +195,18 @@ Supported comment markers are: `EXTRA-ARGS` can be specified at most once, and a test cannot specify both `ARGS` and `EXTRA-ARGS`. +- ``` + // INCLUDE-FILE: + ``` + + Includes the specified file in the test's virtual file system and adds the + path to the test's arguments. + + This can be used to provide a minimal `Core` package (and `prelude` library) + in toolchain tests by providing a path to a file with + `package Core library "prelude";` as its first line and adding + `--custom-core` to `EXTRA-ARGS`. + - ``` // SET-CAPTURE-CONSOLE-OUTPUT ``` diff --git a/testing/file_test/file_system.cpp b/testing/file_test/file_system.cpp new file mode 100644 index 000000000000..d681c04e1eff --- /dev/null +++ b/testing/file_test/file_system.cpp @@ -0,0 +1,23 @@ +// 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 "testing/file_test/file_system.h" + +namespace Carbon::Testing { + +auto AddFile(llvm::vfs::InMemoryFileSystem& fs, llvm::StringRef path) + -> ErrorOr { + llvm::ErrorOr> file = + llvm::MemoryBuffer::getFile(path); + if (file.getError()) { + return ErrorBuilder() << "Getting `" << path + << "`: " << file.getError().message(); + } + if (!fs.addFile(path, /*ModificationTime=*/0, std::move(*file))) { + return ErrorBuilder() << "Duplicate file: `" << path << "`"; + } + return Success(); +} + +} // namespace Carbon::Testing diff --git a/testing/file_test/file_system.h b/testing/file_test/file_system.h new file mode 100644 index 000000000000..8456ca257113 --- /dev/null +++ b/testing/file_test/file_system.h @@ -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 + +#ifndef CARBON_TESTING_FILE_TEST_FILE_SYSTEM_H_ +#define CARBON_TESTING_FILE_TEST_FILE_SYSTEM_H_ + +#include "common/error.h" +#include "llvm/Support/VirtualFileSystem.h" + +namespace Carbon::Testing { + +// Adds a file to the fs. +auto AddFile(llvm::vfs::InMemoryFileSystem& fs, llvm::StringRef path) + -> ErrorOr; + +} // namespace Carbon::Testing + +#endif // CARBON_TESTING_FILE_TEST_FILE_SYSTEM_H_ diff --git a/testing/file_test/file_test_base_test.cpp b/testing/file_test/file_test_base_test.cpp index 8fd0c9e3a570..b83b4cd4d017 100644 --- a/testing/file_test/file_test_base_test.cpp +++ b/testing/file_test/file_test_base_test.cpp @@ -264,9 +264,9 @@ auto FileTestBaseTest::Run( PrintArgs(test_args, output_stream); auto filename = std::filesystem::path(test_name().str()).filename(); - if (filename == "args.carbon") { - // 'args.carbon' has custom arguments, so don't do regular argument - // validation for it. + if (filename == "args.carbon" || filename == "include_file.carbon") { + // 'args.carbon' and 'include_file.carbon' have custom arguments, so don't + // do regular argument validation for them. return {{.success = true}}; } diff --git a/testing/file_test/run_test.cpp b/testing/file_test/run_test.cpp index ffb83a46113e..fa6e0d653ed4 100644 --- a/testing/file_test/run_test.cpp +++ b/testing/file_test/run_test.cpp @@ -11,6 +11,7 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/PrettyStackTrace.h" +#include "testing/file_test/file_system.h" #include "testing/file_test/file_test_base.h" #include "testing/file_test/test_file.h" @@ -93,6 +94,9 @@ auto RunTestFile(const FileTestBase& test_base, bool dump_output, test_file.test_args = test_base.GetDefaultArgs(); test_file.test_args.append(test_file.extra_args); } + for (const auto& include_file : test_file.include_files) { + test_file.test_args.push_back(include_file); + } CARBON_RETURN_IF_ERROR(DoArgReplacements(test_file.test_args, test_base.GetArgReplacements(), test_file.file_splits)); @@ -123,6 +127,11 @@ auto RunTestFile(const FileTestBase& test_base, bool dump_output, return ErrorBuilder() << "File is repeated: " << split.filename; } } + + for (llvm::StringRef file_path : test_file.include_files) { + CARBON_RETURN_IF_ERROR(AddFile(*fs, file_path)); + } + // Convert the arguments to StringRef and const char* to match the // expectations of PrettyStackTraceProgram and Run. llvm::SmallVector test_args_ref; diff --git a/testing/file_test/test_file.cpp b/testing/file_test/test_file.cpp index a19db6db27b7..4fb82682dc1c 100644 --- a/testing/file_test/test_file.cpp +++ b/testing/file_test/test_file.cpp @@ -492,6 +492,17 @@ static auto TryConsumeArgs(llvm::StringRef line, llvm::StringRef line_trimmed, return true; } +static auto TryConsumeIncludeFile(llvm::StringRef line_trimmed, + llvm::SmallVector* include_files) + -> ErrorOr { + if (!line_trimmed.consume_front("// INCLUDE-FILE: ")) { + return false; + } + + include_files->push_back(std::string(line_trimmed)); + return true; +} + // Processes AUTOUPDATE lines when found. Returns true if the line is consumed. static auto TryConsumeAutoupdate(int line_index, llvm::StringRef line_trimmed, bool* found_autoupdate, @@ -598,6 +609,12 @@ auto ProcessTestFile(llvm::StringRef test_name, bool running_autoupdate) if (is_consumed) { continue; } + CARBON_ASSIGN_OR_RETURN( + is_consumed, + TryConsumeIncludeFile(line_trimmed, &test_file.include_files)); + if (is_consumed) { + continue; + } CARBON_ASSIGN_OR_RETURN( is_consumed, TryConsumeAutoupdate(line_index, line_trimmed, &found_autoupdate, @@ -621,7 +638,8 @@ auto ProcessTestFile(llvm::StringRef test_name, bool running_autoupdate) } if (!found_autoupdate) { - return Error("Missing AUTOUPDATE/NOAUTOUPDATE setting"); + return ErrorBuilder() << "Missing AUTOUPDATE/NOAUTOUPDATE setting: " + << test_name; } test_file.has_splits = split.has_splits(); diff --git a/testing/file_test/test_file.h b/testing/file_test/test_file.h index 0037f57e8b54..68d581729663 100644 --- a/testing/file_test/test_file.h +++ b/testing/file_test/test_file.h @@ -58,6 +58,10 @@ struct TestFile { // Files in the test, generated by content and splits. llvm::SmallVector file_splits; + // // Paths to files to be included in the test. They are added to `test_args` + // in `Run`, and added to the virtual file system to make them accessible. + llvm::SmallVector include_files; + // The location of the autoupdate marker, for autoupdated files. std::optional autoupdate_line_number; diff --git a/testing/file_test/testdata/include_file.carbon b/testing/file_test/testdata/include_file.carbon new file mode 100644 index 000000000000..e3c2e9999920 --- /dev/null +++ b/testing/file_test/testdata/include_file.carbon @@ -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 + +// INCLUDE-FILE: testing/file_test/testdata/no_line_number.carbon +// 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/include_file.carbon +// TIP: To dump output, run: +// TIP: bazel run //testing/file_test:file_test_base_test -- --dump_output --file_tests=testing/file_test/testdata/include_file.carbon + +// CHECK:STDOUT: 3 args: `default_args`, `include_file.carbon`, `testing/file_test/testdata/no_line_number.carbon` diff --git a/toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon b/toolchain/check/testdata/builtin_conversions/min_prelude/convert_facet_value_to_narrowed_facet_type.carbon similarity index 55% rename from toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon rename to toolchain/check/testdata/builtin_conversions/min_prelude/convert_facet_value_to_narrowed_facet_type.carbon index 4b33c2a6f970..4eef89c0d1c8 100644 --- a/toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon +++ b/toolchain/check/testdata/builtin_conversions/min_prelude/convert_facet_value_to_narrowed_facet_type.carbon @@ -2,32 +2,18 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon +// EXTRA-ARGS: --custom-core +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtin_conversions/min_prelude/convert_facet_value_to_narrowed_facet_type.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtin_conversions/no_prelude/convert_facet_value_to_narrowed_facet_type.carbon - -// --- core.carbon -package Core; - -interface ImplicitAs(T:! type) { - fn Convert[self: Self]() -> T; -} - -interface BitAnd { - fn Op[self: Self](other: Self) -> Self; -} - -impl forall [T:! type] T as BitAnd { - fn Op[self: Self](other: Self) -> Self = "type.and"; -} +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtin_conversions/min_prelude/convert_facet_value_to_narrowed_facet_type.carbon // --- convert_to_narrowed_facet_type.carbon library "[[@TEST_NAME]]"; -import Core; - interface Eats {} interface Animal {} @@ -38,8 +24,6 @@ fn HandleAnimal[U:! Animal & Eats](a: U) { Feed(a); } // --- bigger.carbon library "[[@TEST_NAME]]"; -import Core; - interface Eats {} interface Animal {} interface Tame {} @@ -53,8 +37,6 @@ fn HandleTameAnimal[W:! Eats & Animal & Tame](w: W) { // --- fail_todo_with_blanket.carbon library "[[@TEST_NAME]]"; -import Core; - interface Eats {} interface Animal {} interface Tame {} @@ -77,233 +59,6 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { FeedTame2(w); } -// CHECK:STDOUT: --- core.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: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] -// CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%T) [symbolic] -// CHECK:STDOUT: %Convert: %Convert.type = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic] -// CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] -// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete] -// CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic] -// CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete] -// CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete] -// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete] -// CHECK:STDOUT: %assoc0.121: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete] -// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic] -// CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic] -// CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, (%impl_witness) [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl -// CHECK:STDOUT: .BitAnd = %BitAnd.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] { -// CHECK:STDOUT: %T.patt.loc3_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc3_22.2 (constants.%T.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.loc3_22.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_22.2 (constants.%T)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] { -// CHECK:STDOUT: %T.patt.loc11_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_14.1 [symbolic = %T.loc11_14.2 (constants.%T)] -// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %T.loc11_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.2 (constants.%T)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc3_22.1: type) { -// CHECK:STDOUT: %T.loc3_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_22.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc3_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc3_22.2 (constants.%T.patt)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc3_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] -// CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%T.loc3_22.2) [symbolic = %Convert.type (constants.%Convert.type)] -// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type) = struct_value () [symbolic = %Convert (constants.%Convert)] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)] -// CHECK:STDOUT: %assoc0.loc4_32.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_32.2 (constants.%assoc0.a50)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] -// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type) = fn_decl @Convert [symbolic = @ImplicitAs.%Convert (constants.%Convert)] { -// CHECK:STDOUT: %self.patt: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type.419) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %return.patt: @Convert.%T (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Convert.%T (%T) = out_param_pattern %return.patt, call_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc3_22.1 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self.param: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type.419) = value_param call_param0 -// CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.419)] { -// CHECK:STDOUT: %.loc4_20.2: @Convert.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.ref: @Convert.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc4_20.2 [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.as_type.loc4_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: %.loc4_20.3: type = converted %Self.ref, %Self.as_type.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type.419) = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref @Convert.%T (%T) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Convert.%T (%T) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc4_32.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_32.2 (constants.%assoc0.a50)] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .T = -// CHECK:STDOUT: .Convert = %assoc0.loc4_32.1 -// CHECK:STDOUT: witness = (%Convert.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd { -// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44] -// CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] { -// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1 -// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc8_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// 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.560)] -// 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.560)] -// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = value_param call_param0 -// CHECK:STDOUT: %.loc8_15.1: type = splice_block %.loc8_15.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.560)] { -// CHECK:STDOUT: %Self.ref.loc8_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// 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.560)] -// CHECK:STDOUT: %.loc8_15.2: type = converted %Self.ref.loc8_15, %Self.as_type.loc8_15.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = value_param call_param1 -// CHECK:STDOUT: %.loc8_28.1: type = splice_block %.loc8_28.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.560)] { -// CHECK:STDOUT: %Self.ref.loc8_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// 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.560)] -// CHECK:STDOUT: %.loc8_28.2: type = converted %Self.ref.loc8_28, %Self.as_type.loc8_28 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.121] -// 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(%T.loc11_14.1: type) { -// CHECK:STDOUT: %T.loc11_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc11_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %impl_witness: = impl_witness (%Op.decl), @impl(%T.loc11_14.2) [symbolic = %impl_witness (constants.%impl_witness)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc11_14.2) [symbolic = %Op.type (constants.%Op.type.28d)] -// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)] -// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%T.loc11_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %T.ref as %BitAnd.ref { -// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] { -// CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1 -// CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc12_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc12_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = file.%impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(@ImplicitAs.%T.loc3_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] -// CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.as_type.loc4_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type.loc4_20.1 (%Self.as_type.419)]() -> @Convert.%T (%T); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) { -// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc8_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc8_15.1 (%Self.as_type.560); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc11_14.1: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%T) { -// CHECK:STDOUT: %T.loc3_22.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc3_22.2 => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert(constants.%T, constants.%Self.0f3) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f -// CHECK:STDOUT: %Self => constants.%Self.0f3 -// CHECK:STDOUT: %Self.as_type.loc4_20.1 => constants.%Self.as_type.419 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.%T) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T.loc3_22.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.1(constants.%Self.e44) { -// CHECK:STDOUT: %Self => constants.%Self.e44 -// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%Self.as_type.560 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(constants.%T) { -// CHECK:STDOUT: %T.loc11_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc11_14.2 => constants.%T -// CHECK:STDOUT: %impl_witness => constants.%impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc11_14.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.2(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) { -// CHECK:STDOUT: %Self => constants.%BitAnd.facet -// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: --- convert_to_narrowed_facet_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -356,18 +111,18 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .BitAnd = %Core.BitAnd -// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst59 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//default, loc8_41, loaded [concrete = constants.%assoc0] -// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//default, Op, loaded [concrete = constants.%Op.ab9] -// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//default, inst59 [no loc], loaded [symbolic = constants.%Self.25f] -// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//default, loc11_36, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.b81)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc11_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] -// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc11_24, loaded [symbolic = @impl.%T (constants.%T.8b3)] -// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc11_29, loaded [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %Core.import_ref.1e6: @impl.%Op.type (%Op.type.f99) = import_ref Core//default, loc12_42, loaded [symbolic = @impl.%Op (constants.%Op.05a)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc11_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst100 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//prelude, Op, loaded [concrete = constants.%Op.ab9] +// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst100 [no loc], loaded [symbolic = constants.%Self.25f] +// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.b81)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %Core.import_ref.1e6: @impl.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.%Op (constants.%Op.05a)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -382,44 +137,44 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Eats.decl: type = interface_decl @Eats [concrete = constants.%Eats.type] {} {} // CHECK:STDOUT: %Animal.decl: type = interface_decl @Animal [concrete = constants.%Animal.type] {} {} // CHECK:STDOUT: %Feed.decl: %Feed.type = fn_decl @Feed [concrete = constants.%Feed] { -// CHECK:STDOUT: %T.patt.loc8_9.1: %Eats.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.6be)] -// CHECK:STDOUT: %e.patt: @Feed.%T.as_type.loc8_22.2 (%T.as_type) = binding_pattern e -// CHECK:STDOUT: %e.param_patt: @Feed.%T.as_type.loc8_22.2 (%T.as_type) = value_param_pattern %e.patt, call_param0 +// CHECK:STDOUT: %T.patt.loc6_9.1: %Eats.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_9.2 (constants.%T.patt.6be)] +// CHECK:STDOUT: %e.patt: @Feed.%T.as_type.loc6_22.2 (%T.as_type) = binding_pattern e +// CHECK:STDOUT: %e.param_patt: @Feed.%T.as_type.loc6_22.2 (%T.as_type) = value_param_pattern %e.patt, call_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] -// CHECK:STDOUT: %T.loc8_9.1: %Eats.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T.1b5)] -// CHECK:STDOUT: %e.param: @Feed.%T.as_type.loc8_22.2 (%T.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc8_22.1: type = splice_block %.loc8_22.2 [symbolic = %T.as_type.loc8_22.2 (constants.%T.as_type)] { -// CHECK:STDOUT: %T.ref: %Eats.type = name_ref T, %T.loc8_9.1 [symbolic = %T.loc8_9.2 (constants.%T.1b5)] -// CHECK:STDOUT: %T.as_type.loc8_22.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc8_22.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc8_22.2: type = converted %T.ref, %T.as_type.loc8_22.1 [symbolic = %T.as_type.loc8_22.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.loc6_9.1: %Eats.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T.1b5)] +// CHECK:STDOUT: %e.param: @Feed.%T.as_type.loc6_22.2 (%T.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc6_22.1: type = splice_block %.loc6_22.2 [symbolic = %T.as_type.loc6_22.2 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref: %Eats.type = name_ref T, %T.loc6_9.1 [symbolic = %T.loc6_9.2 (constants.%T.1b5)] +// CHECK:STDOUT: %T.as_type.loc6_22.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc6_22.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc6_22.2: type = converted %T.ref, %T.as_type.loc6_22.1 [symbolic = %T.as_type.loc6_22.2 (constants.%T.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %e: @Feed.%T.as_type.loc8_22.2 (%T.as_type) = bind_name e, %e.param +// CHECK:STDOUT: %e: @Feed.%T.as_type.loc6_22.2 (%T.as_type) = bind_name e, %e.param // CHECK:STDOUT: } // CHECK:STDOUT: %HandleAnimal.decl: %HandleAnimal.type = fn_decl @HandleAnimal [concrete = constants.%HandleAnimal] { -// CHECK:STDOUT: %U.patt.loc10_17.1: %facet_type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc10_17.2 (constants.%U.patt)] -// CHECK:STDOUT: %a.patt: @HandleAnimal.%U.as_type.loc10_39.2 (%U.as_type) = binding_pattern a -// CHECK:STDOUT: %a.param_patt: @HandleAnimal.%U.as_type.loc10_39.2 (%U.as_type) = value_param_pattern %a.patt, call_param0 +// CHECK:STDOUT: %U.patt.loc8_17.1: %facet_type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_17.2 (constants.%U.patt)] +// CHECK:STDOUT: %a.patt: @HandleAnimal.%U.as_type.loc8_39.2 (%U.as_type) = binding_pattern a +// CHECK:STDOUT: %a.param_patt: @HandleAnimal.%U.as_type.loc8_39.2 (%U.as_type) = value_param_pattern %a.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc10_28.1: type = splice_block %.loc10_28.3 [concrete = constants.%facet_type] { +// CHECK:STDOUT: %.loc8_28.1: type = splice_block %.loc8_28.3 [concrete = constants.%facet_type] { // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %impl.elem0: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc10_28.1: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %bound_method.loc8_28.1: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_28.2: = bound_method %Animal.ref, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and: init type = call %bound_method.loc10_28.2(%Animal.ref, %Eats.ref) [concrete = constants.%facet_type] -// CHECK:STDOUT: %.loc10_28.2: type = value_of_initializer %type.and [concrete = constants.%facet_type] -// CHECK:STDOUT: %.loc10_28.3: type = converted %type.and, %.loc10_28.2 [concrete = constants.%facet_type] +// CHECK:STDOUT: %bound_method.loc8_28.2: = bound_method %Animal.ref, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc8_28.2(%Animal.ref, %Eats.ref) [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc8_28.2: type = value_of_initializer %type.and [concrete = constants.%facet_type] +// CHECK:STDOUT: %.loc8_28.3: type = converted %type.and, %.loc8_28.2 [concrete = constants.%facet_type] // CHECK:STDOUT: } -// CHECK:STDOUT: %U.loc10_17.1: %facet_type = bind_symbolic_name U, 0 [symbolic = %U.loc10_17.2 (constants.%U)] -// CHECK:STDOUT: %a.param: @HandleAnimal.%U.as_type.loc10_39.2 (%U.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc10_39.1: type = splice_block %.loc10_39.2 [symbolic = %U.as_type.loc10_39.2 (constants.%U.as_type)] { -// CHECK:STDOUT: %U.ref: %facet_type = name_ref U, %U.loc10_17.1 [symbolic = %U.loc10_17.2 (constants.%U)] -// CHECK:STDOUT: %U.as_type.loc10_39.1: type = facet_access_type %U.ref [symbolic = %U.as_type.loc10_39.2 (constants.%U.as_type)] -// CHECK:STDOUT: %.loc10_39.2: type = converted %U.ref, %U.as_type.loc10_39.1 [symbolic = %U.as_type.loc10_39.2 (constants.%U.as_type)] +// CHECK:STDOUT: %U.loc8_17.1: %facet_type = bind_symbolic_name U, 0 [symbolic = %U.loc8_17.2 (constants.%U)] +// CHECK:STDOUT: %a.param: @HandleAnimal.%U.as_type.loc8_39.2 (%U.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc8_39.1: type = splice_block %.loc8_39.2 [symbolic = %U.as_type.loc8_39.2 (constants.%U.as_type)] { +// CHECK:STDOUT: %U.ref: %facet_type = name_ref U, %U.loc8_17.1 [symbolic = %U.loc8_17.2 (constants.%U)] +// CHECK:STDOUT: %U.as_type.loc8_39.1: type = facet_access_type %U.ref [symbolic = %U.as_type.loc8_39.2 (constants.%U.as_type)] +// CHECK:STDOUT: %.loc8_39.2: type = converted %U.ref, %U.as_type.loc8_39.1 [symbolic = %U.as_type.loc8_39.2 (constants.%U.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @HandleAnimal.%U.as_type.loc10_39.2 (%U.as_type) = bind_name a, %a.param +// CHECK:STDOUT: %a: @HandleAnimal.%U.as_type.loc8_39.2 (%U.as_type) = bind_name a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -439,14 +194,14 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] { +// CHECK:STDOUT: interface @BitAnd [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0 // CHECK:STDOUT: .Op = imports.%Core.import_ref.08d // CHECK:STDOUT: witness = (imports.%Core.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] { +// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.1: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.e01)] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.1e6), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)] @@ -462,28 +217,28 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Feed(%T.loc8_9.1: %Eats.type) { -// CHECK:STDOUT: %T.loc8_9.2: %Eats.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T.1b5)] -// CHECK:STDOUT: %T.patt.loc8_9.2: %Eats.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt.6be)] -// CHECK:STDOUT: %T.as_type.loc8_22.2: type = facet_access_type %T.loc8_9.2 [symbolic = %T.as_type.loc8_22.2 (constants.%T.as_type)] +// CHECK:STDOUT: generic fn @Feed(%T.loc6_9.1: %Eats.type) { +// CHECK:STDOUT: %T.loc6_9.2: %Eats.type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T.1b5)] +// CHECK:STDOUT: %T.patt.loc6_9.2: %Eats.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_9.2 (constants.%T.patt.6be)] +// CHECK:STDOUT: %T.as_type.loc6_22.2: type = facet_access_type %T.loc6_9.2 [symbolic = %T.as_type.loc6_22.2 (constants.%T.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Feed.%T.as_type.loc8_22.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.c75)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Feed.%T.as_type.loc6_22.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.c75)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.patt.loc8_9.1: %Eats.type](%e.param_patt: @Feed.%T.as_type.loc8_22.2 (%T.as_type)) { +// CHECK:STDOUT: fn[%T.patt.loc6_9.1: %Eats.type](%e.param_patt: @Feed.%T.as_type.loc6_22.2 (%T.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)] // 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(imports.%Core.import_ref.5ab3ec.2: type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -491,37 +246,37 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T.8b3)](%other.param_patt: @Op.2.%T (%T.8b3)) -> @Op.2.%T (%T.8b3) = "type.and"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @HandleAnimal(%U.loc10_17.1: %facet_type) { -// CHECK:STDOUT: %U.loc10_17.2: %facet_type = bind_symbolic_name U, 0 [symbolic = %U.loc10_17.2 (constants.%U)] -// CHECK:STDOUT: %U.patt.loc10_17.2: %facet_type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc10_17.2 (constants.%U.patt)] -// CHECK:STDOUT: %U.as_type.loc10_39.2: type = facet_access_type %U.loc10_17.2 [symbolic = %U.as_type.loc10_39.2 (constants.%U.as_type)] +// CHECK:STDOUT: generic fn @HandleAnimal(%U.loc8_17.1: %facet_type) { +// CHECK:STDOUT: %U.loc8_17.2: %facet_type = bind_symbolic_name U, 0 [symbolic = %U.loc8_17.2 (constants.%U)] +// CHECK:STDOUT: %U.patt.loc8_17.2: %facet_type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_17.2 (constants.%U.patt)] +// CHECK:STDOUT: %U.as_type.loc8_39.2: type = facet_access_type %U.loc8_17.2 [symbolic = %U.as_type.loc8_39.2 (constants.%U.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @HandleAnimal.%U.as_type.loc10_39.2 (%U.as_type) [symbolic = %require_complete (constants.%require_complete.680)] -// CHECK:STDOUT: %U.as_wit.iface0.loc10_50.3: = facet_access_witness %U.loc10_17.2, element0 [symbolic = %U.as_wit.iface0.loc10_50.3 (constants.%U.as_wit.iface0)] -// CHECK:STDOUT: %Eats.facet.loc10_50.3: %Eats.type = facet_value %U.as_type.loc10_39.2, (%U.as_wit.iface0.loc10_50.3) [symbolic = %Eats.facet.loc10_50.3 (constants.%Eats.facet)] -// CHECK:STDOUT: %Feed.specific_fn.loc10_44.2: = specific_function constants.%Feed, @Feed(%Eats.facet.loc10_50.3) [symbolic = %Feed.specific_fn.loc10_44.2 (constants.%Feed.specific_fn)] +// CHECK:STDOUT: %require_complete: = require_complete_type @HandleAnimal.%U.as_type.loc8_39.2 (%U.as_type) [symbolic = %require_complete (constants.%require_complete.680)] +// CHECK:STDOUT: %U.as_wit.iface0.loc8_50.3: = facet_access_witness %U.loc8_17.2, element0 [symbolic = %U.as_wit.iface0.loc8_50.3 (constants.%U.as_wit.iface0)] +// CHECK:STDOUT: %Eats.facet.loc8_50.3: %Eats.type = facet_value %U.as_type.loc8_39.2, (%U.as_wit.iface0.loc8_50.3) [symbolic = %Eats.facet.loc8_50.3 (constants.%Eats.facet)] +// CHECK:STDOUT: %Feed.specific_fn.loc8_44.2: = specific_function constants.%Feed, @Feed(%Eats.facet.loc8_50.3) [symbolic = %Feed.specific_fn.loc8_44.2 (constants.%Feed.specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%U.patt.loc10_17.1: %facet_type](%a.param_patt: @HandleAnimal.%U.as_type.loc10_39.2 (%U.as_type)) { +// CHECK:STDOUT: fn[%U.patt.loc8_17.1: %facet_type](%a.param_patt: @HandleAnimal.%U.as_type.loc8_39.2 (%U.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Feed.ref: %Feed.type = name_ref Feed, file.%Feed.decl [concrete = constants.%Feed] -// CHECK:STDOUT: %a.ref: @HandleAnimal.%U.as_type.loc10_39.2 (%U.as_type) = name_ref a, %a -// CHECK:STDOUT: %U.as_wit.iface0.loc10_50.1: = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc10_50.3 (constants.%U.as_wit.iface0)] -// CHECK:STDOUT: %Eats.facet.loc10_50.1: %Eats.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.loc10_50.1) [symbolic = %Eats.facet.loc10_50.3 (constants.%Eats.facet)] -// CHECK:STDOUT: %.loc10_50.1: %Eats.type = converted constants.%U.as_type, %Eats.facet.loc10_50.1 [symbolic = %Eats.facet.loc10_50.3 (constants.%Eats.facet)] -// CHECK:STDOUT: %U.as_wit.iface0.loc10_50.2: = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc10_50.3 (constants.%U.as_wit.iface0)] -// CHECK:STDOUT: %Eats.facet.loc10_50.2: %Eats.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.loc10_50.2) [symbolic = %Eats.facet.loc10_50.3 (constants.%Eats.facet)] -// CHECK:STDOUT: %.loc10_50.2: %Eats.type = converted constants.%U.as_type, %Eats.facet.loc10_50.2 [symbolic = %Eats.facet.loc10_50.3 (constants.%Eats.facet)] -// CHECK:STDOUT: %Feed.specific_fn.loc10_44.1: = specific_function %Feed.ref, @Feed(constants.%Eats.facet) [symbolic = %Feed.specific_fn.loc10_44.2 (constants.%Feed.specific_fn)] -// CHECK:STDOUT: %Feed.call: init %empty_tuple.type = call %Feed.specific_fn.loc10_44.1(%a.ref) +// CHECK:STDOUT: %a.ref: @HandleAnimal.%U.as_type.loc8_39.2 (%U.as_type) = name_ref a, %a +// CHECK:STDOUT: %U.as_wit.iface0.loc8_50.1: = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc8_50.3 (constants.%U.as_wit.iface0)] +// CHECK:STDOUT: %Eats.facet.loc8_50.1: %Eats.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.loc8_50.1) [symbolic = %Eats.facet.loc8_50.3 (constants.%Eats.facet)] +// CHECK:STDOUT: %.loc8_50.1: %Eats.type = converted constants.%U.as_type, %Eats.facet.loc8_50.1 [symbolic = %Eats.facet.loc8_50.3 (constants.%Eats.facet)] +// CHECK:STDOUT: %U.as_wit.iface0.loc8_50.2: = facet_access_witness constants.%U, element0 [symbolic = %U.as_wit.iface0.loc8_50.3 (constants.%U.as_wit.iface0)] +// CHECK:STDOUT: %Eats.facet.loc8_50.2: %Eats.type = facet_value constants.%U.as_type, (%U.as_wit.iface0.loc8_50.2) [symbolic = %Eats.facet.loc8_50.3 (constants.%Eats.facet)] +// CHECK:STDOUT: %.loc8_50.2: %Eats.type = converted constants.%U.as_type, %Eats.facet.loc8_50.2 [symbolic = %Eats.facet.loc8_50.3 (constants.%Eats.facet)] +// CHECK:STDOUT: %Feed.specific_fn.loc8_44.1: = specific_function %Feed.ref, @Feed(constants.%Eats.facet) [symbolic = %Feed.specific_fn.loc8_44.2 (constants.%Feed.specific_fn)] +// CHECK:STDOUT: %Feed.call: init %empty_tuple.type = call %Feed.specific_fn.loc8_44.1(%a.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Feed(constants.%T.1b5) { -// CHECK:STDOUT: %T.loc8_9.2 => constants.%T.1b5 -// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T.1b5 -// CHECK:STDOUT: %T.as_type.loc8_22.2 => constants.%T.as_type +// CHECK:STDOUT: %T.loc6_9.2 => constants.%T.1b5 +// CHECK:STDOUT: %T.patt.loc6_9.2 => constants.%T.1b5 +// CHECK:STDOUT: %T.as_type.loc6_22.2 => constants.%T.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Self.25f) { @@ -559,21 +314,21 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HandleAnimal(constants.%U) { -// CHECK:STDOUT: %U.loc10_17.2 => constants.%U -// CHECK:STDOUT: %U.patt.loc10_17.2 => constants.%U -// CHECK:STDOUT: %U.as_type.loc10_39.2 => constants.%U.as_type +// CHECK:STDOUT: %U.loc8_17.2 => constants.%U +// CHECK:STDOUT: %U.patt.loc8_17.2 => constants.%U +// CHECK:STDOUT: %U.as_type.loc8_39.2 => constants.%U.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Feed(constants.%Eats.facet) { -// CHECK:STDOUT: %T.loc8_9.2 => constants.%Eats.facet -// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%Eats.facet -// CHECK:STDOUT: %T.as_type.loc8_22.2 => constants.%U.as_type +// CHECK:STDOUT: %T.loc6_9.2 => constants.%Eats.facet +// CHECK:STDOUT: %T.patt.loc6_9.2 => constants.%Eats.facet +// CHECK:STDOUT: %T.as_type.loc6_22.2 => constants.%U.as_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.680 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Feed(@HandleAnimal.%Eats.facet.loc10_50.3) {} +// CHECK:STDOUT: specific @Feed(@HandleAnimal.%Eats.facet.loc8_50.3) {} // CHECK:STDOUT: // CHECK:STDOUT: --- bigger.carbon // CHECK:STDOUT: @@ -636,18 +391,18 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .BitAnd = %Core.BitAnd -// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst59 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//default, loc8_41, loaded [concrete = constants.%assoc0] -// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//default, Op, loaded [concrete = constants.%Op.ab9] -// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//default, inst59 [no loc], loaded [symbolic = constants.%Self.25f] -// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//default, loc11_36, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.b81)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc11_14, loaded [symbolic = @impl.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc11_24, loaded [symbolic = @impl.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc11_29, loaded [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %Core.import_ref.1e6: @impl.%Op.type (%Op.type.f99) = import_ref Core//default, loc12_42, loaded [symbolic = @impl.%Op (constants.%Op.05a)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc11_14, loaded [symbolic = @impl.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst100 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0] +// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//prelude, Op, loaded [concrete = constants.%Op.ab9] +// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst100 [no loc], loaded [symbolic = constants.%Self.25f] +// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.b81)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %Core.import_ref.1e6: @impl.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.%Op (constants.%Op.05a)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -664,62 +419,62 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Animal.decl: type = interface_decl @Animal [concrete = constants.%Animal.type] {} {} // CHECK:STDOUT: %Tame.decl: type = interface_decl @Tame [concrete = constants.%Tame.type] {} {} // CHECK:STDOUT: %FeedTame.decl: %FeedTame.type = fn_decl @FeedTame [concrete = constants.%FeedTame] { -// CHECK:STDOUT: %V.patt.loc9_13.1: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_13.2 (constants.%V.patt)] -// CHECK:STDOUT: %v.patt: @FeedTame.%V.as_type.loc9_33.2 (%V.as_type) = binding_pattern v -// CHECK:STDOUT: %v.param_patt: @FeedTame.%V.as_type.loc9_33.2 (%V.as_type) = value_param_pattern %v.patt, call_param0 +// CHECK:STDOUT: %V.patt.loc7_13.1: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc7_13.2 (constants.%V.patt)] +// CHECK:STDOUT: %v.patt: @FeedTame.%V.as_type.loc7_33.2 (%V.as_type) = binding_pattern v +// CHECK:STDOUT: %v.param_patt: @FeedTame.%V.as_type.loc7_33.2 (%V.as_type) = value_param_pattern %v.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_22.1: type = splice_block %.loc9_22.3 [concrete = constants.%facet_type.6ff] { +// CHECK:STDOUT: %.loc7_22.1: type = splice_block %.loc7_22.3 [concrete = constants.%facet_type.6ff] { // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %impl.elem0: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc9_22.1: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] +// CHECK:STDOUT: %bound_method.loc7_22.1: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc9_22.2: = bound_method %Tame.ref, %specific_fn [concrete = constants.%bound_method.a56] -// CHECK:STDOUT: %type.and: init type = call %bound_method.loc9_22.2(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] -// CHECK:STDOUT: %.loc9_22.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.6ff] -// CHECK:STDOUT: %.loc9_22.3: type = converted %type.and, %.loc9_22.2 [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %bound_method.loc7_22.2: = bound_method %Tame.ref, %specific_fn [concrete = constants.%bound_method.a56] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc7_22.2(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %.loc7_22.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %.loc7_22.3: type = converted %type.and, %.loc7_22.2 [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: } -// CHECK:STDOUT: %V.loc9_13.1: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc9_13.2 (constants.%V)] -// CHECK:STDOUT: %v.param: @FeedTame.%V.as_type.loc9_33.2 (%V.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc9_33.1: type = splice_block %.loc9_33.2 [symbolic = %V.as_type.loc9_33.2 (constants.%V.as_type)] { -// CHECK:STDOUT: %V.ref: %facet_type.6ff = name_ref V, %V.loc9_13.1 [symbolic = %V.loc9_13.2 (constants.%V)] -// CHECK:STDOUT: %V.as_type.loc9_33.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc9_33.2 (constants.%V.as_type)] -// CHECK:STDOUT: %.loc9_33.2: type = converted %V.ref, %V.as_type.loc9_33.1 [symbolic = %V.as_type.loc9_33.2 (constants.%V.as_type)] +// CHECK:STDOUT: %V.loc7_13.1: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc7_13.2 (constants.%V)] +// CHECK:STDOUT: %v.param: @FeedTame.%V.as_type.loc7_33.2 (%V.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc7_33.1: type = splice_block %.loc7_33.2 [symbolic = %V.as_type.loc7_33.2 (constants.%V.as_type)] { +// CHECK:STDOUT: %V.ref: %facet_type.6ff = name_ref V, %V.loc7_13.1 [symbolic = %V.loc7_13.2 (constants.%V)] +// CHECK:STDOUT: %V.as_type.loc7_33.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc7_33.2 (constants.%V.as_type)] +// CHECK:STDOUT: %.loc7_33.2: type = converted %V.ref, %V.as_type.loc7_33.1 [symbolic = %V.as_type.loc7_33.2 (constants.%V.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: @FeedTame.%V.as_type.loc9_33.2 (%V.as_type) = bind_name v, %v.param +// CHECK:STDOUT: %v: @FeedTame.%V.as_type.loc7_33.2 (%V.as_type) = bind_name v, %v.param // CHECK:STDOUT: } // CHECK:STDOUT: %HandleTameAnimal.decl: %HandleTameAnimal.type = fn_decl @HandleTameAnimal [concrete = constants.%HandleTameAnimal] { -// CHECK:STDOUT: %W.patt.loc11_21.1: %facet_type.a95 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_21.2 (constants.%W.patt)] -// CHECK:STDOUT: %w.patt: @HandleTameAnimal.%W.as_type.loc11_50.2 (%W.as_type) = binding_pattern w -// CHECK:STDOUT: %w.param_patt: @HandleTameAnimal.%W.as_type.loc11_50.2 (%W.as_type) = value_param_pattern %w.patt, call_param0 +// CHECK:STDOUT: %W.patt.loc9_21.1: %facet_type.a95 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc9_21.2 (constants.%W.patt)] +// CHECK:STDOUT: %w.patt: @HandleTameAnimal.%W.as_type.loc9_50.2 (%W.as_type) = binding_pattern w +// CHECK:STDOUT: %w.param_patt: @HandleTameAnimal.%W.as_type.loc9_50.2 (%W.as_type) = value_param_pattern %w.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_39.1: type = splice_block %.loc11_39.3 [concrete = constants.%facet_type.a95] { +// CHECK:STDOUT: %.loc9_39.1: type = splice_block %.loc9_39.3 [concrete = constants.%facet_type.a95] { // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] -// CHECK:STDOUT: %impl.elem0.loc11_30: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc11_30.1: = bound_method %Eats.ref, %impl.elem0.loc11_30 [concrete = constants.%Op.bound.d46] -// CHECK:STDOUT: %specific_fn.loc11_30: = specific_function %impl.elem0.loc11_30, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_30.2: = bound_method %Eats.ref, %specific_fn.loc11_30 [concrete = constants.%bound_method.f8f] -// CHECK:STDOUT: %type.and.loc11_30: init type = call %bound_method.loc11_30.2(%Eats.ref, %Animal.ref) [concrete = constants.%facet_type.c3f] +// CHECK:STDOUT: %impl.elem0.loc9_30: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc9_30.1: = bound_method %Eats.ref, %impl.elem0.loc9_30 [concrete = constants.%Op.bound.d46] +// CHECK:STDOUT: %specific_fn.loc9_30: = specific_function %impl.elem0.loc9_30, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_30.2: = bound_method %Eats.ref, %specific_fn.loc9_30 [concrete = constants.%bound_method.f8f] +// CHECK:STDOUT: %type.and.loc9_30: init type = call %bound_method.loc9_30.2(%Eats.ref, %Animal.ref) [concrete = constants.%facet_type.c3f] // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] -// CHECK:STDOUT: %impl.elem0.loc11_39: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc11_39.1: = bound_method %type.and.loc11_30, %impl.elem0.loc11_39 [concrete = constants.%Op.bound.c0a] -// CHECK:STDOUT: %specific_fn.loc11_39: = specific_function %impl.elem0.loc11_39, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_39.2: = bound_method %type.and.loc11_30, %specific_fn.loc11_39 [concrete = constants.%bound_method.7fc] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %type.and.loc11_30 [concrete = constants.%facet_type.c3f] -// CHECK:STDOUT: %.loc11_30.2: type = converted %type.and.loc11_30, %.loc11_30.1 [concrete = constants.%facet_type.c3f] -// CHECK:STDOUT: %type.and.loc11_39: init type = call %bound_method.loc11_39.2(%.loc11_30.2, %Tame.ref) [concrete = constants.%facet_type.a95] -// CHECK:STDOUT: %.loc11_39.2: type = value_of_initializer %type.and.loc11_39 [concrete = constants.%facet_type.a95] -// CHECK:STDOUT: %.loc11_39.3: type = converted %type.and.loc11_39, %.loc11_39.2 [concrete = constants.%facet_type.a95] +// CHECK:STDOUT: %impl.elem0.loc9_39: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc9_39.1: = bound_method %type.and.loc9_30, %impl.elem0.loc9_39 [concrete = constants.%Op.bound.c0a] +// CHECK:STDOUT: %specific_fn.loc9_39: = specific_function %impl.elem0.loc9_39, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc9_39.2: = bound_method %type.and.loc9_30, %specific_fn.loc9_39 [concrete = constants.%bound_method.7fc] +// CHECK:STDOUT: %.loc9_30.1: type = value_of_initializer %type.and.loc9_30 [concrete = constants.%facet_type.c3f] +// CHECK:STDOUT: %.loc9_30.2: type = converted %type.and.loc9_30, %.loc9_30.1 [concrete = constants.%facet_type.c3f] +// CHECK:STDOUT: %type.and.loc9_39: init type = call %bound_method.loc9_39.2(%.loc9_30.2, %Tame.ref) [concrete = constants.%facet_type.a95] +// CHECK:STDOUT: %.loc9_39.2: type = value_of_initializer %type.and.loc9_39 [concrete = constants.%facet_type.a95] +// CHECK:STDOUT: %.loc9_39.3: type = converted %type.and.loc9_39, %.loc9_39.2 [concrete = constants.%facet_type.a95] // CHECK:STDOUT: } -// CHECK:STDOUT: %W.loc11_21.1: %facet_type.a95 = bind_symbolic_name W, 0 [symbolic = %W.loc11_21.2 (constants.%W)] -// CHECK:STDOUT: %w.param: @HandleTameAnimal.%W.as_type.loc11_50.2 (%W.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc11_50.1: type = splice_block %.loc11_50.2 [symbolic = %W.as_type.loc11_50.2 (constants.%W.as_type)] { -// CHECK:STDOUT: %W.ref: %facet_type.a95 = name_ref W, %W.loc11_21.1 [symbolic = %W.loc11_21.2 (constants.%W)] -// CHECK:STDOUT: %W.as_type.loc11_50.1: type = facet_access_type %W.ref [symbolic = %W.as_type.loc11_50.2 (constants.%W.as_type)] -// CHECK:STDOUT: %.loc11_50.2: type = converted %W.ref, %W.as_type.loc11_50.1 [symbolic = %W.as_type.loc11_50.2 (constants.%W.as_type)] +// CHECK:STDOUT: %W.loc9_21.1: %facet_type.a95 = bind_symbolic_name W, 0 [symbolic = %W.loc9_21.2 (constants.%W)] +// CHECK:STDOUT: %w.param: @HandleTameAnimal.%W.as_type.loc9_50.2 (%W.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc9_50.1: type = splice_block %.loc9_50.2 [symbolic = %W.as_type.loc9_50.2 (constants.%W.as_type)] { +// CHECK:STDOUT: %W.ref: %facet_type.a95 = name_ref W, %W.loc9_21.1 [symbolic = %W.loc9_21.2 (constants.%W)] +// CHECK:STDOUT: %W.as_type.loc9_50.1: type = facet_access_type %W.ref [symbolic = %W.as_type.loc9_50.2 (constants.%W.as_type)] +// CHECK:STDOUT: %.loc9_50.2: type = converted %W.ref, %W.as_type.loc9_50.1 [symbolic = %W.as_type.loc9_50.2 (constants.%W.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %w: @HandleTameAnimal.%W.as_type.loc11_50.2 (%W.as_type) = bind_name w, %w.param +// CHECK:STDOUT: %w: @HandleTameAnimal.%W.as_type.loc9_50.2 (%W.as_type) = bind_name w, %w.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -747,14 +502,14 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] { +// CHECK:STDOUT: interface @BitAnd [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0 // CHECK:STDOUT: .Op = imports.%Core.import_ref.08d // CHECK:STDOUT: witness = (imports.%Core.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] { +// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.1: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.1e6), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)] @@ -770,14 +525,14 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)] // 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(imports.%Core.import_ref.5ab3ec.2: type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -785,46 +540,46 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @FeedTame(%V.loc9_13.1: %facet_type.6ff) { -// CHECK:STDOUT: %V.loc9_13.2: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc9_13.2 (constants.%V)] -// CHECK:STDOUT: %V.patt.loc9_13.2: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_13.2 (constants.%V.patt)] -// CHECK:STDOUT: %V.as_type.loc9_33.2: type = facet_access_type %V.loc9_13.2 [symbolic = %V.as_type.loc9_33.2 (constants.%V.as_type)] +// CHECK:STDOUT: generic fn @FeedTame(%V.loc7_13.1: %facet_type.6ff) { +// CHECK:STDOUT: %V.loc7_13.2: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc7_13.2 (constants.%V)] +// CHECK:STDOUT: %V.patt.loc7_13.2: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc7_13.2 (constants.%V.patt)] +// CHECK:STDOUT: %V.as_type.loc7_33.2: type = facet_access_type %V.loc7_13.2 [symbolic = %V.as_type.loc7_33.2 (constants.%V.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @FeedTame.%V.as_type.loc9_33.2 (%V.as_type) [symbolic = %require_complete (constants.%require_complete.940)] +// CHECK:STDOUT: %require_complete: = require_complete_type @FeedTame.%V.as_type.loc7_33.2 (%V.as_type) [symbolic = %require_complete (constants.%require_complete.940)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%V.patt.loc9_13.1: %facet_type.6ff](%v.param_patt: @FeedTame.%V.as_type.loc9_33.2 (%V.as_type)) { +// CHECK:STDOUT: fn[%V.patt.loc7_13.1: %facet_type.6ff](%v.param_patt: @FeedTame.%V.as_type.loc7_33.2 (%V.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @HandleTameAnimal(%W.loc11_21.1: %facet_type.a95) { -// CHECK:STDOUT: %W.loc11_21.2: %facet_type.a95 = bind_symbolic_name W, 0 [symbolic = %W.loc11_21.2 (constants.%W)] -// CHECK:STDOUT: %W.patt.loc11_21.2: %facet_type.a95 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_21.2 (constants.%W.patt)] -// CHECK:STDOUT: %W.as_type.loc11_50.2: type = facet_access_type %W.loc11_21.2 [symbolic = %W.as_type.loc11_50.2 (constants.%W.as_type)] +// CHECK:STDOUT: generic fn @HandleTameAnimal(%W.loc9_21.1: %facet_type.a95) { +// CHECK:STDOUT: %W.loc9_21.2: %facet_type.a95 = bind_symbolic_name W, 0 [symbolic = %W.loc9_21.2 (constants.%W)] +// CHECK:STDOUT: %W.patt.loc9_21.2: %facet_type.a95 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc9_21.2 (constants.%W.patt)] +// CHECK:STDOUT: %W.as_type.loc9_50.2: type = facet_access_type %W.loc9_21.2 [symbolic = %W.as_type.loc9_50.2 (constants.%W.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @HandleTameAnimal.%W.as_type.loc11_50.2 (%W.as_type) [symbolic = %require_complete (constants.%require_complete.40f)] -// CHECK:STDOUT: %W.as_wit.iface0.loc12_13.3: = facet_access_witness %W.loc11_21.2, element0 [symbolic = %W.as_wit.iface0.loc12_13.3 (constants.%W.as_wit.iface0)] -// CHECK:STDOUT: %W.as_wit.iface2.loc12_13.3: = facet_access_witness %W.loc11_21.2, element2 [symbolic = %W.as_wit.iface2.loc12_13.3 (constants.%W.as_wit.iface2)] -// CHECK:STDOUT: %facet_value.loc12_13.3: %facet_type.6ff = facet_value %W.as_type.loc11_50.2, (%W.as_wit.iface0.loc12_13.3, %W.as_wit.iface2.loc12_13.3) [symbolic = %facet_value.loc12_13.3 (constants.%facet_value)] -// CHECK:STDOUT: %FeedTame.specific_fn.loc12_3.2: = specific_function constants.%FeedTame, @FeedTame(%facet_value.loc12_13.3) [symbolic = %FeedTame.specific_fn.loc12_3.2 (constants.%FeedTame.specific_fn)] +// CHECK:STDOUT: %require_complete: = require_complete_type @HandleTameAnimal.%W.as_type.loc9_50.2 (%W.as_type) [symbolic = %require_complete (constants.%require_complete.40f)] +// CHECK:STDOUT: %W.as_wit.iface0.loc10_13.3: = facet_access_witness %W.loc9_21.2, element0 [symbolic = %W.as_wit.iface0.loc10_13.3 (constants.%W.as_wit.iface0)] +// CHECK:STDOUT: %W.as_wit.iface2.loc10_13.3: = facet_access_witness %W.loc9_21.2, element2 [symbolic = %W.as_wit.iface2.loc10_13.3 (constants.%W.as_wit.iface2)] +// CHECK:STDOUT: %facet_value.loc10_13.3: %facet_type.6ff = facet_value %W.as_type.loc9_50.2, (%W.as_wit.iface0.loc10_13.3, %W.as_wit.iface2.loc10_13.3) [symbolic = %facet_value.loc10_13.3 (constants.%facet_value)] +// CHECK:STDOUT: %FeedTame.specific_fn.loc10_3.2: = specific_function constants.%FeedTame, @FeedTame(%facet_value.loc10_13.3) [symbolic = %FeedTame.specific_fn.loc10_3.2 (constants.%FeedTame.specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%W.patt.loc11_21.1: %facet_type.a95](%w.param_patt: @HandleTameAnimal.%W.as_type.loc11_50.2 (%W.as_type)) { +// CHECK:STDOUT: fn[%W.patt.loc9_21.1: %facet_type.a95](%w.param_patt: @HandleTameAnimal.%W.as_type.loc9_50.2 (%W.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %FeedTame.ref: %FeedTame.type = name_ref FeedTame, file.%FeedTame.decl [concrete = constants.%FeedTame] -// CHECK:STDOUT: %w.ref: @HandleTameAnimal.%W.as_type.loc11_50.2 (%W.as_type) = name_ref w, %w -// CHECK:STDOUT: %W.as_wit.iface0.loc12_13.1: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc12_13.3 (constants.%W.as_wit.iface0)] -// CHECK:STDOUT: %W.as_wit.iface2.loc12_13.1: = facet_access_witness constants.%W, element2 [symbolic = %W.as_wit.iface2.loc12_13.3 (constants.%W.as_wit.iface2)] -// CHECK:STDOUT: %facet_value.loc12_13.1: %facet_type.6ff = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc12_13.1, %W.as_wit.iface2.loc12_13.1) [symbolic = %facet_value.loc12_13.3 (constants.%facet_value)] -// CHECK:STDOUT: %.loc12_13.1: %facet_type.6ff = converted constants.%W.as_type, %facet_value.loc12_13.1 [symbolic = %facet_value.loc12_13.3 (constants.%facet_value)] -// CHECK:STDOUT: %W.as_wit.iface0.loc12_13.2: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc12_13.3 (constants.%W.as_wit.iface0)] -// CHECK:STDOUT: %W.as_wit.iface2.loc12_13.2: = facet_access_witness constants.%W, element2 [symbolic = %W.as_wit.iface2.loc12_13.3 (constants.%W.as_wit.iface2)] -// CHECK:STDOUT: %facet_value.loc12_13.2: %facet_type.6ff = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc12_13.2, %W.as_wit.iface2.loc12_13.2) [symbolic = %facet_value.loc12_13.3 (constants.%facet_value)] -// CHECK:STDOUT: %.loc12_13.2: %facet_type.6ff = converted constants.%W.as_type, %facet_value.loc12_13.2 [symbolic = %facet_value.loc12_13.3 (constants.%facet_value)] -// CHECK:STDOUT: %FeedTame.specific_fn.loc12_3.1: = specific_function %FeedTame.ref, @FeedTame(constants.%facet_value) [symbolic = %FeedTame.specific_fn.loc12_3.2 (constants.%FeedTame.specific_fn)] -// CHECK:STDOUT: %FeedTame.call: init %empty_tuple.type = call %FeedTame.specific_fn.loc12_3.1(%w.ref) +// CHECK:STDOUT: %w.ref: @HandleTameAnimal.%W.as_type.loc9_50.2 (%W.as_type) = name_ref w, %w +// CHECK:STDOUT: %W.as_wit.iface0.loc10_13.1: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc10_13.3 (constants.%W.as_wit.iface0)] +// CHECK:STDOUT: %W.as_wit.iface2.loc10_13.1: = facet_access_witness constants.%W, element2 [symbolic = %W.as_wit.iface2.loc10_13.3 (constants.%W.as_wit.iface2)] +// CHECK:STDOUT: %facet_value.loc10_13.1: %facet_type.6ff = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc10_13.1, %W.as_wit.iface2.loc10_13.1) [symbolic = %facet_value.loc10_13.3 (constants.%facet_value)] +// CHECK:STDOUT: %.loc10_13.1: %facet_type.6ff = converted constants.%W.as_type, %facet_value.loc10_13.1 [symbolic = %facet_value.loc10_13.3 (constants.%facet_value)] +// CHECK:STDOUT: %W.as_wit.iface0.loc10_13.2: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc10_13.3 (constants.%W.as_wit.iface0)] +// CHECK:STDOUT: %W.as_wit.iface2.loc10_13.2: = facet_access_witness constants.%W, element2 [symbolic = %W.as_wit.iface2.loc10_13.3 (constants.%W.as_wit.iface2)] +// CHECK:STDOUT: %facet_value.loc10_13.2: %facet_type.6ff = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc10_13.2, %W.as_wit.iface2.loc10_13.2) [symbolic = %facet_value.loc10_13.3 (constants.%facet_value)] +// CHECK:STDOUT: %.loc10_13.2: %facet_type.6ff = converted constants.%W.as_type, %facet_value.loc10_13.2 [symbolic = %facet_value.loc10_13.3 (constants.%facet_value)] +// CHECK:STDOUT: %FeedTame.specific_fn.loc10_3.1: = specific_function %FeedTame.ref, @FeedTame(constants.%facet_value) [symbolic = %FeedTame.specific_fn.loc10_3.2 (constants.%FeedTame.specific_fn)] +// CHECK:STDOUT: %FeedTame.call: init %empty_tuple.type = call %FeedTame.specific_fn.loc10_3.1(%w.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -864,27 +619,27 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @FeedTame(constants.%V) { -// CHECK:STDOUT: %V.loc9_13.2 => constants.%V -// CHECK:STDOUT: %V.patt.loc9_13.2 => constants.%V -// CHECK:STDOUT: %V.as_type.loc9_33.2 => constants.%V.as_type +// CHECK:STDOUT: %V.loc7_13.2 => constants.%V +// CHECK:STDOUT: %V.patt.loc7_13.2 => constants.%V +// CHECK:STDOUT: %V.as_type.loc7_33.2 => constants.%V.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HandleTameAnimal(constants.%W) { -// CHECK:STDOUT: %W.loc11_21.2 => constants.%W -// CHECK:STDOUT: %W.patt.loc11_21.2 => constants.%W -// CHECK:STDOUT: %W.as_type.loc11_50.2 => constants.%W.as_type +// CHECK:STDOUT: %W.loc9_21.2 => constants.%W +// CHECK:STDOUT: %W.patt.loc9_21.2 => constants.%W +// CHECK:STDOUT: %W.as_type.loc9_50.2 => constants.%W.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @FeedTame(constants.%facet_value) { -// CHECK:STDOUT: %V.loc9_13.2 => constants.%facet_value -// CHECK:STDOUT: %V.patt.loc9_13.2 => constants.%facet_value -// CHECK:STDOUT: %V.as_type.loc9_33.2 => constants.%W.as_type +// CHECK:STDOUT: %V.loc7_13.2 => constants.%facet_value +// CHECK:STDOUT: %V.patt.loc7_13.2 => constants.%facet_value +// CHECK:STDOUT: %V.as_type.loc7_33.2 => constants.%W.as_type // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%require_complete.40f // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @FeedTame(@HandleTameAnimal.%facet_value.loc12_13.3) {} +// CHECK:STDOUT: specific @FeedTame(@HandleTameAnimal.%facet_value.loc10_13.3) {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_with_blanket.carbon // CHECK:STDOUT: @@ -941,9 +696,11 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %W.as_wit.iface0: = facet_access_witness %W, element0 [symbolic] // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value %W.as_type, (%W.as_wit.iface0) [symbolic] // CHECK:STDOUT: %impl_witness.1d8: = impl_witness (), @impl.e7b(%Animal.facet) [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic] +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] // CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%T) [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic] // CHECK:STDOUT: %Self.as_type.40a: type = facet_access_type %Self.519 [symbolic] // CHECK:STDOUT: %ImplicitAs.assoc_type.837: type = assoc_entity_type %ImplicitAs.type.d62 [symbolic] @@ -960,25 +717,25 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .BitAnd = %Core.BitAnd // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst59 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//default, loc8_41, loaded [concrete = constants.%assoc0.a63] -// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//default, Op, loaded [concrete = constants.%Op.ab9] -// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//default, inst59 [no loc], loaded [symbolic = constants.%Self.25f] -// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//default, loc11_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc11_14, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc11_24, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc11_29, loaded [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//default, loc12_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc11_14, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//default, loc3_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst24 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc4_32, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] -// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//default, loc3_22, loaded [symbolic = @ImplicitAs.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst24 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] -// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc4_32, unloaded +// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst100 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0.a63] +// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//prelude, Op, loaded [concrete = constants.%Op.ab9] +// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst100 [no loc], loaded [symbolic = constants.%Self.25f] +// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst65 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] +// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst65 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] +// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//prelude, loc14_35, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -995,65 +752,65 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %Animal.decl: type = interface_decl @Animal [concrete = constants.%Animal.type] {} {} // CHECK:STDOUT: %Tame.decl: type = interface_decl @Tame [concrete = constants.%Tame.type] {} {} // CHECK:STDOUT: impl_decl @impl.e7b [concrete] { -// CHECK:STDOUT: %A.patt.loc9_14.1: %Animal.type = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc9_14.2 (constants.%A.patt)] +// CHECK:STDOUT: %A.patt.loc7_14.1: %Animal.type = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc7_14.2 (constants.%A.patt)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %A.ref: %Animal.type = name_ref A, %A.loc9_14.1 [symbolic = %A.loc9_14.2 (constants.%A)] -// CHECK:STDOUT: %A.as_type.loc9_26.1: type = facet_access_type %A.ref [symbolic = %A.as_type.loc9_26.2 (constants.%A.as_type)] -// CHECK:STDOUT: %.loc9: type = converted %A.ref, %A.as_type.loc9_26.1 [symbolic = %A.as_type.loc9_26.2 (constants.%A.as_type)] +// CHECK:STDOUT: %A.ref: %Animal.type = name_ref A, %A.loc7_14.1 [symbolic = %A.loc7_14.2 (constants.%A)] +// CHECK:STDOUT: %A.as_type.loc7_26.1: type = facet_access_type %A.ref [symbolic = %A.as_type.loc7_26.2 (constants.%A.as_type)] +// CHECK:STDOUT: %.loc7: type = converted %A.ref, %A.as_type.loc7_26.1 [symbolic = %A.as_type.loc7_26.2 (constants.%A.as_type)] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] -// CHECK:STDOUT: %A.loc9_14.1: %Animal.type = bind_symbolic_name A, 0 [symbolic = %A.loc9_14.2 (constants.%A)] +// CHECK:STDOUT: %A.loc7_14.1: %Animal.type = bind_symbolic_name A, 0 [symbolic = %A.loc7_14.2 (constants.%A)] // CHECK:STDOUT: } // CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.e7b(constants.%A) [symbolic = @impl.e7b.%impl_witness (constants.%impl_witness.110)] // CHECK:STDOUT: %FeedTame2.decl: %FeedTame2.type = fn_decl @FeedTame2 [concrete = constants.%FeedTame2] { -// CHECK:STDOUT: %V.patt.loc11_14.1: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc11_14.2 (constants.%V.patt)] -// CHECK:STDOUT: %v.patt: @FeedTame2.%V.as_type.loc11_34.2 (%V.as_type) = binding_pattern v -// CHECK:STDOUT: %v.param_patt: @FeedTame2.%V.as_type.loc11_34.2 (%V.as_type) = value_param_pattern %v.patt, call_param0 +// CHECK:STDOUT: %V.patt.loc9_14.1: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_14.2 (constants.%V.patt)] +// CHECK:STDOUT: %v.patt: @FeedTame2.%V.as_type.loc9_34.2 (%V.as_type) = binding_pattern v +// CHECK:STDOUT: %v.param_patt: @FeedTame2.%V.as_type.loc9_34.2 (%V.as_type) = value_param_pattern %v.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_23.1: type = splice_block %.loc11_23.3 [concrete = constants.%facet_type.6ff] { +// CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.3 [concrete = constants.%facet_type.6ff] { // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] // CHECK:STDOUT: %Eats.ref: type = name_ref Eats, file.%Eats.decl [concrete = constants.%Eats.type] // CHECK:STDOUT: %impl.elem0: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc11_23.1: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] +// CHECK:STDOUT: %bound_method.loc9_23.1: = bound_method %Tame.ref, %impl.elem0 [concrete = constants.%Op.bound.9f8] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_23.2: = bound_method %Tame.ref, %specific_fn [concrete = constants.%bound_method.a56] -// CHECK:STDOUT: %type.and: init type = call %bound_method.loc11_23.2(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] -// CHECK:STDOUT: %.loc11_23.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.6ff] -// CHECK:STDOUT: %.loc11_23.3: type = converted %type.and, %.loc11_23.2 [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %bound_method.loc9_23.2: = bound_method %Tame.ref, %specific_fn [concrete = constants.%bound_method.a56] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc9_23.2(%Tame.ref, %Eats.ref) [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %.loc9_23.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.6ff] +// CHECK:STDOUT: %.loc9_23.3: type = converted %type.and, %.loc9_23.2 [concrete = constants.%facet_type.6ff] // CHECK:STDOUT: } -// CHECK:STDOUT: %V.loc11_14.1: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)] -// CHECK:STDOUT: %v.param: @FeedTame2.%V.as_type.loc11_34.2 (%V.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc11_34.1: type = splice_block %.loc11_34.2 [symbolic = %V.as_type.loc11_34.2 (constants.%V.as_type)] { -// CHECK:STDOUT: %V.ref: %facet_type.6ff = name_ref V, %V.loc11_14.1 [symbolic = %V.loc11_14.2 (constants.%V)] -// CHECK:STDOUT: %V.as_type.loc11_34.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc11_34.2 (constants.%V.as_type)] -// CHECK:STDOUT: %.loc11_34.2: type = converted %V.ref, %V.as_type.loc11_34.1 [symbolic = %V.as_type.loc11_34.2 (constants.%V.as_type)] +// CHECK:STDOUT: %V.loc9_14.1: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc9_14.2 (constants.%V)] +// CHECK:STDOUT: %v.param: @FeedTame2.%V.as_type.loc9_34.2 (%V.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc9_34.1: type = splice_block %.loc9_34.2 [symbolic = %V.as_type.loc9_34.2 (constants.%V.as_type)] { +// CHECK:STDOUT: %V.ref: %facet_type.6ff = name_ref V, %V.loc9_14.1 [symbolic = %V.loc9_14.2 (constants.%V)] +// CHECK:STDOUT: %V.as_type.loc9_34.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc9_34.2 (constants.%V.as_type)] +// CHECK:STDOUT: %.loc9_34.2: type = converted %V.ref, %V.as_type.loc9_34.1 [symbolic = %V.as_type.loc9_34.2 (constants.%V.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: @FeedTame2.%V.as_type.loc11_34.2 (%V.as_type) = bind_name v, %v.param +// CHECK:STDOUT: %v: @FeedTame2.%V.as_type.loc9_34.2 (%V.as_type) = bind_name v, %v.param // CHECK:STDOUT: } // CHECK:STDOUT: %HandleTameAnimal2.decl: %HandleTameAnimal2.type = fn_decl @HandleTameAnimal2 [concrete = constants.%HandleTameAnimal2] { -// CHECK:STDOUT: %W.patt.loc13_22.1: %facet_type.65c = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc13_22.2 (constants.%W.patt)] -// CHECK:STDOUT: %w.patt: @HandleTameAnimal2.%W.as_type.loc13_44.2 (%W.as_type) = binding_pattern w -// CHECK:STDOUT: %w.param_patt: @HandleTameAnimal2.%W.as_type.loc13_44.2 (%W.as_type) = value_param_pattern %w.patt, call_param0 +// CHECK:STDOUT: %W.patt.loc11_22.1: %facet_type.65c = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_22.2 (constants.%W.patt)] +// CHECK:STDOUT: %w.patt: @HandleTameAnimal2.%W.as_type.loc11_44.2 (%W.as_type) = binding_pattern w +// CHECK:STDOUT: %w.param_patt: @HandleTameAnimal2.%W.as_type.loc11_44.2 (%W.as_type) = value_param_pattern %w.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc13_33.1: type = splice_block %.loc13_33.3 [concrete = constants.%facet_type.65c] { +// CHECK:STDOUT: %.loc11_33.1: type = splice_block %.loc11_33.3 [concrete = constants.%facet_type.65c] { // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type] // CHECK:STDOUT: %Tame.ref: type = name_ref Tame, file.%Tame.decl [concrete = constants.%Tame.type] // CHECK:STDOUT: %impl.elem0: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc13_33.1: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound.fe3] +// CHECK:STDOUT: %bound_method.loc11_33.1: = bound_method %Animal.ref, %impl.elem0 [concrete = constants.%Op.bound.fe3] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc13_33.2: = bound_method %Animal.ref, %specific_fn [concrete = constants.%bound_method.a26] -// CHECK:STDOUT: %type.and: init type = call %bound_method.loc13_33.2(%Animal.ref, %Tame.ref) [concrete = constants.%facet_type.65c] -// CHECK:STDOUT: %.loc13_33.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.65c] -// CHECK:STDOUT: %.loc13_33.3: type = converted %type.and, %.loc13_33.2 [concrete = constants.%facet_type.65c] +// CHECK:STDOUT: %bound_method.loc11_33.2: = bound_method %Animal.ref, %specific_fn [concrete = constants.%bound_method.a26] +// CHECK:STDOUT: %type.and: init type = call %bound_method.loc11_33.2(%Animal.ref, %Tame.ref) [concrete = constants.%facet_type.65c] +// CHECK:STDOUT: %.loc11_33.2: type = value_of_initializer %type.and [concrete = constants.%facet_type.65c] +// CHECK:STDOUT: %.loc11_33.3: type = converted %type.and, %.loc11_33.2 [concrete = constants.%facet_type.65c] // CHECK:STDOUT: } -// CHECK:STDOUT: %W.loc13_22.1: %facet_type.65c = bind_symbolic_name W, 0 [symbolic = %W.loc13_22.2 (constants.%W)] -// CHECK:STDOUT: %w.param: @HandleTameAnimal2.%W.as_type.loc13_44.2 (%W.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc13_44.1: type = splice_block %.loc13_44.2 [symbolic = %W.as_type.loc13_44.2 (constants.%W.as_type)] { -// CHECK:STDOUT: %W.ref: %facet_type.65c = name_ref W, %W.loc13_22.1 [symbolic = %W.loc13_22.2 (constants.%W)] -// CHECK:STDOUT: %W.as_type.loc13_44.1: type = facet_access_type %W.ref [symbolic = %W.as_type.loc13_44.2 (constants.%W.as_type)] -// CHECK:STDOUT: %.loc13_44.2: type = converted %W.ref, %W.as_type.loc13_44.1 [symbolic = %W.as_type.loc13_44.2 (constants.%W.as_type)] +// CHECK:STDOUT: %W.loc11_22.1: %facet_type.65c = bind_symbolic_name W, 0 [symbolic = %W.loc11_22.2 (constants.%W)] +// CHECK:STDOUT: %w.param: @HandleTameAnimal2.%W.as_type.loc11_44.2 (%W.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc11_44.1: type = splice_block %.loc11_44.2 [symbolic = %W.as_type.loc11_44.2 (constants.%W.as_type)] { +// CHECK:STDOUT: %W.ref: %facet_type.65c = name_ref W, %W.loc11_22.1 [symbolic = %W.loc11_22.2 (constants.%W)] +// CHECK:STDOUT: %W.as_type.loc11_44.1: type = facet_access_type %W.ref [symbolic = %W.as_type.loc11_44.2 (constants.%W.as_type)] +// CHECK:STDOUT: %.loc11_44.2: type = converted %W.ref, %W.as_type.loc11_44.1 [symbolic = %W.as_type.loc11_44.2 (constants.%W.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %w: @HandleTameAnimal2.%W.as_type.loc13_44.2 (%W.as_type) = bind_name w, %w.param +// CHECK:STDOUT: %w: @HandleTameAnimal2.%W.as_type.loc11_44.2 (%W.as_type) = bind_name w, %w.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1081,21 +838,21 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] { +// CHECK:STDOUT: interface @BitAnd [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0 // CHECK:STDOUT: .Op = imports.%Core.import_ref.08d // CHECK:STDOUT: witness = (imports.%Core.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "core.carbon"] { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] +// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.275)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.275)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)] // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.837)] // CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = assoc_entity element0, imports.%Core.import_ref.207961.1 [symbolic = %assoc0 (constants.%assoc0.43db8b.1)] @@ -1108,21 +865,21 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.e7b(%A.loc9_14.1: %Animal.type) { -// CHECK:STDOUT: %A.loc9_14.2: %Animal.type = bind_symbolic_name A, 0 [symbolic = %A.loc9_14.2 (constants.%A)] -// CHECK:STDOUT: %A.patt.loc9_14.2: %Animal.type = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc9_14.2 (constants.%A.patt)] -// CHECK:STDOUT: %A.as_type.loc9_26.2: type = facet_access_type %A.loc9_14.2 [symbolic = %A.as_type.loc9_26.2 (constants.%A.as_type)] -// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.e7b(%A.loc9_14.2) [symbolic = %impl_witness (constants.%impl_witness.110)] +// CHECK:STDOUT: generic impl @impl.e7b(%A.loc7_14.1: %Animal.type) { +// CHECK:STDOUT: %A.loc7_14.2: %Animal.type = bind_symbolic_name A, 0 [symbolic = %A.loc7_14.2 (constants.%A)] +// CHECK:STDOUT: %A.patt.loc7_14.2: %Animal.type = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc7_14.2 (constants.%A.patt)] +// CHECK:STDOUT: %A.as_type.loc7_26.2: type = facet_access_type %A.loc7_14.2 [symbolic = %A.as_type.loc7_26.2 (constants.%A.as_type)] +// CHECK:STDOUT: %impl_witness: = impl_witness (), @impl.e7b(%A.loc7_14.2) [symbolic = %impl_witness (constants.%impl_witness.110)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: %.loc9 as %Eats.ref { +// CHECK:STDOUT: impl: %.loc7 as %Eats.ref { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] { +// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)] @@ -1138,14 +895,14 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.19f)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)) -> @Op.1.%Self.as_type (%Self.as_type.19f); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1153,64 +910,64 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @FeedTame2(%V.loc11_14.1: %facet_type.6ff) { -// CHECK:STDOUT: %V.loc11_14.2: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)] -// CHECK:STDOUT: %V.patt.loc11_14.2: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc11_14.2 (constants.%V.patt)] -// CHECK:STDOUT: %V.as_type.loc11_34.2: type = facet_access_type %V.loc11_14.2 [symbolic = %V.as_type.loc11_34.2 (constants.%V.as_type)] +// CHECK:STDOUT: generic fn @FeedTame2(%V.loc9_14.1: %facet_type.6ff) { +// CHECK:STDOUT: %V.loc9_14.2: %facet_type.6ff = bind_symbolic_name V, 0 [symbolic = %V.loc9_14.2 (constants.%V)] +// CHECK:STDOUT: %V.patt.loc9_14.2: %facet_type.6ff = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc9_14.2 (constants.%V.patt)] +// CHECK:STDOUT: %V.as_type.loc9_34.2: type = facet_access_type %V.loc9_14.2 [symbolic = %V.as_type.loc9_34.2 (constants.%V.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @FeedTame2.%V.as_type.loc11_34.2 (%V.as_type) [symbolic = %require_complete (constants.%require_complete.940)] +// CHECK:STDOUT: %require_complete: = require_complete_type @FeedTame2.%V.as_type.loc9_34.2 (%V.as_type) [symbolic = %require_complete (constants.%require_complete.940)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%V.patt.loc11_14.1: %facet_type.6ff](%v.param_patt: @FeedTame2.%V.as_type.loc11_34.2 (%V.as_type)) { +// CHECK:STDOUT: fn[%V.patt.loc9_14.1: %facet_type.6ff](%v.param_patt: @FeedTame2.%V.as_type.loc9_34.2 (%V.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @HandleTameAnimal2(%W.loc13_22.1: %facet_type.65c) { -// CHECK:STDOUT: %W.loc13_22.2: %facet_type.65c = bind_symbolic_name W, 0 [symbolic = %W.loc13_22.2 (constants.%W)] -// CHECK:STDOUT: %W.patt.loc13_22.2: %facet_type.65c = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc13_22.2 (constants.%W.patt)] -// CHECK:STDOUT: %W.as_type.loc13_44.2: type = facet_access_type %W.loc13_22.2 [symbolic = %W.as_type.loc13_44.2 (constants.%W.as_type)] +// CHECK:STDOUT: generic fn @HandleTameAnimal2(%W.loc11_22.1: %facet_type.65c) { +// CHECK:STDOUT: %W.loc11_22.2: %facet_type.65c = bind_symbolic_name W, 0 [symbolic = %W.loc11_22.2 (constants.%W)] +// CHECK:STDOUT: %W.patt.loc11_22.2: %facet_type.65c = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_22.2 (constants.%W.patt)] +// CHECK:STDOUT: %W.as_type.loc11_44.2: type = facet_access_type %W.loc11_22.2 [symbolic = %W.as_type.loc11_44.2 (constants.%W.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @HandleTameAnimal2.%W.as_type.loc13_44.2 (%W.as_type) [symbolic = %require_complete (constants.%require_complete.ba9)] -// CHECK:STDOUT: %W.as_wit.iface0.loc24_14.3: = facet_access_witness %W.loc13_22.2, element0 [symbolic = %W.as_wit.iface0.loc24_14.3 (constants.%W.as_wit.iface0)] -// CHECK:STDOUT: %Animal.facet.loc24_14.3: %Animal.type = facet_value %W.as_type.loc13_44.2, (%W.as_wit.iface0.loc24_14.3) [symbolic = %Animal.facet.loc24_14.3 (constants.%Animal.facet)] +// CHECK:STDOUT: %require_complete: = require_complete_type @HandleTameAnimal2.%W.as_type.loc11_44.2 (%W.as_type) [symbolic = %require_complete (constants.%require_complete.ba9)] +// CHECK:STDOUT: %W.as_wit.iface0.loc22_14.3: = facet_access_witness %W.loc11_22.2, element0 [symbolic = %W.as_wit.iface0.loc22_14.3 (constants.%W.as_wit.iface0)] +// CHECK:STDOUT: %Animal.facet.loc22_14.3: %Animal.type = facet_value %W.as_type.loc11_44.2, (%W.as_wit.iface0.loc22_14.3) [symbolic = %Animal.facet.loc22_14.3 (constants.%Animal.facet)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%W.patt.loc13_22.1: %facet_type.65c](%w.param_patt: @HandleTameAnimal2.%W.as_type.loc13_44.2 (%W.as_type)) { +// CHECK:STDOUT: fn[%W.patt.loc11_22.1: %facet_type.65c](%w.param_patt: @HandleTameAnimal2.%W.as_type.loc11_44.2 (%W.as_type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %FeedTame2.ref: %FeedTame2.type = name_ref FeedTame2, file.%FeedTame2.decl [concrete = constants.%FeedTame2] -// CHECK:STDOUT: %w.ref: @HandleTameAnimal2.%W.as_type.loc13_44.2 (%W.as_type) = name_ref w, %w -// CHECK:STDOUT: %W.as_type.loc24: type = facet_access_type constants.%W [symbolic = %W.as_type.loc13_44.2 (constants.%W.as_type)] -// CHECK:STDOUT: %.loc24_14.1: type = converted constants.%W, %W.as_type.loc24 [symbolic = %W.as_type.loc13_44.2 (constants.%W.as_type)] -// CHECK:STDOUT: %W.as_wit.iface0.loc24_14.1: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc24_14.3 (constants.%W.as_wit.iface0)] -// CHECK:STDOUT: %Animal.facet.loc24_14.1: %Animal.type = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc24_14.1) [symbolic = %Animal.facet.loc24_14.3 (constants.%Animal.facet)] -// CHECK:STDOUT: %.loc24_14.2: %Animal.type = converted %.loc24_14.1, %Animal.facet.loc24_14.1 [symbolic = %Animal.facet.loc24_14.3 (constants.%Animal.facet)] -// CHECK:STDOUT: %W.as_wit.iface0.loc24_14.2: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc24_14.3 (constants.%W.as_wit.iface0)] -// CHECK:STDOUT: %Animal.facet.loc24_14.2: %Animal.type = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc24_14.2) [symbolic = %Animal.facet.loc24_14.3 (constants.%Animal.facet)] -// CHECK:STDOUT: %.loc24_14.3: %Animal.type = converted constants.%W.as_type, %Animal.facet.loc24_14.2 [symbolic = %Animal.facet.loc24_14.3 (constants.%Animal.facet)] -// CHECK:STDOUT: %.loc24_14.4: %facet_type.6ff = converted constants.%W.as_type, [concrete = ] +// CHECK:STDOUT: %w.ref: @HandleTameAnimal2.%W.as_type.loc11_44.2 (%W.as_type) = name_ref w, %w +// CHECK:STDOUT: %W.as_type.loc22: type = facet_access_type constants.%W [symbolic = %W.as_type.loc11_44.2 (constants.%W.as_type)] +// CHECK:STDOUT: %.loc22_14.1: type = converted constants.%W, %W.as_type.loc22 [symbolic = %W.as_type.loc11_44.2 (constants.%W.as_type)] +// CHECK:STDOUT: %W.as_wit.iface0.loc22_14.1: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc22_14.3 (constants.%W.as_wit.iface0)] +// CHECK:STDOUT: %Animal.facet.loc22_14.1: %Animal.type = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc22_14.1) [symbolic = %Animal.facet.loc22_14.3 (constants.%Animal.facet)] +// CHECK:STDOUT: %.loc22_14.2: %Animal.type = converted %.loc22_14.1, %Animal.facet.loc22_14.1 [symbolic = %Animal.facet.loc22_14.3 (constants.%Animal.facet)] +// CHECK:STDOUT: %W.as_wit.iface0.loc22_14.2: = facet_access_witness constants.%W, element0 [symbolic = %W.as_wit.iface0.loc22_14.3 (constants.%W.as_wit.iface0)] +// CHECK:STDOUT: %Animal.facet.loc22_14.2: %Animal.type = facet_value constants.%W.as_type, (%W.as_wit.iface0.loc22_14.2) [symbolic = %Animal.facet.loc22_14.3 (constants.%Animal.facet)] +// CHECK:STDOUT: %.loc22_14.3: %Animal.type = converted constants.%W.as_type, %Animal.facet.loc22_14.2 [symbolic = %Animal.facet.loc22_14.3 (constants.%Animal.facet)] +// CHECK:STDOUT: %.loc22_14.4: %facet_type.6ff = converted constants.%W.as_type, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] +// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "toolchain/testing/min_prelude/facet_types.carbon"] { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.40a)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type.40a)]() -> @Convert.%T (%T); +// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type.40a)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.e7b(constants.%A) { -// CHECK:STDOUT: %A.loc9_14.2 => constants.%A -// CHECK:STDOUT: %A.patt.loc9_14.2 => constants.%A -// CHECK:STDOUT: %A.as_type.loc9_26.2 => constants.%A.as_type +// CHECK:STDOUT: %A.loc7_14.2 => constants.%A +// CHECK:STDOUT: %A.patt.loc7_14.2 => constants.%A +// CHECK:STDOUT: %A.as_type.loc7_26.2 => constants.%A.as_type // CHECK:STDOUT: %impl_witness => constants.%impl_witness.110 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @impl.e7b(%A.loc9_14.2) {} +// CHECK:STDOUT: specific @impl.e7b(%A.loc7_14.2) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Self.25f) { // CHECK:STDOUT: %Self => constants.%Self.25f @@ -1247,45 +1004,45 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @FeedTame2(constants.%V) { -// CHECK:STDOUT: %V.loc11_14.2 => constants.%V -// CHECK:STDOUT: %V.patt.loc11_14.2 => constants.%V -// CHECK:STDOUT: %V.as_type.loc11_34.2 => constants.%V.as_type +// CHECK:STDOUT: %V.loc9_14.2 => constants.%V +// CHECK:STDOUT: %V.patt.loc9_14.2 => constants.%V +// CHECK:STDOUT: %V.as_type.loc9_34.2 => constants.%V.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HandleTameAnimal2(constants.%W) { -// CHECK:STDOUT: %W.loc13_22.2 => constants.%W -// CHECK:STDOUT: %W.patt.loc13_22.2 => constants.%W -// CHECK:STDOUT: %W.as_type.loc13_44.2 => constants.%W.as_type +// CHECK:STDOUT: %W.loc11_22.2 => constants.%W +// CHECK:STDOUT: %W.patt.loc11_22.2 => constants.%W +// CHECK:STDOUT: %W.as_type.loc11_44.2 => constants.%W.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @impl.e7b(constants.%Animal.facet) { -// CHECK:STDOUT: %A.loc9_14.2 => constants.%Animal.facet -// CHECK:STDOUT: %A.patt.loc9_14.2 => constants.%Animal.facet -// CHECK:STDOUT: %A.as_type.loc9_26.2 => constants.%W.as_type +// CHECK:STDOUT: %A.loc7_14.2 => constants.%Animal.facet +// CHECK:STDOUT: %A.patt.loc7_14.2 => constants.%Animal.facet +// CHECK:STDOUT: %A.as_type.loc7_26.2 => constants.%W.as_type // CHECK:STDOUT: %impl_witness => constants.%impl_witness.1d8 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %T.patt => constants.%T +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %Dest.patt => constants.%Dest // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%T) {} +// CHECK:STDOUT: specific @ImplicitAs(%Dest) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.%T) {} +// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert(constants.%T, constants.%Self.519) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) { +// CHECK:STDOUT: %Dest => constants.%Dest // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62 // CHECK:STDOUT: %Self => constants.%Self.519 // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.40a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%facet_type.6ff) { -// CHECK:STDOUT: %T => constants.%facet_type.6ff -// CHECK:STDOUT: %T.patt => constants.%facet_type.6ff +// CHECK:STDOUT: %Dest => constants.%facet_type.6ff +// CHECK:STDOUT: %Dest.patt => constants.%facet_type.6ff // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.dbb @@ -1296,3 +1053,314 @@ fn HandleTameAnimal2[W:! Animal & Tame](w: W) { // CHECK:STDOUT: %assoc0 => constants.%assoc0.976 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- toolchain/testing/min_prelude/facet_types.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete] +// CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic] +// CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic] +// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type %As.type.8ba [symbolic] +// CHECK:STDOUT: %assoc0.ac5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic] +// CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic] +// CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] +// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete] +// CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic] +// CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete] +// CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete] +// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete] +// CHECK:STDOUT: %assoc0.121: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic] +// CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic] +// CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, (%impl_witness) [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .As = %As.decl +// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl +// CHECK:STDOUT: .BitAnd = %BitAnd.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] { +// CHECK:STDOUT: %Dest.patt.loc9_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.loc9_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] { +// CHECK:STDOUT: %Dest.patt.loc13_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.loc13_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] { +// CHECK:STDOUT: %T.patt.loc21_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %T.loc21_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(%Dest.loc9_14.1: type) { +// CHECK:STDOUT: %Dest.loc9_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt.loc9_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc9_14.2)> [symbolic = %As.type (constants.%As.type.8ba)] +// CHECK:STDOUT: %Self.2: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc9_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)] +// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As.%As.type (%As.type.8ba) [symbolic = %As.assoc_type (constants.%As.assoc_type)] +// CHECK:STDOUT: %assoc0.loc10_35.2: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.ac5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] +// CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] { +// CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc9_14.1 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param call_param0 +// CHECK:STDOUT: %.loc10_20.1: type = splice_block %.loc10_20.3 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] { +// CHECK:STDOUT: %.loc10_20.2: @Convert.1.%As.type (%As.type.8ba) = specific_constant @As.%Self.1, @As(constants.%Dest) [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc10_20.2 [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.as_type.loc10_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: %.loc10_20.3: type = converted %Self.ref, %Self.as_type.loc10_20.2 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0.loc10_35.1: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.ac5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .Dest = +// CHECK:STDOUT: .Convert = %assoc0.loc10_35.1 +// CHECK:STDOUT: witness = (%Convert.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc13_22.1: type) { +// CHECK:STDOUT: %Dest.loc13_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt.loc13_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc13_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc13_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)] +// CHECK:STDOUT: %assoc0.loc14_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.a50)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] +// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] { +// CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc13_22.1 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param call_param0 +// CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.3 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] { +// CHECK:STDOUT: %.loc14_20.2: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc14_20.2 [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.as_type.loc14_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: %.loc14_20.3: type = converted %Self.ref, %Self.as_type.loc14_20.2 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0.loc14_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.a50)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .Dest = +// CHECK:STDOUT: .Convert = %assoc0.loc14_35.1 +// CHECK:STDOUT: witness = (%Convert.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @BitAnd { +// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44] +// CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] { +// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1 +// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc18_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_37: type = facet_access_type %Self.ref.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_37: type = converted %Self.ref.loc18_37, %Self.as_type.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param0 +// CHECK:STDOUT: %.loc18_15.1: type = splice_block %.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] { +// CHECK:STDOUT: %Self.ref.loc18_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_15.2: type = facet_access_type %Self.ref.loc18_15 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_15.2: type = converted %Self.ref.loc18_15, %Self.as_type.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param1 +// CHECK:STDOUT: %.loc18_28.1: type = splice_block %.loc18_28.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] { +// CHECK:STDOUT: %Self.ref.loc18_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_28: type = facet_access_type %Self.ref.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_28.2: type = converted %Self.ref.loc18_28, %Self.as_type.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param call_param2 +// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.121] +// 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(%T.loc21_14.1: type) { +// CHECK:STDOUT: %T.loc21_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc21_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%Op.decl), @impl(%T.loc21_14.2) [symbolic = %impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc21_14.2) [symbolic = %Op.type (constants.%Op.type.28d)] +// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%T.loc21_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: %T.ref as %BitAnd.ref { +// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] { +// CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1 +// CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc22_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0 +// CHECK:STDOUT: %Self.ref.loc22_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1 +// CHECK:STDOUT: %Self.ref.loc22_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2 +// CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Op = %Op.decl +// CHECK:STDOUT: witness = file.%impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc9_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)] +// CHECK:STDOUT: %Self: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.as_type.loc10_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc13_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.as_type.loc14_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419)]() -> @Convert.2.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) { +// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc21_14.1: type) { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest.loc9_14.2 => constants.%Dest +// CHECK:STDOUT: %Dest.patt.loc9_14.2 => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.8ba +// CHECK:STDOUT: %Self => constants.%Self.b4e +// CHECK:STDOUT: %Self.as_type.loc10_20.1 => constants.%Self.as_type.7f0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.1.%Dest) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(%Dest.loc9_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest.loc13_22.2 => constants.%Dest +// CHECK:STDOUT: %Dest.patt.loc13_22.2 => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f +// CHECK:STDOUT: %Self => constants.%Self.0f3 +// CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type.419 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(%Dest.loc13_22.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%Self.e44) { +// CHECK:STDOUT: %Self => constants.%Self.e44 +// CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%Self.as_type.560 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(constants.%T) { +// CHECK:STDOUT: %T.loc21_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T +// CHECK:STDOUT: %impl_witness => constants.%impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc21_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(constants.%T) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) { +// CHECK:STDOUT: %Self => constants.%BitAnd.facet +// CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/no_prelude/combine.carbon b/toolchain/check/testdata/facet/min_prelude/combine.carbon similarity index 90% rename from toolchain/check/testdata/facet/no_prelude/combine.carbon rename to toolchain/check/testdata/facet/min_prelude/combine.carbon index 5db097140548..51c56d985be7 100644 --- a/toolchain/check/testdata/facet/no_prelude/combine.carbon +++ b/toolchain/check/testdata/facet/min_prelude/combine.carbon @@ -2,38 +2,18 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --no-dump-sem-ir +// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon +// EXTRA-ARGS: --no-dump-sem-ir --custom-core // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/no_prelude/combine.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/min_prelude/combine.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/no_prelude/combine.carbon - -// --- core.carbon -package Core; - -interface As(Dest:! type) { - fn Convert[self: Self]() -> Dest; -} - -interface ImplicitAs(Dest:! type) { - fn Convert[self: Self]() -> Dest; -} - -interface BitAnd { - fn Op[self: Self](other: Self) -> Self; -} - -impl forall [T:! type] T as BitAnd { - fn Op[self: Self](other: Self) -> Self = "type.and"; -} +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/min_prelude/combine.carbon // --- fail_combine_with_non_facet_type.carbon library "[[@TEST_NAME]]"; -import Core; - interface A {} class C {} @@ -86,8 +66,6 @@ fn F() { // --- same.carbon library "[[@TEST_NAME]]"; -import Core; - interface A {} class C {} @@ -104,8 +82,6 @@ fn F() { // --- fail_name_collision.carbon library "[[@TEST_NAME]]"; -import Core; - interface A { fn G(); } @@ -134,8 +110,6 @@ fn F() { // --- combine.carbon library "[[@TEST_NAME]]"; -import Core; - interface A {} interface B { fn BB[self: Self](); @@ -161,8 +135,6 @@ fn F() { // --- generic_interface.carbon library "[[@TEST_NAME]]"; -import Core; - interface A(T:! type) {} interface B {} @@ -182,8 +154,6 @@ fn F() { // --- fail_wrong_generic_interface.carbon library "[[@TEST_NAME]]"; -import Core; - interface A(T:! type) {} interface B {} @@ -213,8 +183,6 @@ fn F() { // --- generic_forall_impl.carbon library "[[@TEST_NAME]]"; -import Core; - interface Iface {} interface GenericIface(T:! type) {} diff --git a/toolchain/check/testdata/facet/no_prelude/fail_incomplete.carbon b/toolchain/check/testdata/facet/min_prelude/fail_incomplete.carbon similarity index 84% rename from toolchain/check/testdata/facet/no_prelude/fail_incomplete.carbon rename to toolchain/check/testdata/facet/min_prelude/fail_incomplete.carbon index 18b1ab61dcf7..c586feaa9f5c 100644 --- a/toolchain/check/testdata/facet/no_prelude/fail_incomplete.carbon +++ b/toolchain/check/testdata/facet/min_prelude/fail_incomplete.carbon @@ -2,34 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --no-dump-sem-ir +// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon +// EXTRA-ARGS: --no-dump-sem-ir --custom-core // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/no_prelude/fail_incomplete.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/min_prelude/fail_incomplete.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/no_prelude/fail_incomplete.carbon - -// --- core.carbon -package Core; - -interface As(Dest:! type) { - fn Convert[self: Self]() -> Dest; -} - -interface BitAnd { - fn Op[self: Self](other: Self) -> Self; -} - -impl forall [T:! type] T as BitAnd { - fn Op[self: Self](other: Self) -> Self = "type.and"; -} - -// --- fail_incomplete.carbon - -library "[[@TEST_NAME]]"; - -import Core; +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/min_prelude/fail_incomplete.carbon interface A; interface B {} diff --git a/toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/min_prelude/fail_todo_call_combined_impl_witness.carbon similarity index 65% rename from toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon rename to toolchain/check/testdata/facet/min_prelude/fail_todo_call_combined_impl_witness.carbon index f96234a98cc2..52fc92dbcc7b 100644 --- a/toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/min_prelude/fail_todo_call_combined_impl_witness.carbon @@ -2,36 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon +// EXTRA-ARGS: --custom-core +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/min_prelude/fail_todo_call_combined_impl_witness.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/no_prelude/fail_todo_call_combined_impl_witness.carbon - -// --- core.carbon -package Core; - -interface As(Dest:! type) { - fn Convert[self: Self]() -> Dest; -} - -interface ImplicitAs(Dest:! type) { - fn Convert[self: Self]() -> Dest; -} - -interface BitAnd { - fn Op[self: Self](other: Self) -> Self; -} - -impl forall [T:! type] T as BitAnd { - fn Op[self: Self](other: Self) -> Self = "type.and"; -} - -// --- fail_todo_call_combined_impl_witness.carbon - -library "[[@TEST_NAME]]"; - -import Core; +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/min_prelude/fail_todo_call_combined_impl_witness.carbon interface Empty { } @@ -83,317 +61,6 @@ fn F() { G({} as C); } -// CHECK:STDOUT: --- core.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] -// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete] -// CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete] -// CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic] -// CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic] -// CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic] -// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type %As.type.8ba [symbolic] -// CHECK:STDOUT: %assoc0.ac5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic] -// CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic] -// CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] -// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete] -// CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic] -// CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete] -// CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete] -// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete] -// CHECK:STDOUT: %assoc0.121: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic] -// CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic] -// CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, (%impl_witness) [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .As = %As.decl -// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl -// CHECK:STDOUT: .BitAnd = %BitAnd.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] { -// CHECK:STDOUT: %Dest.patt.loc3_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc3_14.2 (constants.%Dest.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.loc3_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc3_14.2 (constants.%Dest)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] { -// CHECK:STDOUT: %Dest.patt.loc7_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc7_22.2 (constants.%Dest.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.loc7_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc7_22.2 (constants.%Dest)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] { -// CHECK:STDOUT: %T.patt.loc15_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_14.1 [symbolic = %T.loc15_14.2 (constants.%T)] -// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %T.loc15_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @As(%Dest.loc3_14.1: type) { -// CHECK:STDOUT: %Dest.loc3_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc3_14.2 (constants.%Dest)] -// CHECK:STDOUT: %Dest.patt.loc3_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc3_14.2 (constants.%Dest.patt)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc3_14.2)> [symbolic = %As.type (constants.%As.type.8ba)] -// CHECK:STDOUT: %Self.2: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc3_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)] -// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As.%As.type (%As.type.8ba) [symbolic = %As.assoc_type (constants.%As.assoc_type)] -// CHECK:STDOUT: %assoc0.loc4_35.2: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0.ac5)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] -// CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] { -// CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc3_14.1 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = value_param call_param0 -// CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] { -// CHECK:STDOUT: %.loc4_20.2: @Convert.1.%As.type (%As.type.8ba) = specific_constant @As.%Self.1, @As(constants.%Dest) [symbolic = %Self (constants.%Self.b4e)] -// CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc4_20.2 [symbolic = %Self (constants.%Self.b4e)] -// CHECK:STDOUT: %Self.as_type.loc4_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] -// CHECK:STDOUT: %.loc4_20.3: type = converted %Self.ref, %Self.as_type.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc4_35.1: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0.ac5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .Dest = -// CHECK:STDOUT: .Convert = %assoc0.loc4_35.1 -// CHECK:STDOUT: witness = (%Convert.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc7_22.1: type) { -// CHECK:STDOUT: %Dest.loc7_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc7_22.2 (constants.%Dest)] -// CHECK:STDOUT: %Dest.patt.loc7_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc7_22.2 (constants.%Dest.patt)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc7_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] -// CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc7_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)] -// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)] -// CHECK:STDOUT: %assoc0.loc8_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc8_35.2 (constants.%assoc0.a50)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] -// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] { -// CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc7_22.1 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = value_param call_param0 -// CHECK:STDOUT: %.loc8_20.1: type = splice_block %.loc8_20.3 [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] { -// CHECK:STDOUT: %.loc8_20.2: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc8_20.2 [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.as_type.loc8_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: %.loc8_20.3: type = converted %Self.ref, %Self.as_type.loc8_20.2 [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc8_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc8_35.2 (constants.%assoc0.a50)] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .Dest = -// CHECK:STDOUT: .Convert = %assoc0.loc8_35.1 -// CHECK:STDOUT: witness = (%Convert.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd { -// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44] -// CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] { -// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1 -// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_37: type = facet_access_type %Self.ref.loc12_37 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %.loc12_37: type = converted %Self.ref.loc12_37, %Self.as_type.loc12_37 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param call_param0 -// CHECK:STDOUT: %.loc12_15.1: type = splice_block %.loc12_15.2 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] { -// CHECK:STDOUT: %Self.ref.loc12_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_15.2: type = facet_access_type %Self.ref.loc12_15 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %.loc12_15.2: type = converted %Self.ref.loc12_15, %Self.as_type.loc12_15.2 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param call_param1 -// CHECK:STDOUT: %.loc12_28.1: type = splice_block %.loc12_28.2 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] { -// CHECK:STDOUT: %Self.ref.loc12_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_28: type = facet_access_type %Self.ref.loc12_28 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %.loc12_28.2: type = converted %Self.ref.loc12_28, %Self.as_type.loc12_28 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.121] -// 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(%T.loc15_14.1: type) { -// CHECK:STDOUT: %T.loc15_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc15_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %impl_witness: = impl_witness (%Op.decl), @impl(%T.loc15_14.2) [symbolic = %impl_witness (constants.%impl_witness)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc15_14.2) [symbolic = %Op.type (constants.%Op.type.28d)] -// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)] -// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%T.loc15_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %T.ref as %BitAnd.ref { -// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] { -// CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1 -// CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = file.%impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc3_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)] -// CHECK:STDOUT: %Self: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)] -// CHECK:STDOUT: %Self.as_type.loc4_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0)]() -> @Convert.1.%Dest (%Dest); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc7_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] -// CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.as_type.loc8_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419)]() -> @Convert.2.%Dest (%Dest); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) { -// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc15_14.1: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%Dest) { -// CHECK:STDOUT: %Dest.loc3_14.2 => constants.%Dest -// CHECK:STDOUT: %Dest.patt.loc3_14.2 => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %As.type => constants.%As.type.8ba -// CHECK:STDOUT: %Self => constants.%Self.b4e -// CHECK:STDOUT: %Self.as_type.loc4_20.1 => constants.%Self.as_type.7f0 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@Convert.1.%Dest) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(%Dest.loc3_14.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { -// CHECK:STDOUT: %Dest.loc7_22.2 => constants.%Dest -// CHECK:STDOUT: %Dest.patt.loc7_22.2 => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f -// CHECK:STDOUT: %Self => constants.%Self.0f3 -// CHECK:STDOUT: %Self.as_type.loc8_20.1 => constants.%Self.as_type.419 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%Dest.loc7_22.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.1(constants.%Self.e44) { -// CHECK:STDOUT: %Self => constants.%Self.e44 -// CHECK:STDOUT: %Self.as_type.loc12_15.1 => constants.%Self.as_type.560 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(constants.%T) { -// CHECK:STDOUT: %T.loc15_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T -// CHECK:STDOUT: %impl_witness => constants.%impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc15_14.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.2(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) { -// CHECK:STDOUT: %Self => constants.%BitAnd.facet -// CHECK:STDOUT: %Self.as_type.loc12_15.1 => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_call_combined_impl_witness.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -502,25 +169,25 @@ fn F() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .BitAnd = %Core.BitAnd // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst100 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//default, loc12_41, loaded [concrete = constants.%assoc0.a63] -// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//default, Op, loaded [concrete = constants.%Op.ab9] -// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//default, inst100 [no loc], loaded [symbolic = constants.%Self.25f] -// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//default, loc15_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.f92.%T (constants.%T.8b3)] -// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc15_24, loaded [symbolic = @impl.f92.%T (constants.%T.8b3)] -// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc15_29, loaded [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//default, loc16_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.f92.%T (constants.%T.8b3)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//default, loc7_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] -// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst65 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc8_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] -// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//default, loc7_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] -// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst65 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] -// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc8_35, unloaded +// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst100 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0.a63] +// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//prelude, Op, loaded [concrete = constants.%Op.ab9] +// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst100 [no loc], loaded [symbolic = constants.%Self.25f] +// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.f92.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst65 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] +// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst65 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] +// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//prelude, loc14_35, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -542,49 +209,49 @@ fn F() { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc16: = impl_witness () [concrete = constants.%impl_witness.1bc] +// CHECK:STDOUT: %impl_witness.loc24: = impl_witness () [concrete = constants.%impl_witness.1bc] // CHECK:STDOUT: impl_decl @impl.77d [concrete] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc17: = impl_witness (@impl.77d.%AA.decl) [concrete = constants.%impl_witness.97a] +// CHECK:STDOUT: %impl_witness.loc25: = impl_witness (@impl.77d.%AA.decl) [concrete = constants.%impl_witness.97a] // CHECK:STDOUT: impl_decl @impl.c94 [concrete] {} { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness.loc20: = impl_witness (@impl.c94.%BB.decl) [concrete = constants.%impl_witness.fe4] +// CHECK:STDOUT: %impl_witness.loc28: = impl_witness (@impl.c94.%BB.decl) [concrete = constants.%impl_witness.fe4] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] { -// CHECK:STDOUT: %T.patt.loc24_6.1: %facet_type.242 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc24_6.2 (constants.%T.patt.fd9)] -// CHECK:STDOUT: %t.patt: @G.%T.as_type.loc24_28.2 (%T.as_type) = binding_pattern t -// CHECK:STDOUT: %t.param_patt: @G.%T.as_type.loc24_28.2 (%T.as_type) = value_param_pattern %t.patt, call_param0 +// CHECK:STDOUT: %T.patt.loc32_6.1: %facet_type.242 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc32_6.2 (constants.%T.patt.fd9)] +// CHECK:STDOUT: %t.patt: @G.%T.as_type.loc32_28.2 (%T.as_type) = binding_pattern t +// CHECK:STDOUT: %t.param_patt: @G.%T.as_type.loc32_28.2 (%T.as_type) = value_param_pattern %t.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc24_20.1: type = splice_block %.loc24_20.3 [concrete = constants.%facet_type.242] { -// CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc32_20.1: type = splice_block %.loc32_20.3 [concrete = constants.%facet_type.242] { +// CHECK:STDOUT: %A.ref.loc32: type = name_ref A, file.%A.decl [concrete = constants.%A.type] // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type] -// CHECK:STDOUT: %impl.elem0.loc24_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc24_12.1: = bound_method %A.ref.loc24, %impl.elem0.loc24_12 [concrete = constants.%Op.bound.6b1] -// CHECK:STDOUT: %specific_fn.loc24_12: = specific_function %impl.elem0.loc24_12, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_12.2: = bound_method %A.ref.loc24, %specific_fn.loc24_12 [concrete = constants.%bound_method.96c] -// CHECK:STDOUT: %type.and.loc24_12: init type = call %bound_method.loc24_12.2(%A.ref.loc24, %Empty.ref) [concrete = constants.%facet_type.d5f] -// CHECK:STDOUT: %B.ref.loc24: type = name_ref B, file.%B.decl [concrete = constants.%B.type] -// CHECK:STDOUT: %impl.elem0.loc24_20: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc24_20.1: = bound_method %type.and.loc24_12, %impl.elem0.loc24_20 [concrete = constants.%Op.bound.b5b] -// CHECK:STDOUT: %specific_fn.loc24_20: = specific_function %impl.elem0.loc24_20, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_20.2: = bound_method %type.and.loc24_12, %specific_fn.loc24_20 [concrete = constants.%bound_method.cb6] -// CHECK:STDOUT: %.loc24_12.1: type = value_of_initializer %type.and.loc24_12 [concrete = constants.%facet_type.d5f] -// CHECK:STDOUT: %.loc24_12.2: type = converted %type.and.loc24_12, %.loc24_12.1 [concrete = constants.%facet_type.d5f] -// CHECK:STDOUT: %type.and.loc24_20: init type = call %bound_method.loc24_20.2(%.loc24_12.2, %B.ref.loc24) [concrete = constants.%facet_type.242] -// CHECK:STDOUT: %.loc24_20.2: type = value_of_initializer %type.and.loc24_20 [concrete = constants.%facet_type.242] -// CHECK:STDOUT: %.loc24_20.3: type = converted %type.and.loc24_20, %.loc24_20.2 [concrete = constants.%facet_type.242] +// CHECK:STDOUT: %impl.elem0.loc32_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc32_12.1: = bound_method %A.ref.loc32, %impl.elem0.loc32_12 [concrete = constants.%Op.bound.6b1] +// CHECK:STDOUT: %specific_fn.loc32_12: = specific_function %impl.elem0.loc32_12, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_12.2: = bound_method %A.ref.loc32, %specific_fn.loc32_12 [concrete = constants.%bound_method.96c] +// CHECK:STDOUT: %type.and.loc32_12: init type = call %bound_method.loc32_12.2(%A.ref.loc32, %Empty.ref) [concrete = constants.%facet_type.d5f] +// CHECK:STDOUT: %B.ref.loc32: type = name_ref B, file.%B.decl [concrete = constants.%B.type] +// CHECK:STDOUT: %impl.elem0.loc32_20: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc32_20.1: = bound_method %type.and.loc32_12, %impl.elem0.loc32_20 [concrete = constants.%Op.bound.b5b] +// CHECK:STDOUT: %specific_fn.loc32_20: = specific_function %impl.elem0.loc32_20, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_20.2: = bound_method %type.and.loc32_12, %specific_fn.loc32_20 [concrete = constants.%bound_method.cb6] +// CHECK:STDOUT: %.loc32_12.1: type = value_of_initializer %type.and.loc32_12 [concrete = constants.%facet_type.d5f] +// CHECK:STDOUT: %.loc32_12.2: type = converted %type.and.loc32_12, %.loc32_12.1 [concrete = constants.%facet_type.d5f] +// CHECK:STDOUT: %type.and.loc32_20: init type = call %bound_method.loc32_20.2(%.loc32_12.2, %B.ref.loc32) [concrete = constants.%facet_type.242] +// CHECK:STDOUT: %.loc32_20.2: type = value_of_initializer %type.and.loc32_20 [concrete = constants.%facet_type.242] +// CHECK:STDOUT: %.loc32_20.3: type = converted %type.and.loc32_20, %.loc32_20.2 [concrete = constants.%facet_type.242] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc24_6.1: %facet_type.242 = bind_symbolic_name T, 0 [symbolic = %T.loc24_6.2 (constants.%T.2df)] -// CHECK:STDOUT: %t.param: @G.%T.as_type.loc24_28.2 (%T.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc24_28.1: type = splice_block %.loc24_28.2 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] { -// CHECK:STDOUT: %T.ref.loc24: %facet_type.242 = name_ref T, %T.loc24_6.1 [symbolic = %T.loc24_6.2 (constants.%T.2df)] -// CHECK:STDOUT: %T.as_type.loc24_28.1: type = facet_access_type %T.ref.loc24 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc24_28.2: type = converted %T.ref.loc24, %T.as_type.loc24_28.1 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.loc32_6.1: %facet_type.242 = bind_symbolic_name T, 0 [symbolic = %T.loc32_6.2 (constants.%T.2df)] +// CHECK:STDOUT: %t.param: @G.%T.as_type.loc32_28.2 (%T.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc32_28.1: type = splice_block %.loc32_28.2 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref.loc32: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] +// CHECK:STDOUT: %T.as_type.loc32_28.1: type = facet_access_type %T.ref.loc32 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc32_28.2: type = converted %T.ref.loc32, %T.as_type.loc32_28.1 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %t: @G.%T.as_type.loc24_28.2 (%T.as_type) = bind_name t, %t.param +// CHECK:STDOUT: %t: @G.%T.as_type.loc32_28.2 (%T.as_type) = bind_name t, %t.param // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } @@ -623,14 +290,14 @@ fn F() { // CHECK:STDOUT: witness = (%BB.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] { +// CHECK:STDOUT: interface @BitAnd [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0 // CHECK:STDOUT: .Op = imports.%Core.import_ref.08d // CHECK:STDOUT: witness = (imports.%Core.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "core.carbon"] { +// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: @@ -652,7 +319,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.d78: %C.ref as %Empty.ref { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%impl_witness.loc16 +// CHECK:STDOUT: witness = file.%impl_witness.loc24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.77d: %C.ref as %A.ref { @@ -660,7 +327,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .AA = %AA.decl -// CHECK:STDOUT: witness = file.%impl_witness.loc17 +// CHECK:STDOUT: witness = file.%impl_witness.loc25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.c94: %C.ref as %B.ref { @@ -668,10 +335,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .BB = %BB.decl -// CHECK:STDOUT: witness = file.%impl_witness.loc20 +// CHECK:STDOUT: witness = file.%impl_witness.loc28 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] { +// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.e01)] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)] @@ -713,14 +380,14 @@ fn F() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.19f)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)) -> @Op.1.%Self.as_type (%Self.as_type.19f); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -728,71 +395,71 @@ fn F() { // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T.8b3)](%other.param_patt: @Op.2.%T (%T.8b3)) -> @Op.2.%T (%T.8b3) = "type.and"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(%T.loc24_6.1: %facet_type.242) { -// CHECK:STDOUT: %T.loc24_6.2: %facet_type.242 = bind_symbolic_name T, 0 [symbolic = %T.loc24_6.2 (constants.%T.2df)] -// CHECK:STDOUT: %T.patt.loc24_6.2: %facet_type.242 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc24_6.2 (constants.%T.patt.fd9)] -// CHECK:STDOUT: %T.as_type.loc24_28.2: type = facet_access_type %T.loc24_6.2 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: generic fn @G(%T.loc32_6.1: %facet_type.242) { +// CHECK:STDOUT: %T.loc32_6.2: %facet_type.242 = bind_symbolic_name T, 0 [symbolic = %T.loc32_6.2 (constants.%T.2df)] +// CHECK:STDOUT: %T.patt.loc32_6.2: %facet_type.242 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc32_6.2 (constants.%T.patt.fd9)] +// CHECK:STDOUT: %T.as_type.loc32_28.2: type = facet_access_type %T.loc32_6.2 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @G.%T.as_type.loc24_28.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.383)] -// CHECK:STDOUT: %T.as_wit.iface1.loc25_4.2: = facet_access_witness %T.loc24_6.2, element1 [symbolic = %T.as_wit.iface1.loc25_4.2 (constants.%T.as_wit.iface1)] -// CHECK:STDOUT: %A.facet: %A.type = facet_value %T.as_type.loc24_28.2, (%T.as_wit.iface1.loc25_4.2) [symbolic = %A.facet (constants.%A.facet.5b4)] -// CHECK:STDOUT: %.loc25_4.2: type = fn_type_with_self_type constants.%AA.type.b97, %A.facet [symbolic = %.loc25_4.2 (constants.%.860)] -// CHECK:STDOUT: %impl.elem0.loc25_4.2: @G.%.loc25_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc25_4.2, element0 [symbolic = %impl.elem0.loc25_4.2 (constants.%impl.elem0.656)] -// CHECK:STDOUT: %specific_fn.loc25_4.2: = specific_function %impl.elem0.loc25_4.2, @AA.1(%A.facet) [symbolic = %specific_fn.loc25_4.2 (constants.%specific_fn.74e)] -// CHECK:STDOUT: %T.as_wit.iface2.loc26_4.2: = facet_access_witness %T.loc24_6.2, element2 [symbolic = %T.as_wit.iface2.loc26_4.2 (constants.%T.as_wit.iface2)] -// CHECK:STDOUT: %B.facet: %B.type = facet_value %T.as_type.loc24_28.2, (%T.as_wit.iface2.loc26_4.2) [symbolic = %B.facet (constants.%B.facet.abf)] -// CHECK:STDOUT: %.loc26_4.2: type = fn_type_with_self_type constants.%BB.type.64d, %B.facet [symbolic = %.loc26_4.2 (constants.%.a5b)] -// CHECK:STDOUT: %impl.elem0.loc26_4.2: @G.%.loc26_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc26_4.2, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0.097)] -// CHECK:STDOUT: %specific_fn.loc26_4.2: = specific_function %impl.elem0.loc26_4.2, @BB.1(%B.facet) [symbolic = %specific_fn.loc26_4.2 (constants.%specific_fn.9fa)] +// CHECK:STDOUT: %require_complete: = require_complete_type @G.%T.as_type.loc32_28.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.383)] +// CHECK:STDOUT: %T.as_wit.iface1.loc33_4.2: = facet_access_witness %T.loc32_6.2, element1 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] +// CHECK:STDOUT: %A.facet: %A.type = facet_value %T.as_type.loc32_28.2, (%T.as_wit.iface1.loc33_4.2) [symbolic = %A.facet (constants.%A.facet.5b4)] +// CHECK:STDOUT: %.loc33_4.2: type = fn_type_with_self_type constants.%AA.type.b97, %A.facet [symbolic = %.loc33_4.2 (constants.%.860)] +// CHECK:STDOUT: %impl.elem0.loc33_4.2: @G.%.loc33_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc33_4.2, element0 [symbolic = %impl.elem0.loc33_4.2 (constants.%impl.elem0.656)] +// CHECK:STDOUT: %specific_fn.loc33_4.2: = specific_function %impl.elem0.loc33_4.2, @AA.1(%A.facet) [symbolic = %specific_fn.loc33_4.2 (constants.%specific_fn.74e)] +// CHECK:STDOUT: %T.as_wit.iface2.loc34_4.2: = facet_access_witness %T.loc32_6.2, element2 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] +// CHECK:STDOUT: %B.facet: %B.type = facet_value %T.as_type.loc32_28.2, (%T.as_wit.iface2.loc34_4.2) [symbolic = %B.facet (constants.%B.facet.abf)] +// CHECK:STDOUT: %.loc34_4.2: type = fn_type_with_self_type constants.%BB.type.64d, %B.facet [symbolic = %.loc34_4.2 (constants.%.a5b)] +// CHECK:STDOUT: %impl.elem0.loc34_4.2: @G.%.loc34_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc34_4.2, element0 [symbolic = %impl.elem0.loc34_4.2 (constants.%impl.elem0.097)] +// CHECK:STDOUT: %specific_fn.loc34_4.2: = specific_function %impl.elem0.loc34_4.2, @BB.1(%B.facet) [symbolic = %specific_fn.loc34_4.2 (constants.%specific_fn.9fa)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%T.patt.loc24_6.1: %facet_type.242](%t.param_patt: @G.%T.as_type.loc24_28.2 (%T.as_type)) { +// CHECK:STDOUT: fn[%T.patt.loc32_6.1: %facet_type.242](%t.param_patt: @G.%T.as_type.loc32_28.2 (%T.as_type)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %t.ref.loc25: @G.%T.as_type.loc24_28.2 (%T.as_type) = name_ref t, %t -// CHECK:STDOUT: %AA.ref.loc25: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] -// CHECK:STDOUT: %T.as_type.loc25: type = facet_access_type constants.%T.2df [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc25_4.1: type = converted constants.%T.2df, %T.as_type.loc25 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %T.as_wit.iface1.loc25_4.1: = facet_access_witness constants.%T.2df, element1 [symbolic = %T.as_wit.iface1.loc25_4.2 (constants.%T.as_wit.iface1)] -// CHECK:STDOUT: %impl.elem0.loc25_4.1: @G.%.loc25_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc25_4.1, element0 [symbolic = %impl.elem0.loc25_4.2 (constants.%impl.elem0.656)] -// CHECK:STDOUT: %specific_fn.loc25_4.1: = specific_function %impl.elem0.loc25_4.1, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_fn.loc25_4.2 (constants.%specific_fn.74e)] -// CHECK:STDOUT: %AA.call.loc25: init %empty_tuple.type = call %specific_fn.loc25_4.1() -// CHECK:STDOUT: %t.ref.loc26: @G.%T.as_type.loc24_28.2 (%T.as_type) = name_ref t, %t -// CHECK:STDOUT: %BB.ref.loc26: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] -// CHECK:STDOUT: %T.as_type.loc26: type = facet_access_type constants.%T.2df [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc26_4.1: type = converted constants.%T.2df, %T.as_type.loc26 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %T.as_wit.iface2.loc26_4.1: = facet_access_witness constants.%T.2df, element2 [symbolic = %T.as_wit.iface2.loc26_4.2 (constants.%T.as_wit.iface2)] -// CHECK:STDOUT: %impl.elem0.loc26_4.1: @G.%.loc26_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc26_4.1, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0.097)] -// CHECK:STDOUT: %specific_fn.loc26_4.1: = specific_function %impl.elem0.loc26_4.1, @BB.1(constants.%B.facet.abf) [symbolic = %specific_fn.loc26_4.2 (constants.%specific_fn.9fa)] -// CHECK:STDOUT: %BB.call.loc26: init %empty_tuple.type = call %specific_fn.loc26_4.1() -// CHECK:STDOUT: %T.ref.loc28: %facet_type.242 = name_ref T, %T.loc24_6.1 [symbolic = %T.loc24_6.2 (constants.%T.2df)] -// CHECK:STDOUT: %AA.ref.loc28: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] -// CHECK:STDOUT: %T.as_type.loc28: type = facet_access_type %T.ref.loc28 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc28: type = converted %T.ref.loc28, %T.as_type.loc28 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %T.as_wit.iface1.loc28: = facet_access_witness %T.ref.loc28, element1 [symbolic = %T.as_wit.iface1.loc25_4.2 (constants.%T.as_wit.iface1)] -// CHECK:STDOUT: %impl.elem0.loc28: @G.%.loc25_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc28, element0 [symbolic = %impl.elem0.loc25_4.2 (constants.%impl.elem0.656)] -// CHECK:STDOUT: %specific_fn.loc28: = specific_function %impl.elem0.loc28, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_fn.loc25_4.2 (constants.%specific_fn.74e)] -// CHECK:STDOUT: %AA.call.loc28: init %empty_tuple.type = call %specific_fn.loc28() -// CHECK:STDOUT: %T.ref.loc29: %facet_type.242 = name_ref T, %T.loc24_6.1 [symbolic = %T.loc24_6.2 (constants.%T.2df)] -// CHECK:STDOUT: %BB.ref.loc29: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] -// CHECK:STDOUT: %T.as_type.loc29: type = facet_access_type %T.ref.loc29 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc29: type = converted %T.ref.loc29, %T.as_type.loc29 [symbolic = %T.as_type.loc24_28.2 (constants.%T.as_type)] -// CHECK:STDOUT: %T.as_wit.iface2.loc29: = facet_access_witness %T.ref.loc29, element2 [symbolic = %T.as_wit.iface2.loc26_4.2 (constants.%T.as_wit.iface2)] -// CHECK:STDOUT: %impl.elem0.loc29: @G.%.loc26_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc29, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0.097)] -// CHECK:STDOUT: %specific_fn.loc29: = specific_function %impl.elem0.loc29, @BB.1(constants.%B.facet.abf) [symbolic = %specific_fn.loc26_4.2 (constants.%specific_fn.9fa)] -// CHECK:STDOUT: %BB.call.loc29: init %empty_tuple.type = call %specific_fn.loc29() -// CHECK:STDOUT: %T.ref.loc41: %facet_type.242 = name_ref T, %T.loc24_6.1 [symbolic = %T.loc24_6.2 (constants.%T.2df)] -// CHECK:STDOUT: %A.ref.loc41: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %AA.ref.loc41: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] -// CHECK:STDOUT: %.loc41: %A.type = converted %T.ref.loc41, [concrete = ] -// CHECK:STDOUT: %T.ref.loc49: %facet_type.242 = name_ref T, %T.loc24_6.1 [symbolic = %T.loc24_6.2 (constants.%T.2df)] -// CHECK:STDOUT: %B.ref.loc49: type = name_ref B, file.%B.decl [concrete = constants.%B.type] -// CHECK:STDOUT: %BB.ref.loc49: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] -// CHECK:STDOUT: %.loc49: %B.type = converted %T.ref.loc49, [concrete = ] +// CHECK:STDOUT: %t.ref.loc33: @G.%T.as_type.loc32_28.2 (%T.as_type) = name_ref t, %t +// CHECK:STDOUT: %AA.ref.loc33: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] +// CHECK:STDOUT: %T.as_type.loc33: type = facet_access_type constants.%T.2df [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc33_4.1: type = converted constants.%T.2df, %T.as_type.loc33 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface1.loc33_4.1: = facet_access_witness constants.%T.2df, element1 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] +// CHECK:STDOUT: %impl.elem0.loc33_4.1: @G.%.loc33_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc33_4.1, element0 [symbolic = %impl.elem0.loc33_4.2 (constants.%impl.elem0.656)] +// CHECK:STDOUT: %specific_fn.loc33_4.1: = specific_function %impl.elem0.loc33_4.1, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_fn.loc33_4.2 (constants.%specific_fn.74e)] +// CHECK:STDOUT: %AA.call.loc33: init %empty_tuple.type = call %specific_fn.loc33_4.1() +// CHECK:STDOUT: %t.ref.loc34: @G.%T.as_type.loc32_28.2 (%T.as_type) = name_ref t, %t +// CHECK:STDOUT: %BB.ref.loc34: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] +// CHECK:STDOUT: %T.as_type.loc34: type = facet_access_type constants.%T.2df [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc34_4.1: type = converted constants.%T.2df, %T.as_type.loc34 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface2.loc34_4.1: = facet_access_witness constants.%T.2df, element2 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] +// CHECK:STDOUT: %impl.elem0.loc34_4.1: @G.%.loc34_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc34_4.1, element0 [symbolic = %impl.elem0.loc34_4.2 (constants.%impl.elem0.097)] +// CHECK:STDOUT: %specific_fn.loc34_4.1: = specific_function %impl.elem0.loc34_4.1, @BB.1(constants.%B.facet.abf) [symbolic = %specific_fn.loc34_4.2 (constants.%specific_fn.9fa)] +// CHECK:STDOUT: %BB.call.loc34: init %empty_tuple.type = call %specific_fn.loc34_4.1() +// CHECK:STDOUT: %T.ref.loc36: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] +// CHECK:STDOUT: %AA.ref.loc36: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] +// CHECK:STDOUT: %T.as_type.loc36: type = facet_access_type %T.ref.loc36 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc36: type = converted %T.ref.loc36, %T.as_type.loc36 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface1.loc36: = facet_access_witness %T.ref.loc36, element1 [symbolic = %T.as_wit.iface1.loc33_4.2 (constants.%T.as_wit.iface1)] +// CHECK:STDOUT: %impl.elem0.loc36: @G.%.loc33_4.2 (%.860) = impl_witness_access %T.as_wit.iface1.loc36, element0 [symbolic = %impl.elem0.loc33_4.2 (constants.%impl.elem0.656)] +// CHECK:STDOUT: %specific_fn.loc36: = specific_function %impl.elem0.loc36, @AA.1(constants.%A.facet.5b4) [symbolic = %specific_fn.loc33_4.2 (constants.%specific_fn.74e)] +// CHECK:STDOUT: %AA.call.loc36: init %empty_tuple.type = call %specific_fn.loc36() +// CHECK:STDOUT: %T.ref.loc37: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] +// CHECK:STDOUT: %BB.ref.loc37: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] +// CHECK:STDOUT: %T.as_type.loc37: type = facet_access_type %T.ref.loc37 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc37: type = converted %T.ref.loc37, %T.as_type.loc37 [symbolic = %T.as_type.loc32_28.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface2.loc37: = facet_access_witness %T.ref.loc37, element2 [symbolic = %T.as_wit.iface2.loc34_4.2 (constants.%T.as_wit.iface2)] +// CHECK:STDOUT: %impl.elem0.loc37: @G.%.loc34_4.2 (%.a5b) = impl_witness_access %T.as_wit.iface2.loc37, element0 [symbolic = %impl.elem0.loc34_4.2 (constants.%impl.elem0.097)] +// CHECK:STDOUT: %specific_fn.loc37: = specific_function %impl.elem0.loc37, @BB.1(constants.%B.facet.abf) [symbolic = %specific_fn.loc34_4.2 (constants.%specific_fn.9fa)] +// CHECK:STDOUT: %BB.call.loc37: init %empty_tuple.type = call %specific_fn.loc37() +// CHECK:STDOUT: %T.ref.loc49: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] +// CHECK:STDOUT: %A.ref.loc49: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %AA.ref.loc49: %A.assoc_type = name_ref AA, @A.%assoc0 [concrete = constants.%assoc0.f33] +// CHECK:STDOUT: %.loc49: %A.type = converted %T.ref.loc49, [concrete = ] +// CHECK:STDOUT: %T.ref.loc57: %facet_type.242 = name_ref T, %T.loc32_6.1 [symbolic = %T.loc32_6.2 (constants.%T.2df)] +// CHECK:STDOUT: %B.ref.loc57: type = name_ref B, file.%B.decl [concrete = constants.%B.type] +// CHECK:STDOUT: %BB.ref.loc57: %B.assoc_type = name_ref BB, @B.%assoc0 [concrete = constants.%assoc0.019] +// CHECK:STDOUT: %.loc57: %B.type = converted %T.ref.loc57, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)] @@ -804,19 +471,19 @@ fn F() { // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] -// CHECK:STDOUT: %.loc53_6.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc61_6.1: %empty_struct_type = struct_literal () // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc53_6.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc53_6.3: init %C = class_init (), %.loc53_6.2 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc53_6.4: ref %C = temporary %.loc53_6.2, %.loc53_6.3 -// CHECK:STDOUT: %.loc53_8.1: ref %C = converted %.loc53_6.1, %.loc53_6.4 -// CHECK:STDOUT: %facet_value.loc53_12.1: %facet_type.242 = facet_value constants.%C, (constants.%impl_witness.1bc, constants.%impl_witness.97a, constants.%impl_witness.fe4) [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc53_12.1: %facet_type.242 = converted constants.%C, %facet_value.loc53_12.1 [concrete = constants.%facet_value] -// CHECK:STDOUT: %facet_value.loc53_12.2: %facet_type.242 = facet_value constants.%C, (constants.%impl_witness.1bc, constants.%impl_witness.97a, constants.%impl_witness.fe4) [concrete = constants.%facet_value] -// CHECK:STDOUT: %.loc53_12.2: %facet_type.242 = converted constants.%C, %facet_value.loc53_12.2 [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc61_6.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc61_6.3: init %C = class_init (), %.loc61_6.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc61_6.4: ref %C = temporary %.loc61_6.2, %.loc61_6.3 +// CHECK:STDOUT: %.loc61_8.1: ref %C = converted %.loc61_6.1, %.loc61_6.4 +// CHECK:STDOUT: %facet_value.loc61_12.1: %facet_type.242 = facet_value constants.%C, (constants.%impl_witness.1bc, constants.%impl_witness.97a, constants.%impl_witness.fe4) [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc61_12.1: %facet_type.242 = converted constants.%C, %facet_value.loc61_12.1 [concrete = constants.%facet_value] +// CHECK:STDOUT: %facet_value.loc61_12.2: %facet_type.242 = facet_value constants.%C, (constants.%impl_witness.1bc, constants.%impl_witness.97a, constants.%impl_witness.fe4) [concrete = constants.%facet_value] +// CHECK:STDOUT: %.loc61_12.2: %facet_type.242 = converted constants.%C, %facet_value.loc61_12.2 [concrete = constants.%facet_value] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%facet_value) [concrete = constants.%G.specific_fn] -// CHECK:STDOUT: %.loc53_8.2: %C = bind_value %.loc53_8.1 -// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%.loc53_8.2) +// CHECK:STDOUT: %.loc61_8.2: %C = bind_value %.loc61_8.1 +// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%.loc61_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -863,9 +530,9 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T.2df) { -// CHECK:STDOUT: %T.loc24_6.2 => constants.%T.2df -// CHECK:STDOUT: %T.patt.loc24_6.2 => constants.%T.2df -// CHECK:STDOUT: %T.as_type.loc24_28.2 => constants.%T.as_type +// CHECK:STDOUT: %T.loc32_6.2 => constants.%T.2df +// CHECK:STDOUT: %T.patt.loc32_6.2 => constants.%T.2df +// CHECK:STDOUT: %T.as_type.loc32_28.2 => constants.%T.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AA.1(constants.%A.facet.5b4) {} @@ -919,21 +586,332 @@ fn F() { // CHECK:STDOUT: specific @BB.1(@G.%B.facet) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%facet_value) { -// CHECK:STDOUT: %T.loc24_6.2 => constants.%facet_value -// CHECK:STDOUT: %T.patt.loc24_6.2 => constants.%facet_value -// CHECK:STDOUT: %T.as_type.loc24_28.2 => constants.%C +// CHECK:STDOUT: %T.loc32_6.2 => constants.%facet_value +// CHECK:STDOUT: %T.patt.loc32_6.2 => constants.%facet_value +// CHECK:STDOUT: %T.as_type.loc32_28.2 => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.357 -// CHECK:STDOUT: %T.as_wit.iface1.loc25_4.2 => constants.%impl_witness.97a +// CHECK:STDOUT: %T.as_wit.iface1.loc33_4.2 => constants.%impl_witness.97a // CHECK:STDOUT: %A.facet => constants.%A.facet.213 -// CHECK:STDOUT: %.loc25_4.2 => constants.%.4b2 -// CHECK:STDOUT: %impl.elem0.loc25_4.2 => constants.%AA.95d -// CHECK:STDOUT: %specific_fn.loc25_4.2 => constants.%AA.specific_fn -// CHECK:STDOUT: %T.as_wit.iface2.loc26_4.2 => constants.%impl_witness.fe4 +// CHECK:STDOUT: %.loc33_4.2 => constants.%.4b2 +// CHECK:STDOUT: %impl.elem0.loc33_4.2 => constants.%AA.95d +// CHECK:STDOUT: %specific_fn.loc33_4.2 => constants.%AA.specific_fn +// CHECK:STDOUT: %T.as_wit.iface2.loc34_4.2 => constants.%impl_witness.fe4 // CHECK:STDOUT: %B.facet => constants.%B.facet.f74 -// CHECK:STDOUT: %.loc26_4.2 => constants.%.2b4 -// CHECK:STDOUT: %impl.elem0.loc26_4.2 => constants.%BB.fe8 -// CHECK:STDOUT: %specific_fn.loc26_4.2 => constants.%BB.specific_fn +// CHECK:STDOUT: %.loc34_4.2 => constants.%.2b4 +// CHECK:STDOUT: %impl.elem0.loc34_4.2 => constants.%BB.fe8 +// CHECK:STDOUT: %specific_fn.loc34_4.2 => constants.%BB.specific_fn +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- toolchain/testing/min_prelude/facet_types.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete] +// CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic] +// CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic] +// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type %As.type.8ba [symbolic] +// CHECK:STDOUT: %assoc0.ac5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic] +// CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic] +// CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] +// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete] +// CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic] +// CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete] +// CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete] +// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete] +// CHECK:STDOUT: %assoc0.121: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic] +// CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic] +// CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, (%impl_witness) [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .As = %As.decl +// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl +// CHECK:STDOUT: .BitAnd = %BitAnd.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] { +// CHECK:STDOUT: %Dest.patt.loc9_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.loc9_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] { +// CHECK:STDOUT: %Dest.patt.loc13_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.loc13_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] { +// CHECK:STDOUT: %T.patt.loc21_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %T.loc21_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(%Dest.loc9_14.1: type) { +// CHECK:STDOUT: %Dest.loc9_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt.loc9_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc9_14.2)> [symbolic = %As.type (constants.%As.type.8ba)] +// CHECK:STDOUT: %Self.2: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc9_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)] +// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As.%As.type (%As.type.8ba) [symbolic = %As.assoc_type (constants.%As.assoc_type)] +// CHECK:STDOUT: %assoc0.loc10_35.2: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.ac5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] +// CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] { +// CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc9_14.1 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param call_param0 +// CHECK:STDOUT: %.loc10_20.1: type = splice_block %.loc10_20.3 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] { +// CHECK:STDOUT: %.loc10_20.2: @Convert.1.%As.type (%As.type.8ba) = specific_constant @As.%Self.1, @As(constants.%Dest) [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc10_20.2 [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.as_type.loc10_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: %.loc10_20.3: type = converted %Self.ref, %Self.as_type.loc10_20.2 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0.loc10_35.1: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.ac5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .Dest = +// CHECK:STDOUT: .Convert = %assoc0.loc10_35.1 +// CHECK:STDOUT: witness = (%Convert.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc13_22.1: type) { +// CHECK:STDOUT: %Dest.loc13_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt.loc13_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc13_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc13_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)] +// CHECK:STDOUT: %assoc0.loc14_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.a50)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] +// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] { +// CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc13_22.1 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param call_param0 +// CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.3 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] { +// CHECK:STDOUT: %.loc14_20.2: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc14_20.2 [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.as_type.loc14_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: %.loc14_20.3: type = converted %Self.ref, %Self.as_type.loc14_20.2 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0.loc14_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.a50)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .Dest = +// CHECK:STDOUT: .Convert = %assoc0.loc14_35.1 +// CHECK:STDOUT: witness = (%Convert.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @BitAnd { +// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44] +// CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] { +// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1 +// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc18_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_37: type = facet_access_type %Self.ref.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_37: type = converted %Self.ref.loc18_37, %Self.as_type.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param0 +// CHECK:STDOUT: %.loc18_15.1: type = splice_block %.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] { +// CHECK:STDOUT: %Self.ref.loc18_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_15.2: type = facet_access_type %Self.ref.loc18_15 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_15.2: type = converted %Self.ref.loc18_15, %Self.as_type.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param1 +// CHECK:STDOUT: %.loc18_28.1: type = splice_block %.loc18_28.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] { +// CHECK:STDOUT: %Self.ref.loc18_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_28: type = facet_access_type %Self.ref.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_28.2: type = converted %Self.ref.loc18_28, %Self.as_type.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param call_param2 +// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.121] +// 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(%T.loc21_14.1: type) { +// CHECK:STDOUT: %T.loc21_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc21_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%Op.decl), @impl(%T.loc21_14.2) [symbolic = %impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc21_14.2) [symbolic = %Op.type (constants.%Op.type.28d)] +// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%T.loc21_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: %T.ref as %BitAnd.ref { +// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] { +// CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1 +// CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc22_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0 +// CHECK:STDOUT: %Self.ref.loc22_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1 +// CHECK:STDOUT: %Self.ref.loc22_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2 +// CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Op = %Op.decl +// CHECK:STDOUT: witness = file.%impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc9_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)] +// CHECK:STDOUT: %Self: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.as_type.loc10_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc13_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.as_type.loc14_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419)]() -> @Convert.2.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) { +// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc21_14.1: type) { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest.loc9_14.2 => constants.%Dest +// CHECK:STDOUT: %Dest.patt.loc9_14.2 => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.8ba +// CHECK:STDOUT: %Self => constants.%Self.b4e +// CHECK:STDOUT: %Self.as_type.loc10_20.1 => constants.%Self.as_type.7f0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.1.%Dest) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(%Dest.loc9_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest.loc13_22.2 => constants.%Dest +// CHECK:STDOUT: %Dest.patt.loc13_22.2 => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f +// CHECK:STDOUT: %Self => constants.%Self.0f3 +// CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type.419 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(%Dest.loc13_22.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%Self.e44) { +// CHECK:STDOUT: %Self => constants.%Self.e44 +// CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%Self.as_type.560 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(constants.%T) { +// CHECK:STDOUT: %T.loc21_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T +// CHECK:STDOUT: %impl_witness => constants.%impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc21_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(constants.%T) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) { +// CHECK:STDOUT: %Self => constants.%BitAnd.facet +// CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon b/toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon similarity index 79% rename from toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon rename to toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon index f1e8dec9ba3a..1311a14292da 100644 --- a/toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon +++ b/toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon @@ -2,30 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon +// EXTRA-ARGS: --custom-core +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/compound_member_access.carbon - -// --- core.carbon -package Core; - -interface As(Dest:! type) { - fn Convert[self: Self]() -> Dest; -} - -interface ImplicitAs(Dest:! type) { - fn Convert[self: Self]() -> Dest; -} - -interface BitAnd { - fn Op[self: Self](other: Self) -> Self; -} - -impl forall [T:! type] T as BitAnd { - fn Op[self: Self](other: Self) -> Self = "type.and"; -} +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/compound_member_access.carbon // --- associated_constant.carbon library "[[@TEST_NAME]]"; @@ -60,8 +44,6 @@ fn Compound2(V:! K1) { // --- fail_caller_instance_interface_not.carbon library "[[@TEST_NAME]]"; -import Core; - interface K2 { fn Q2(); } @@ -162,8 +144,6 @@ fn Compound5(V:! L2) { // --- fail_combine_non_instance.carbon library "[[@TEST_NAME]]"; -import Core; - interface A { fn G(); } @@ -205,8 +185,6 @@ fn Fails() { // --- allowed_combine_non_instance.carbon library "[[@TEST_NAME]]"; -import Core; - interface A { fn G(); } @@ -222,317 +200,6 @@ fn Works() { (C as (A & A)).(A.G)(); } -// CHECK:STDOUT: --- core.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] -// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] -// CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete] -// CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete] -// CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic] -// CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic] -// CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic] -// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type %As.type.8ba [symbolic] -// CHECK:STDOUT: %assoc0.ac5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic] -// CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] -// CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic] -// CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic] -// CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] -// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete] -// CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic] -// CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete] -// CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete] -// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete] -// CHECK:STDOUT: %assoc0.121: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete] -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] -// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] -// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic] -// CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic] -// CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] -// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, (%impl_witness) [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .As = %As.decl -// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl -// CHECK:STDOUT: .BitAnd = %BitAnd.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] { -// CHECK:STDOUT: %Dest.patt.loc3_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc3_14.2 (constants.%Dest.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.loc3_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc3_14.2 (constants.%Dest)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] { -// CHECK:STDOUT: %Dest.patt.loc7_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc7_22.2 (constants.%Dest.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.loc7_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc7_22.2 (constants.%Dest)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] { -// CHECK:STDOUT: %T.patt.loc15_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_14.1 [symbolic = %T.loc15_14.2 (constants.%T)] -// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %T.loc15_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @As(%Dest.loc3_14.1: type) { -// CHECK:STDOUT: %Dest.loc3_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc3_14.2 (constants.%Dest)] -// CHECK:STDOUT: %Dest.patt.loc3_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc3_14.2 (constants.%Dest.patt)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc3_14.2)> [symbolic = %As.type (constants.%As.type.8ba)] -// CHECK:STDOUT: %Self.2: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc3_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)] -// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)] -// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As.%As.type (%As.type.8ba) [symbolic = %As.assoc_type (constants.%As.assoc_type)] -// CHECK:STDOUT: %assoc0.loc4_35.2: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0.ac5)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] -// CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] { -// CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc3_14.1 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = value_param call_param0 -// CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] { -// CHECK:STDOUT: %.loc4_20.2: @Convert.1.%As.type (%As.type.8ba) = specific_constant @As.%Self.1, @As(constants.%Dest) [symbolic = %Self (constants.%Self.b4e)] -// CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc4_20.2 [symbolic = %Self (constants.%Self.b4e)] -// CHECK:STDOUT: %Self.as_type.loc4_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] -// CHECK:STDOUT: %.loc4_20.3: type = converted %Self.ref, %Self.as_type.loc4_20.2 [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0) = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc4_35.1: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc4_35.2 (constants.%assoc0.ac5)] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .Dest = -// CHECK:STDOUT: .Convert = %assoc0.loc4_35.1 -// CHECK:STDOUT: witness = (%Convert.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc7_22.1: type) { -// CHECK:STDOUT: %Dest.loc7_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc7_22.2 (constants.%Dest)] -// CHECK:STDOUT: %Dest.patt.loc7_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc7_22.2 (constants.%Dest.patt)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc7_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] -// CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc7_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)] -// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)] -// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)] -// CHECK:STDOUT: %assoc0.loc8_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc8_35.2 (constants.%assoc0.a50)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] -// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] { -// CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc7_22.1 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = value_param call_param0 -// CHECK:STDOUT: %.loc8_20.1: type = splice_block %.loc8_20.3 [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] { -// CHECK:STDOUT: %.loc8_20.2: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc8_20.2 [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.as_type.loc8_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: %.loc8_20.3: type = converted %Self.ref, %Self.as_type.loc8_20.2 [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419) = bind_name self, %self.param -// CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc8_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc8_35.2 (constants.%assoc0.a50)] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .Dest = -// CHECK:STDOUT: .Convert = %assoc0.loc8_35.1 -// CHECK:STDOUT: witness = (%Convert.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd { -// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44] -// CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] { -// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1 -// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc12_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_37: type = facet_access_type %Self.ref.loc12_37 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %.loc12_37: type = converted %Self.ref.loc12_37, %Self.as_type.loc12_37 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param call_param0 -// CHECK:STDOUT: %.loc12_15.1: type = splice_block %.loc12_15.2 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] { -// CHECK:STDOUT: %Self.ref.loc12_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_15.2: type = facet_access_type %Self.ref.loc12_15 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %.loc12_15.2: type = converted %Self.ref.loc12_15, %Self.as_type.loc12_15.2 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = value_param call_param1 -// CHECK:STDOUT: %.loc12_28.1: type = splice_block %.loc12_28.2 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] { -// CHECK:STDOUT: %Self.ref.loc12_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_28: type = facet_access_type %Self.ref.loc12_28 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: %.loc12_28.2: type = converted %Self.ref.loc12_28, %Self.as_type.loc12_28 [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.121] -// 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(%T.loc15_14.1: type) { -// CHECK:STDOUT: %T.loc15_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_14.2 (constants.%T)] -// CHECK:STDOUT: %T.patt.loc15_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc15_14.2 (constants.%T.patt)] -// CHECK:STDOUT: %impl_witness: = impl_witness (%Op.decl), @impl(%T.loc15_14.2) [symbolic = %impl_witness (constants.%impl_witness)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc15_14.2) [symbolic = %Op.type (constants.%Op.type.28d)] -// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)] -// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%T.loc15_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %T.ref as %BitAnd.ref { -// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] { -// CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self -// CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0 -// CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other -// CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1 -// CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param -// CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param -// CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Op = %Op.decl -// CHECK:STDOUT: witness = file.%impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc3_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)] -// CHECK:STDOUT: %Self: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)] -// CHECK:STDOUT: %Self.as_type.loc4_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc4_20.1 (constants.%Self.as_type.7f0)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc4_20.1 (%Self.as_type.7f0)]() -> @Convert.1.%Dest (%Dest); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc7_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] -// CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)] -// CHECK:STDOUT: %Self.as_type.loc8_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_20.1 (constants.%Self.as_type.419)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc8_20.1 (%Self.as_type.419)]() -> @Convert.2.%Dest (%Dest); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) { -// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)] -// CHECK:STDOUT: %Self.as_type.loc12_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_15.1 (constants.%Self.as_type.560)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc12_15.1 (%Self.as_type.560); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc15_14.1: type) { -// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(constants.%Dest) { -// CHECK:STDOUT: %Dest.loc3_14.2 => constants.%Dest -// CHECK:STDOUT: %Dest.patt.loc3_14.2 => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %As.type => constants.%As.type.8ba -// CHECK:STDOUT: %Self => constants.%Self.b4e -// CHECK:STDOUT: %Self.as_type.loc4_20.1 => constants.%Self.as_type.7f0 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(@Convert.1.%Dest) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @As(%Dest.loc3_14.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { -// CHECK:STDOUT: %Dest.loc7_22.2 => constants.%Dest -// CHECK:STDOUT: %Dest.patt.loc7_22.2 => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f -// CHECK:STDOUT: %Self => constants.%Self.0f3 -// CHECK:STDOUT: %Self.as_type.loc8_20.1 => constants.%Self.as_type.419 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(%Dest.loc7_22.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.1(constants.%Self.e44) { -// CHECK:STDOUT: %Self => constants.%Self.e44 -// CHECK:STDOUT: %Self.as_type.loc12_15.1 => constants.%Self.as_type.560 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(constants.%T) { -// CHECK:STDOUT: %T.loc15_14.2 => constants.%T -// CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T -// CHECK:STDOUT: %impl_witness => constants.%impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @impl(%T.loc15_14.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.2(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) { -// CHECK:STDOUT: %Self => constants.%BitAnd.facet -// CHECK:STDOUT: %Self.as_type.loc12_15.1 => constants.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: --- associated_constant.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -562,12 +229,20 @@ fn Works() { // CHECK:STDOUT: %Compound1: %Compound1.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .J = %J.decl // CHECK:STDOUT: .Simple1 = %Simple1.decl // CHECK:STDOUT: .Compound1 = %Compound1.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {} // CHECK:STDOUT: %Simple1.decl: %Simple1.type = fn_decl @Simple1 [concrete = constants.%Simple1] { // CHECK:STDOUT: %T.patt.loc8_12.1: %J.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt)] @@ -708,12 +383,20 @@ fn Works() { // CHECK:STDOUT: %specific_fn.4c5be7.2: = specific_function %impl.elem0.d9a98e.2, @Q1(%K1.facet.07e9b4.2) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .K1 = %K1.decl // CHECK:STDOUT: .Simple2 = %Simple2.decl // CHECK:STDOUT: .Compound2 = %Compound2.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %K1.decl: type = interface_decl @K1 [concrete = constants.%K1.type] {} {} // CHECK:STDOUT: %Simple2.decl: %Simple2.type = fn_decl @Simple2 [concrete = constants.%Simple2] { // CHECK:STDOUT: %T.patt.loc8_12.1: %K1.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_12.2 (constants.%T.patt)] @@ -869,24 +552,24 @@ fn Works() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc7_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] -// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst65 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc8_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] -// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc7_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] -// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst65 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] -// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc8_35, unloaded -// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst100 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.3bf = import_ref Core//default, loc12_41, unloaded -// CHECK:STDOUT: %Core.Op = import_ref Core//default, Op, unloaded -// CHECK:STDOUT: %Core.import_ref.f80 = import_ref Core//default, loc15_36, unloaded -// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] -// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc15_24, loaded [symbolic = @impl.%T (constants.%T.8b3)] -// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc15_29, loaded [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %Core.import_ref.bd4 = import_ref Core//default, loc16_42, unloaded -// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst65 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] +// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst65 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] +// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//prelude, loc14_35, unloaded +// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst100 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.3bf = import_ref Core//prelude, loc18_41, unloaded +// CHECK:STDOUT: %Core.Op = import_ref Core//prelude, Op, unloaded +// CHECK:STDOUT: %Core.import_ref.f80 = import_ref Core//prelude, loc21_36, unloaded +// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.%T (constants.%T.8b3)] +// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %Core.import_ref.bd4 = import_ref Core//prelude, loc22_42, unloaded +// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.%T (constants.%T.8b3)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -899,34 +582,34 @@ fn Works() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %K2.decl: type = interface_decl @K2 [concrete = constants.%K2.type] {} {} // CHECK:STDOUT: %Simple3.decl: %Simple3.type = fn_decl @Simple3 [concrete = constants.%Simple3] { -// CHECK:STDOUT: %T.patt.loc11_12.1: %K2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_12.2 (constants.%T.patt.6d1)] -// CHECK:STDOUT: %x.patt: @Simple3.%T.as_type.loc11_23.2 (%T.as_type) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @Simple3.%T.as_type.loc11_23.2 (%T.as_type) = value_param_pattern %x.patt, call_param0 +// CHECK:STDOUT: %T.patt.loc9_12.1: %K2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_12.2 (constants.%T.patt.6d1)] +// CHECK:STDOUT: %x.patt: @Simple3.%T.as_type.loc9_23.2 (%T.as_type) = binding_pattern x +// CHECK:STDOUT: %x.param_patt: @Simple3.%T.as_type.loc9_23.2 (%T.as_type) = value_param_pattern %x.patt, call_param0 // CHECK:STDOUT: } { // CHECK:STDOUT: %K2.ref: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type] -// CHECK:STDOUT: %T.loc11_12.1: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc11_12.2 (constants.%T.0ce)] -// CHECK:STDOUT: %x.param: @Simple3.%T.as_type.loc11_23.2 (%T.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc11_23.1: type = splice_block %.loc11_23.2 [symbolic = %T.as_type.loc11_23.2 (constants.%T.as_type)] { -// CHECK:STDOUT: %T.ref: %K2.type = name_ref T, %T.loc11_12.1 [symbolic = %T.loc11_12.2 (constants.%T.0ce)] -// CHECK:STDOUT: %T.as_type.loc11_23.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc11_23.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc11_23.2: type = converted %T.ref, %T.as_type.loc11_23.1 [symbolic = %T.as_type.loc11_23.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.loc9_12.1: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.2 (constants.%T.0ce)] +// CHECK:STDOUT: %x.param: @Simple3.%T.as_type.loc9_23.2 (%T.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] { +// CHECK:STDOUT: %T.ref: %K2.type = name_ref T, %T.loc9_12.1 [symbolic = %T.loc9_12.2 (constants.%T.0ce)] +// CHECK:STDOUT: %T.as_type.loc9_23.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc9_23.2: type = converted %T.ref, %T.as_type.loc9_23.1 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %x: @Simple3.%T.as_type.loc11_23.2 (%T.as_type) = bind_name x, %x.param +// CHECK:STDOUT: %x: @Simple3.%T.as_type.loc9_23.2 (%T.as_type) = bind_name x, %x.param // CHECK:STDOUT: } // CHECK:STDOUT: %Compound3.decl: %Compound3.type = fn_decl @Compound3 [concrete = constants.%Compound3] { -// CHECK:STDOUT: %V.patt.loc17_14.1: %K2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc17_14.2 (constants.%V.patt)] -// CHECK:STDOUT: %y.patt: @Compound3.%V.as_type.loc17_25.2 (%V.as_type) = binding_pattern y -// CHECK:STDOUT: %y.param_patt: @Compound3.%V.as_type.loc17_25.2 (%V.as_type) = value_param_pattern %y.patt, call_param0 +// CHECK:STDOUT: %V.patt.loc15_14.1: %K2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc15_14.2 (constants.%V.patt)] +// CHECK:STDOUT: %y.patt: @Compound3.%V.as_type.loc15_25.2 (%V.as_type) = binding_pattern y +// CHECK:STDOUT: %y.param_patt: @Compound3.%V.as_type.loc15_25.2 (%V.as_type) = value_param_pattern %y.patt, call_param0 // CHECK:STDOUT: } { -// CHECK:STDOUT: %K2.ref.loc17: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type] -// CHECK:STDOUT: %V.loc17_14.1: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc17_14.2 (constants.%V)] -// CHECK:STDOUT: %y.param: @Compound3.%V.as_type.loc17_25.2 (%V.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc17_25.1: type = splice_block %.loc17_25.2 [symbolic = %V.as_type.loc17_25.2 (constants.%V.as_type)] { -// CHECK:STDOUT: %V.ref: %K2.type = name_ref V, %V.loc17_14.1 [symbolic = %V.loc17_14.2 (constants.%V)] -// CHECK:STDOUT: %V.as_type.loc17_25.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc17_25.2 (constants.%V.as_type)] -// CHECK:STDOUT: %.loc17_25.2: type = converted %V.ref, %V.as_type.loc17_25.1 [symbolic = %V.as_type.loc17_25.2 (constants.%V.as_type)] +// CHECK:STDOUT: %K2.ref.loc15: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type] +// CHECK:STDOUT: %V.loc15_14.1: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc15_14.2 (constants.%V)] +// CHECK:STDOUT: %y.param: @Compound3.%V.as_type.loc15_25.2 (%V.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc15_25.1: type = splice_block %.loc15_25.2 [symbolic = %V.as_type.loc15_25.2 (constants.%V.as_type)] { +// CHECK:STDOUT: %V.ref: %K2.type = name_ref V, %V.loc15_14.1 [symbolic = %V.loc15_14.2 (constants.%V)] +// CHECK:STDOUT: %V.as_type.loc15_25.1: type = facet_access_type %V.ref [symbolic = %V.as_type.loc15_25.2 (constants.%V.as_type)] +// CHECK:STDOUT: %.loc15_25.2: type = converted %V.ref, %V.as_type.loc15_25.1 [symbolic = %V.as_type.loc15_25.2 (constants.%V.as_type)] // CHECK:STDOUT: } -// CHECK:STDOUT: %y: @Compound3.%V.as_type.loc17_25.2 (%V.as_type) = bind_name y, %y.param +// CHECK:STDOUT: %y: @Compound3.%V.as_type.loc15_25.2 (%V.as_type) = bind_name y, %y.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -941,7 +624,7 @@ fn Works() { // CHECK:STDOUT: witness = (%Q2.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] { +// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: @@ -961,14 +644,14 @@ fn Works() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] { +// CHECK:STDOUT: interface @BitAnd [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0 // CHECK:STDOUT: .Op = imports.%Core.import_ref.3bf // CHECK:STDOUT: witness = (imports.%Core.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.3: type) [from "core.carbon"] { +// CHECK:STDOUT: generic impl @impl(imports.%Core.import_ref.5ab3ec.3: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt.e01)] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.bd4), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness)] @@ -988,52 +671,52 @@ fn Works() { // CHECK:STDOUT: fn(); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Simple3(%T.loc11_12.1: %K2.type) { -// CHECK:STDOUT: %T.loc11_12.2: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc11_12.2 (constants.%T.0ce)] -// CHECK:STDOUT: %T.patt.loc11_12.2: %K2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_12.2 (constants.%T.patt.6d1)] -// CHECK:STDOUT: %T.as_type.loc11_23.2: type = facet_access_type %T.loc11_12.2 [symbolic = %T.as_type.loc11_23.2 (constants.%T.as_type)] +// CHECK:STDOUT: generic fn @Simple3(%T.loc9_12.1: %K2.type) { +// CHECK:STDOUT: %T.loc9_12.2: %K2.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_12.2 (constants.%T.0ce)] +// CHECK:STDOUT: %T.patt.loc9_12.2: %K2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_12.2 (constants.%T.patt.6d1)] +// CHECK:STDOUT: %T.as_type.loc9_23.2: type = facet_access_type %T.loc9_12.2 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Simple3.%T.as_type.loc11_23.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.022e81.1)] -// CHECK:STDOUT: %T.as_wit.iface0.loc12_4.2: = facet_access_witness %T.loc11_12.2, element0 [symbolic = %T.as_wit.iface0.loc12_4.2 (constants.%T.as_wit.iface0)] -// CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type.loc11_23.2, (%T.as_wit.iface0.loc12_4.2) [symbolic = %K2.facet (constants.%K2.facet)] -// CHECK:STDOUT: %.loc12_4.2: type = fn_type_with_self_type constants.%Q2.type, %K2.facet [symbolic = %.loc12_4.2 (constants.%.75b)] -// CHECK:STDOUT: %impl.elem0.loc12_4.2: @Simple3.%.loc12_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc12_4.2, element0 [symbolic = %impl.elem0.loc12_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc12_4.2: = specific_function %impl.elem0.loc12_4.2, @Q2(%K2.facet) [symbolic = %specific_fn.loc12_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Simple3.%T.as_type.loc9_23.2 (%T.as_type) [symbolic = %require_complete (constants.%require_complete.022e81.1)] +// CHECK:STDOUT: %T.as_wit.iface0.loc10_4.2: = facet_access_witness %T.loc9_12.2, element0 [symbolic = %T.as_wit.iface0.loc10_4.2 (constants.%T.as_wit.iface0)] +// CHECK:STDOUT: %K2.facet: %K2.type = facet_value %T.as_type.loc9_23.2, (%T.as_wit.iface0.loc10_4.2) [symbolic = %K2.facet (constants.%K2.facet)] +// CHECK:STDOUT: %.loc10_4.2: type = fn_type_with_self_type constants.%Q2.type, %K2.facet [symbolic = %.loc10_4.2 (constants.%.75b)] +// CHECK:STDOUT: %impl.elem0.loc10_4.2: @Simple3.%.loc10_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc10_4.2, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc10_4.2: = specific_function %impl.elem0.loc10_4.2, @Q2(%K2.facet) [symbolic = %specific_fn.loc10_4.2 (constants.%specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.patt.loc11_12.1: %K2.type, %x.param_patt: @Simple3.%T.as_type.loc11_23.2 (%T.as_type)) { +// CHECK:STDOUT: fn(%T.patt.loc9_12.1: %K2.type, %x.param_patt: @Simple3.%T.as_type.loc9_23.2 (%T.as_type)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @Simple3.%T.as_type.loc11_23.2 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %x.ref: @Simple3.%T.as_type.loc9_23.2 (%T.as_type) = name_ref x, %x // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.358] -// CHECK:STDOUT: %T.as_type.loc12: type = facet_access_type constants.%T.0ce [symbolic = %T.as_type.loc11_23.2 (constants.%T.as_type)] -// CHECK:STDOUT: %.loc12_4.1: type = converted constants.%T.0ce, %T.as_type.loc12 [symbolic = %T.as_type.loc11_23.2 (constants.%T.as_type)] -// CHECK:STDOUT: %T.as_wit.iface0.loc12_4.1: = facet_access_witness constants.%T.0ce, element0 [symbolic = %T.as_wit.iface0.loc12_4.2 (constants.%T.as_wit.iface0)] -// CHECK:STDOUT: %impl.elem0.loc12_4.1: @Simple3.%.loc12_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc12_4.1, element0 [symbolic = %impl.elem0.loc12_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_fn.loc12_4.1: = specific_function %impl.elem0.loc12_4.1, @Q2(constants.%K2.facet) [symbolic = %specific_fn.loc12_4.2 (constants.%specific_fn)] -// CHECK:STDOUT: %Q2.call: init %empty_tuple.type = call %specific_fn.loc12_4.1() +// CHECK:STDOUT: %T.as_type.loc10: type = facet_access_type constants.%T.0ce [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] +// CHECK:STDOUT: %.loc10_4.1: type = converted constants.%T.0ce, %T.as_type.loc10 [symbolic = %T.as_type.loc9_23.2 (constants.%T.as_type)] +// CHECK:STDOUT: %T.as_wit.iface0.loc10_4.1: = facet_access_witness constants.%T.0ce, element0 [symbolic = %T.as_wit.iface0.loc10_4.2 (constants.%T.as_wit.iface0)] +// CHECK:STDOUT: %impl.elem0.loc10_4.1: @Simple3.%.loc10_4.2 (%.75b) = impl_witness_access %T.as_wit.iface0.loc10_4.1, element0 [symbolic = %impl.elem0.loc10_4.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_fn.loc10_4.1: = specific_function %impl.elem0.loc10_4.1, @Q2(constants.%K2.facet) [symbolic = %specific_fn.loc10_4.2 (constants.%specific_fn)] +// CHECK:STDOUT: %Q2.call: init %empty_tuple.type = call %specific_fn.loc10_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Compound3(%V.loc17_14.1: %K2.type) { -// CHECK:STDOUT: %V.loc17_14.2: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc17_14.2 (constants.%V)] -// CHECK:STDOUT: %V.patt.loc17_14.2: %K2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc17_14.2 (constants.%V.patt)] -// CHECK:STDOUT: %V.as_type.loc17_25.2: type = facet_access_type %V.loc17_14.2 [symbolic = %V.as_type.loc17_25.2 (constants.%V.as_type)] +// CHECK:STDOUT: generic fn @Compound3(%V.loc15_14.1: %K2.type) { +// CHECK:STDOUT: %V.loc15_14.2: %K2.type = bind_symbolic_name V, 0 [symbolic = %V.loc15_14.2 (constants.%V)] +// CHECK:STDOUT: %V.patt.loc15_14.2: %K2.type = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc15_14.2 (constants.%V.patt)] +// CHECK:STDOUT: %V.as_type.loc15_25.2: type = facet_access_type %V.loc15_14.2 [symbolic = %V.as_type.loc15_25.2 (constants.%V.as_type)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Compound3.%V.as_type.loc17_25.2 (%V.as_type) [symbolic = %require_complete (constants.%require_complete.022e81.2)] +// CHECK:STDOUT: %require_complete: = require_complete_type @Compound3.%V.as_type.loc15_25.2 (%V.as_type) [symbolic = %require_complete (constants.%require_complete.022e81.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%V.patt.loc17_14.1: %K2.type, %y.param_patt: @Compound3.%V.as_type.loc17_25.2 (%V.as_type)) { +// CHECK:STDOUT: fn(%V.patt.loc15_14.1: %K2.type, %y.param_patt: @Compound3.%V.as_type.loc15_25.2 (%V.as_type)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %y.ref: @Compound3.%V.as_type.loc17_25.2 (%V.as_type) = name_ref y, %y -// CHECK:STDOUT: %K2.ref.loc25: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type] +// CHECK:STDOUT: %y.ref: @Compound3.%V.as_type.loc15_25.2 (%V.as_type) = name_ref y, %y +// CHECK:STDOUT: %K2.ref.loc23: type = name_ref K2, file.%K2.decl [concrete = constants.%K2.type] // CHECK:STDOUT: %Q2.ref: %K2.assoc_type = name_ref Q2, @K2.%assoc0 [concrete = constants.%assoc0.358] -// CHECK:STDOUT: %.loc25: %K2.type = converted %y.ref, [concrete = ] +// CHECK:STDOUT: %.loc23: %K2.type = converted %y.ref, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)] @@ -1042,7 +725,7 @@ fn Works() { // CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op(imports.%Core.import_ref.5ab3ec.4: type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op(imports.%Core.import_ref.5ab3ec.4: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1053,9 +736,9 @@ fn Works() { // CHECK:STDOUT: specific @Q2(constants.%Self.0ce) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Simple3(constants.%T.0ce) { -// CHECK:STDOUT: %T.loc11_12.2 => constants.%T.0ce -// CHECK:STDOUT: %T.patt.loc11_12.2 => constants.%T.0ce -// CHECK:STDOUT: %T.as_type.loc11_23.2 => constants.%T.as_type +// CHECK:STDOUT: %T.loc9_12.2 => constants.%T.0ce +// CHECK:STDOUT: %T.patt.loc9_12.2 => constants.%T.0ce +// CHECK:STDOUT: %T.as_type.loc9_23.2 => constants.%T.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Q2(constants.%K2.facet) {} @@ -1063,9 +746,9 @@ fn Works() { // CHECK:STDOUT: specific @Q2(@Simple3.%K2.facet) {} // CHECK:STDOUT: // CHECK:STDOUT: specific @Compound3(constants.%V) { -// CHECK:STDOUT: %V.loc17_14.2 => constants.%V -// CHECK:STDOUT: %V.patt.loc17_14.2 => constants.%V -// CHECK:STDOUT: %V.as_type.loc17_25.2 => constants.%V.as_type +// CHECK:STDOUT: %V.loc15_14.2 => constants.%V +// CHECK:STDOUT: %V.patt.loc15_14.2 => constants.%V +// CHECK:STDOUT: %V.as_type.loc15_25.2 => constants.%V.as_type // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { @@ -1148,12 +831,20 @@ fn Works() { // CHECK:STDOUT: %require_complete.97cd40.2: = require_complete_type %V.as_type [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .L1 = %L1.decl // CHECK:STDOUT: .Simple4 = %Simple4.decl // CHECK:STDOUT: .Compound4 = %Compound4.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %L1.decl: type = interface_decl @L1 [concrete = constants.%L1.type] {} {} // CHECK:STDOUT: %Simple4.decl: %Simple4.type = fn_decl @Simple4 [concrete = constants.%Simple4] { // CHECK:STDOUT: %T.patt.loc10_12.1: %L1.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_12.2 (constants.%T.patt)] @@ -1404,12 +1095,20 @@ fn Works() { // CHECK:STDOUT: %Compound5: %Compound5.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .L2 = %L2.decl // CHECK:STDOUT: .Simple5 = %Simple5.decl // CHECK:STDOUT: .Compound5 = %Compound5.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %L2.decl: type = interface_decl @L2 [concrete = constants.%L2.type] {} {} // CHECK:STDOUT: %Simple5.decl: %Simple5.type = fn_decl @Simple5 [concrete = constants.%Simple5] { // CHECK:STDOUT: %T.patt.loc10_12.1: %L2.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_12.2 (constants.%T.patt)] @@ -1633,25 +1332,25 @@ fn Works() { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .BitAnd = %Core.BitAnd // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst100 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//default, loc12_41, loaded [concrete = constants.%assoc0.a63] -// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//default, Op, loaded [concrete = constants.%Op.ab9] -// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//default, inst100 [no loc], loaded [symbolic = constants.%Self.25f] -// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//default, loc15_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc15_24, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc15_29, loaded [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//default, loc16_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//default, loc7_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] -// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst65 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc8_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] -// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//default, loc7_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] -// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst65 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] -// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc8_35, unloaded +// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst100 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0.a63] +// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//prelude, Op, loaded [concrete = constants.%Op.ab9] +// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst100 [no loc], loaded [symbolic = constants.%Self.25f] +// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//prelude, inst65 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//prelude, loc14_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)] +// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//prelude, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//prelude, loc13_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)] +// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//prelude, inst65 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)] +// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//prelude, loc14_35, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1683,14 +1382,14 @@ fn Works() { // CHECK:STDOUT: witness = (%G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] { +// CHECK:STDOUT: interface @BitAnd [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0 // CHECK:STDOUT: .Op = imports.%Core.import_ref.08d // CHECK:STDOUT: witness = (imports.%Core.Op) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "core.carbon"] { +// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.3: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)] // CHECK:STDOUT: @@ -1718,7 +1417,7 @@ fn Works() { // CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] { +// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)] @@ -1753,84 +1452,84 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Fails() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc24_5.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %C.ref.loc24: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc24_5.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc24_5.3: init %C = class_init (), %.loc24_5.2 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc24_5.4: ref %C = temporary %.loc24_5.2, %.loc24_5.3 -// CHECK:STDOUT: %.loc24_7: ref %C = converted %.loc24_5.1, %.loc24_5.4 -// CHECK:STDOUT: %A.ref.loc24_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc24_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc24: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc24_17.1: = bound_method %A.ref.loc24_15, %impl.elem0.loc24 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc24: = specific_function %impl.elem0.loc24, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc24_17.2: = bound_method %A.ref.loc24_15, %specific_fn.loc24 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc24: init type = call %bound_method.loc24_17.2(%A.ref.loc24_15, %A.ref.loc24_19) [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc24: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] -// CHECK:STDOUT: %.loc24_12: %A.type = converted %.loc24_7, [concrete = ] -// CHECK:STDOUT: %.loc32_6.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %C.ref.loc32_11: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc32_6.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc32_6.3: init %C = class_init (), %.loc32_6.2 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc32_6.4: ref %C = temporary %.loc32_6.2, %.loc32_6.3 -// CHECK:STDOUT: %.loc32_8: ref %C = converted %.loc32_6.1, %.loc32_6.4 -// CHECK:STDOUT: %C.ref.loc32_18: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc32_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc32_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc32_26: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc32_26.1: = bound_method %A.ref.loc32_24, %impl.elem0.loc32_26 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc32_26: = specific_function %impl.elem0.loc32_26, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc32_26.2: = bound_method %A.ref.loc32_24, %specific_fn.loc32_26 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc32_26: init type = call %bound_method.loc32_26.2(%A.ref.loc32_24, %A.ref.loc32_28) [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc32_29.1: type = value_of_initializer %type.and.loc32_26 [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc32_29.2: type = converted %type.and.loc32_26, %.loc32_29.1 [concrete = constants.%A.type] -// CHECK:STDOUT: %A.facet.loc32: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc32_20: %A.type = converted %C.ref.loc32_18, %A.facet.loc32 [concrete = constants.%A.facet] -// CHECK:STDOUT: %as_type.loc32: type = facet_access_type %.loc32_20 [concrete = constants.%C] -// CHECK:STDOUT: %.loc32_30: type = converted %.loc32_20, %as_type.loc32 [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc32_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc32_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc32_37: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc32_37.1: = bound_method %A.ref.loc32_35, %impl.elem0.loc32_37 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc32_37: = specific_function %impl.elem0.loc32_37, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc32_37.2: = bound_method %A.ref.loc32_35, %specific_fn.loc32_37 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc32_37: init type = call %bound_method.loc32_37.2(%A.ref.loc32_35, %A.ref.loc32_39) [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc32: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] -// CHECK:STDOUT: %.loc32_32: %A.type = converted %.loc32_8, [concrete = ] -// CHECK:STDOUT: %.loc40_6.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %C.ref.loc40_11: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc40_6.2: ref %C = temporary_storage -// CHECK:STDOUT: %.loc40_6.3: init %C = class_init (), %.loc40_6.2 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc40_6.4: ref %C = temporary %.loc40_6.2, %.loc40_6.3 -// CHECK:STDOUT: %.loc40_8: ref %C = converted %.loc40_6.1, %.loc40_6.4 -// CHECK:STDOUT: %C.ref.loc40_18: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc40_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc40_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc40: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc40_26.1: = bound_method %A.ref.loc40_24, %impl.elem0.loc40 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc40: = specific_function %impl.elem0.loc40, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc40_26.2: = bound_method %A.ref.loc40_24, %specific_fn.loc40 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc40: init type = call %bound_method.loc40_26.2(%A.ref.loc40_24, %A.ref.loc40_28) [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc40_29.1: type = value_of_initializer %type.and.loc40 [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc40_29.2: type = converted %type.and.loc40, %.loc40_29.1 [concrete = constants.%A.type] -// CHECK:STDOUT: %A.facet.loc40: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc40_20: %A.type = converted %C.ref.loc40_18, %A.facet.loc40 [concrete = constants.%A.facet] -// CHECK:STDOUT: %as_type.loc40: type = facet_access_type %.loc40_20 [concrete = constants.%C] -// CHECK:STDOUT: %.loc40_30: type = converted %.loc40_20, %as_type.loc40 [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc40_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc40: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] -// CHECK:STDOUT: %.loc40_32: %A.type = converted %.loc40_8, [concrete = ] +// CHECK:STDOUT: %.loc22_5.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %C.ref.loc22: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc22_5.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc22_5.3: init %C = class_init (), %.loc22_5.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc22_5.4: ref %C = temporary %.loc22_5.2, %.loc22_5.3 +// CHECK:STDOUT: %.loc22_7: ref %C = converted %.loc22_5.1, %.loc22_5.4 +// CHECK:STDOUT: %A.ref.loc22_15: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc22_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc22: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc22_17.1: = bound_method %A.ref.loc22_15, %impl.elem0.loc22 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc22: = specific_function %impl.elem0.loc22, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc22_17.2: = bound_method %A.ref.loc22_15, %specific_fn.loc22 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc22: init type = call %bound_method.loc22_17.2(%A.ref.loc22_15, %A.ref.loc22_19) [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc22: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] +// CHECK:STDOUT: %.loc22_12: %A.type = converted %.loc22_7, [concrete = ] +// CHECK:STDOUT: %.loc30_6.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %C.ref.loc30_11: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc30_6.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc30_6.3: init %C = class_init (), %.loc30_6.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc30_6.4: ref %C = temporary %.loc30_6.2, %.loc30_6.3 +// CHECK:STDOUT: %.loc30_8: ref %C = converted %.loc30_6.1, %.loc30_6.4 +// CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc30_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc30_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc30_26: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc30_26.1: = bound_method %A.ref.loc30_24, %impl.elem0.loc30_26 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc30_26: = specific_function %impl.elem0.loc30_26, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc30_26.2: = bound_method %A.ref.loc30_24, %specific_fn.loc30_26 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc30_26: init type = call %bound_method.loc30_26.2(%A.ref.loc30_24, %A.ref.loc30_28) [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc30_29.1: type = value_of_initializer %type.and.loc30_26 [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc30_29.2: type = converted %type.and.loc30_26, %.loc30_29.1 [concrete = constants.%A.type] +// CHECK:STDOUT: %A.facet.loc30: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] +// CHECK:STDOUT: %.loc30_20: %A.type = converted %C.ref.loc30_18, %A.facet.loc30 [concrete = constants.%A.facet] +// CHECK:STDOUT: %as_type.loc30: type = facet_access_type %.loc30_20 [concrete = constants.%C] +// CHECK:STDOUT: %.loc30_30: type = converted %.loc30_20, %as_type.loc30 [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc30_35: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc30_39: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc30_37: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc30_37.1: = bound_method %A.ref.loc30_35, %impl.elem0.loc30_37 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc30_37: = specific_function %impl.elem0.loc30_37, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc30_37.2: = bound_method %A.ref.loc30_35, %specific_fn.loc30_37 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc30_37: init type = call %bound_method.loc30_37.2(%A.ref.loc30_35, %A.ref.loc30_39) [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc30: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] +// CHECK:STDOUT: %.loc30_32: %A.type = converted %.loc30_8, [concrete = ] +// CHECK:STDOUT: %.loc38_6.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %C.ref.loc38_11: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc38_6.2: ref %C = temporary_storage +// CHECK:STDOUT: %.loc38_6.3: init %C = class_init (), %.loc38_6.2 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc38_6.4: ref %C = temporary %.loc38_6.2, %.loc38_6.3 +// CHECK:STDOUT: %.loc38_8: ref %C = converted %.loc38_6.1, %.loc38_6.4 +// CHECK:STDOUT: %C.ref.loc38_18: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc38_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc38_28: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc38: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc38_26.1: = bound_method %A.ref.loc38_24, %impl.elem0.loc38 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc38: = specific_function %impl.elem0.loc38, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc38_26.2: = bound_method %A.ref.loc38_24, %specific_fn.loc38 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc38: init type = call %bound_method.loc38_26.2(%A.ref.loc38_24, %A.ref.loc38_28) [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc38_29.1: type = value_of_initializer %type.and.loc38 [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc38_29.2: type = converted %type.and.loc38, %.loc38_29.1 [concrete = constants.%A.type] +// CHECK:STDOUT: %A.facet.loc38: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] +// CHECK:STDOUT: %.loc38_20: %A.type = converted %C.ref.loc38_18, %A.facet.loc38 [concrete = constants.%A.facet] +// CHECK:STDOUT: %as_type.loc38: type = facet_access_type %.loc38_20 [concrete = constants.%C] +// CHECK:STDOUT: %.loc38_30: type = converted %.loc38_20, %as_type.loc38 [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc38_34: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc38: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] +// CHECK:STDOUT: %.loc38_32: %A.type = converted %.loc38_8, [concrete = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)] // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.19f)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)](%other.param_patt: @Op.1.%Self.as_type (%Self.as_type.19f)) -> @Op.1.%Self.as_type (%Self.as_type.19f); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -1838,7 +1537,7 @@ fn Works() { // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)] // CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)] @@ -1962,18 +1661,18 @@ fn Works() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .BitAnd = %Core.BitAnd -// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//default, inst100 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//default, loc12_41, loaded [concrete = constants.%assoc0.a63] -// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//default, Op, loaded [concrete = constants.%Op.ab9] -// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//default, inst100 [no loc], loaded [symbolic = constants.%Self.25f] -// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//default, loc15_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//default, loc15_24, loaded [symbolic = @impl.f92.%T (constants.%T)] -// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//default, loc15_29, loaded [concrete = constants.%BitAnd.type] -// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//default, loc16_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc15_14, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.ad0 = import_ref Core//prelude, inst100 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.08d: %BitAnd.assoc_type = import_ref Core//prelude, loc18_41, loaded [concrete = constants.%assoc0.a63] +// CHECK:STDOUT: %Core.Op: %Op.type.27a = import_ref Core//prelude, Op, loaded [concrete = constants.%Op.ab9] +// CHECK:STDOUT: %Core.import_ref.040: %BitAnd.type = import_ref Core//prelude, inst100 [no loc], loaded [symbolic = constants.%Self.25f] +// CHECK:STDOUT: %Core.import_ref.51c: = import_ref Core//prelude, loc21_36, loaded [symbolic = @impl.f92.%impl_witness (constants.%impl_witness.b81)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.583: type = import_ref Core//prelude, loc21_24, loaded [symbolic = @impl.f92.%T (constants.%T)] +// CHECK:STDOUT: %Core.import_ref.9c1: type = import_ref Core//prelude, loc21_29, loaded [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %Core.import_ref.1e6: @impl.f92.%Op.type (%Op.type.f99) = import_ref Core//prelude, loc22_42, loaded [symbolic = @impl.f92.%Op (constants.%Op.05a)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//prelude, loc21_14, loaded [symbolic = @impl.f92.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -2005,7 +1704,7 @@ fn Works() { // CHECK:STDOUT: witness = (%G.decl) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @BitAnd [from "core.carbon"] { +// CHECK:STDOUT: interface @BitAnd [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = imports.%Core.import_ref.ad0 // CHECK:STDOUT: .Op = imports.%Core.import_ref.08d @@ -2020,7 +1719,7 @@ fn Works() { // CHECK:STDOUT: witness = file.%impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] { +// CHECK:STDOUT: generic impl @impl.f92(imports.%Core.import_ref.5ab3ec.1: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %impl_witness: = impl_witness (imports.%Core.import_ref.1e6), @impl.f92(%T) [symbolic = %impl_witness (constants.%impl_witness.db8)] @@ -2055,71 +1754,71 @@ fn Works() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Works() { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc13_7: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc13_11: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc13_9: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc13_9.1: = bound_method %A.ref.loc13_7, %impl.elem0.loc13_9 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc13: = specific_function %impl.elem0.loc13_9, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc13_9.2: = bound_method %A.ref.loc13_7, %specific_fn.loc13 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc13: init type = call %bound_method.loc13_9.2(%A.ref.loc13_7, %A.ref.loc13_11) [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc13: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] +// CHECK:STDOUT: %A.facet.loc13: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] +// CHECK:STDOUT: %.loc13: %A.type = converted %C.ref.loc13, %A.facet.loc13 [concrete = constants.%A.facet] +// CHECK:STDOUT: %as_wit.iface0.loc13: = facet_access_witness %.loc13, element0 [concrete = constants.%impl_witness.a7a] +// CHECK:STDOUT: %impl.elem0.loc13_4: %.db5 = impl_witness_access %as_wit.iface0.loc13, element0 [concrete = constants.%G.001] +// CHECK:STDOUT: %G.call.loc13: init %empty_tuple.type = call %impl.elem0.loc13_4() +// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %A.ref.loc14_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc14_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc14_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc14_12.1: = bound_method %A.ref.loc14_10, %impl.elem0.loc14_12 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc14_12: = specific_function %impl.elem0.loc14_12, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_12.2: = bound_method %A.ref.loc14_10, %specific_fn.loc14_12 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc14_12: init type = call %bound_method.loc14_12.2(%A.ref.loc14_10, %A.ref.loc14_14) [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %type.and.loc14_12 [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc14_15.2: type = converted %type.and.loc14_12, %.loc14_15.1 [concrete = constants.%A.type] +// CHECK:STDOUT: %A.facet.loc14: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] +// CHECK:STDOUT: %.loc14_6: %A.type = converted %C.ref.loc14, %A.facet.loc14 [concrete = constants.%A.facet] +// CHECK:STDOUT: %A.ref.loc14_20: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc14_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc14_22: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc14_22.1: = bound_method %A.ref.loc14_20, %impl.elem0.loc14_22 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc14_22: = specific_function %impl.elem0.loc14_22, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc14_22.2: = bound_method %A.ref.loc14_20, %specific_fn.loc14_22 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc14_22: init type = call %bound_method.loc14_22.2(%A.ref.loc14_20, %A.ref.loc14_24) [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc14: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] +// CHECK:STDOUT: %as_wit.iface0.loc14: = facet_access_witness %.loc14_6, element0 [concrete = constants.%impl_witness.a7a] +// CHECK:STDOUT: %impl.elem0.loc14_17: %.db5 = impl_witness_access %as_wit.iface0.loc14, element0 [concrete = constants.%G.001] +// CHECK:STDOUT: %G.call.loc14: init %empty_tuple.type = call %impl.elem0.loc14_17() // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc15_7: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc15_11: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc15_9: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc15_9.1: = bound_method %A.ref.loc15_7, %impl.elem0.loc15_9 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15_9, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc15_9.2: = bound_method %A.ref.loc15_7, %specific_fn.loc15 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc15: init type = call %bound_method.loc15_9.2(%A.ref.loc15_7, %A.ref.loc15_11) [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc15: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] +// CHECK:STDOUT: %A.ref.loc15_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %A.ref.loc15_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %impl.elem0.loc15_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] +// CHECK:STDOUT: %bound_method.loc15_12.1: = bound_method %A.ref.loc15_10, %impl.elem0.loc15_12 [concrete = constants.%Op.bound] +// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15_12, @Op.2(type) [concrete = constants.%Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_12.2: = bound_method %A.ref.loc15_10, %specific_fn.loc15 [concrete = constants.%bound_method] +// CHECK:STDOUT: %type.and.loc15: init type = call %bound_method.loc15_12.2(%A.ref.loc15_10, %A.ref.loc15_14) [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %type.and.loc15 [concrete = constants.%A.type] +// CHECK:STDOUT: %.loc15_15.2: type = converted %type.and.loc15, %.loc15_15.1 [concrete = constants.%A.type] // CHECK:STDOUT: %A.facet.loc15: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc15: %A.type = converted %C.ref.loc15, %A.facet.loc15 [concrete = constants.%A.facet] -// CHECK:STDOUT: %as_wit.iface0.loc15: = facet_access_witness %.loc15, element0 [concrete = constants.%impl_witness.a7a] -// CHECK:STDOUT: %impl.elem0.loc15_4: %.db5 = impl_witness_access %as_wit.iface0.loc15, element0 [concrete = constants.%G.001] -// CHECK:STDOUT: %G.call.loc15: init %empty_tuple.type = call %impl.elem0.loc15_4() -// CHECK:STDOUT: %C.ref.loc16: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc16_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc16_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc16_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc16_12.1: = bound_method %A.ref.loc16_10, %impl.elem0.loc16_12 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc16_12: = specific_function %impl.elem0.loc16_12, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_12.2: = bound_method %A.ref.loc16_10, %specific_fn.loc16_12 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc16_12: init type = call %bound_method.loc16_12.2(%A.ref.loc16_10, %A.ref.loc16_14) [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc16_15.1: type = value_of_initializer %type.and.loc16_12 [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc16_15.2: type = converted %type.and.loc16_12, %.loc16_15.1 [concrete = constants.%A.type] -// CHECK:STDOUT: %A.facet.loc16: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc16_6: %A.type = converted %C.ref.loc16, %A.facet.loc16 [concrete = constants.%A.facet] -// CHECK:STDOUT: %A.ref.loc16_20: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc16_24: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc16_22: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc16_22.1: = bound_method %A.ref.loc16_20, %impl.elem0.loc16_22 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc16_22: = specific_function %impl.elem0.loc16_22, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc16_22.2: = bound_method %A.ref.loc16_20, %specific_fn.loc16_22 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc16_22: init type = call %bound_method.loc16_22.2(%A.ref.loc16_20, %A.ref.loc16_24) [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc16: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] -// CHECK:STDOUT: %as_wit.iface0.loc16: = facet_access_witness %.loc16_6, element0 [concrete = constants.%impl_witness.a7a] -// CHECK:STDOUT: %impl.elem0.loc16_17: %.db5 = impl_witness_access %as_wit.iface0.loc16, element0 [concrete = constants.%G.001] -// CHECK:STDOUT: %G.call.loc16: init %empty_tuple.type = call %impl.elem0.loc16_17() -// CHECK:STDOUT: %C.ref.loc17: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %A.ref.loc17_10: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %A.ref.loc17_14: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %impl.elem0.loc17_12: %.2ac = impl_witness_access constants.%impl_witness.3ea, element0 [concrete = constants.%Op.444] -// CHECK:STDOUT: %bound_method.loc17_12.1: = bound_method %A.ref.loc17_10, %impl.elem0.loc17_12 [concrete = constants.%Op.bound] -// CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17_12, @Op.2(type) [concrete = constants.%Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc17_12.2: = bound_method %A.ref.loc17_10, %specific_fn.loc17 [concrete = constants.%bound_method] -// CHECK:STDOUT: %type.and.loc17: init type = call %bound_method.loc17_12.2(%A.ref.loc17_10, %A.ref.loc17_14) [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc17_15.1: type = value_of_initializer %type.and.loc17 [concrete = constants.%A.type] -// CHECK:STDOUT: %.loc17_15.2: type = converted %type.and.loc17, %.loc17_15.1 [concrete = constants.%A.type] -// CHECK:STDOUT: %A.facet.loc17: %A.type = facet_value constants.%C, (constants.%impl_witness.a7a) [concrete = constants.%A.facet] -// CHECK:STDOUT: %.loc17_6: %A.type = converted %C.ref.loc17, %A.facet.loc17 [concrete = constants.%A.facet] -// CHECK:STDOUT: %A.ref.loc17_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] -// CHECK:STDOUT: %G.ref.loc17: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] -// CHECK:STDOUT: %as_wit.iface0.loc17: = facet_access_witness %.loc17_6, element0 [concrete = constants.%impl_witness.a7a] -// CHECK:STDOUT: %impl.elem0.loc17_17: %.db5 = impl_witness_access %as_wit.iface0.loc17, element0 [concrete = constants.%G.001] -// CHECK:STDOUT: %G.call.loc17: init %empty_tuple.type = call %impl.elem0.loc17_17() +// CHECK:STDOUT: %.loc15_6: %A.type = converted %C.ref.loc15, %A.facet.loc15 [concrete = constants.%A.facet] +// CHECK:STDOUT: %A.ref.loc15_19: type = name_ref A, file.%A.decl [concrete = constants.%A.type] +// CHECK:STDOUT: %G.ref.loc15: %A.assoc_type = name_ref G, @A.%assoc0 [concrete = constants.%assoc0.773] +// CHECK:STDOUT: %as_wit.iface0.loc15: = facet_access_witness %.loc15_6, element0 [concrete = constants.%impl_witness.a7a] +// CHECK:STDOUT: %impl.elem0.loc15_17: %.db5 = impl_witness_access %as_wit.iface0.loc15, element0 [concrete = constants.%G.001] +// CHECK:STDOUT: %G.call.loc15: init %empty_tuple.type = call %impl.elem0.loc15_17() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.1(imports.%Core.import_ref.040: %BitAnd.type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.25f)] // 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(imports.%Core.import_ref.5ab3ec.2: type) [from "core.carbon"] { +// CHECK:STDOUT: generic fn @Op.2(imports.%Core.import_ref.5ab3ec.2: type) [from "toolchain/testing/min_prelude/facet_types.carbon"] { // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -2165,3 +1864,314 @@ fn Works() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: --- toolchain/testing/min_prelude/facet_types.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic] +// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic] +// CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete] +// CHECK:STDOUT: %As.type.8ba: type = facet_type <@As, @As(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.b4e: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Self.as_type.7f0: type = facet_access_type %Self.b4e [symbolic] +// CHECK:STDOUT: %Convert.type.ad1: type = fn_type @Convert.1, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.0ed: %Convert.type.ad1 = struct_value () [symbolic] +// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type %As.type.8ba [symbolic] +// CHECK:STDOUT: %assoc0.ac5: %As.assoc_type = assoc_entity element0, @As.%Convert.decl [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.07f: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic] +// CHECK:STDOUT: %Self.0f3: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Self.as_type.419: type = facet_access_type %Self.0f3 [symbolic] +// CHECK:STDOUT: %Convert.type.4cf: type = fn_type @Convert.2, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Convert.147: %Convert.type.4cf = struct_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type %ImplicitAs.type.07f [symbolic] +// CHECK:STDOUT: %assoc0.a50: %ImplicitAs.assoc_type = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic] +// CHECK:STDOUT: %BitAnd.type: type = facet_type <@BitAnd> [concrete] +// CHECK:STDOUT: %Self.e44: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Self.as_type.560: type = facet_access_type %Self.e44 [symbolic] +// CHECK:STDOUT: %Op.type.613: type = fn_type @Op.1 [concrete] +// CHECK:STDOUT: %Op.d98: %Op.type.613 = struct_value () [concrete] +// CHECK:STDOUT: %BitAnd.assoc_type: type = assoc_entity_type %BitAnd.type [concrete] +// CHECK:STDOUT: %assoc0.121: %BitAnd.assoc_type = assoc_entity element0, @BitAnd.%Op.decl [concrete] +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic] +// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic] +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(%T) [symbolic] +// CHECK:STDOUT: %Op.type.28d: type = fn_type @Op.2, @impl(%T) [symbolic] +// CHECK:STDOUT: %Op.902: %Op.type.28d = struct_value () [symbolic] +// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %BitAnd.facet: %BitAnd.type = facet_value %T, (%impl_witness) [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .As = %As.decl +// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl +// CHECK:STDOUT: .BitAnd = %BitAnd.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] { +// CHECK:STDOUT: %Dest.patt.loc9_14.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.loc9_14.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] { +// CHECK:STDOUT: %Dest.patt.loc13_22.1: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.loc13_22.1: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [concrete = constants.%BitAnd.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] { +// CHECK:STDOUT: %T.patt.loc21_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc21_14.1 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, file.%BitAnd.decl [concrete = constants.%BitAnd.type] +// CHECK:STDOUT: %T.loc21_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl_witness: = impl_witness (@impl.%Op.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @As(%Dest.loc9_14.1: type) { +// CHECK:STDOUT: %Dest.loc9_14.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc9_14.2 (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt.loc9_14.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc9_14.2 (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest.loc9_14.2)> [symbolic = %As.type (constants.%As.type.8ba)] +// CHECK:STDOUT: %Self.2: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest.loc9_14.2) [symbolic = %Convert.type (constants.%Convert.type.ad1)] +// CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.ad1) = struct_value () [symbolic = %Convert (constants.%Convert.0ed)] +// CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As.%As.type (%As.type.8ba) [symbolic = %As.assoc_type (constants.%As.assoc_type)] +// CHECK:STDOUT: %assoc0.loc10_35.2: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.ac5)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.8ba) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.b4e)] +// CHECK:STDOUT: %Convert.decl: @As.%Convert.type (%Convert.type.ad1) = fn_decl @Convert.1 [symbolic = @As.%Convert (constants.%Convert.0ed)] { +// CHECK:STDOUT: %self.patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %return.patt: @Convert.1.%Dest (%Dest) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Convert.1.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @As.%Dest.loc9_14.1 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %self.param: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = value_param call_param0 +// CHECK:STDOUT: %.loc10_20.1: type = splice_block %.loc10_20.3 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] { +// CHECK:STDOUT: %.loc10_20.2: @Convert.1.%As.type (%As.type.8ba) = specific_constant @As.%Self.1, @As(constants.%Dest) [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.ref: @Convert.1.%As.type (%As.type.8ba) = name_ref Self, %.loc10_20.2 [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.as_type.loc10_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: %.loc10_20.3: type = converted %Self.ref, %Self.as_type.loc10_20.2 [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Convert.1.%Dest (%Dest) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Convert.1.%Dest (%Dest) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0.loc10_35.1: @As.%As.assoc_type (%As.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc10_35.2 (constants.%assoc0.ac5)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .Dest = +// CHECK:STDOUT: .Convert = %assoc0.loc10_35.1 +// CHECK:STDOUT: witness = (%Convert.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @ImplicitAs(%Dest.loc13_22.1: type) { +// CHECK:STDOUT: %Dest.loc13_22.2: type = bind_symbolic_name Dest, 0 [symbolic = %Dest.loc13_22.2 (constants.%Dest)] +// CHECK:STDOUT: %Dest.patt.loc13_22.2: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt.loc13_22.2 (constants.%Dest.patt)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest.loc13_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] +// CHECK:STDOUT: %Self.2: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] +// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @ImplicitAs(%Dest.loc13_22.2) [symbolic = %Convert.type (constants.%Convert.type.4cf)] +// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.4cf) = struct_value () [symbolic = %Convert (constants.%Convert.147)] +// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type)] +// CHECK:STDOUT: %assoc0.loc14_35.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.a50)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f3)] +// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.4cf) = fn_decl @Convert.2 [symbolic = @ImplicitAs.%Convert (constants.%Convert.147)] { +// CHECK:STDOUT: %self.patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %return.patt: @Convert.2.%Dest (%Dest) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Convert.2.%Dest (%Dest) = out_param_pattern %return.patt, call_param1 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc13_22.1 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %self.param: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = value_param call_param0 +// CHECK:STDOUT: %.loc14_20.1: type = splice_block %.loc14_20.3 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] { +// CHECK:STDOUT: %.loc14_20.2: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%Dest) [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.ref: @Convert.2.%ImplicitAs.type (%ImplicitAs.type.07f) = name_ref Self, %.loc14_20.2 [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.as_type.loc14_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: %.loc14_20.3: type = converted %Self.ref, %Self.as_type.loc14_20.2 [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419) = bind_name self, %self.param +// CHECK:STDOUT: %return.param: ref @Convert.2.%Dest (%Dest) = out_param call_param1 +// CHECK:STDOUT: %return: ref @Convert.2.%Dest (%Dest) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0.loc14_35.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type) = assoc_entity element0, %Convert.decl [symbolic = %assoc0.loc14_35.2 (constants.%assoc0.a50)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .Dest = +// CHECK:STDOUT: .Convert = %assoc0.loc14_35.1 +// CHECK:STDOUT: witness = (%Convert.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @BitAnd { +// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.e44] +// CHECK:STDOUT: %Op.decl: %Op.type.613 = fn_decl @Op.1 [concrete = constants.%Op.d98] { +// CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param_pattern %other.patt, call_param1 +// CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param_pattern %return.patt, call_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc18_37: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_37: type = facet_access_type %Self.ref.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_37: type = converted %Self.ref.loc18_37, %Self.as_type.loc18_37 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param0 +// CHECK:STDOUT: %.loc18_15.1: type = splice_block %.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] { +// CHECK:STDOUT: %Self.ref.loc18_15: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_15.2: type = facet_access_type %Self.ref.loc18_15 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_15.2: type = converted %Self.ref.loc18_15, %Self.as_type.loc18_15.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = value_param call_param1 +// CHECK:STDOUT: %.loc18_28.1: type = splice_block %.loc18_28.2 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] { +// CHECK:STDOUT: %Self.ref.loc18_28: %BitAnd.type = name_ref Self, @BitAnd.%Self [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_28: type = facet_access_type %Self.ref.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: %.loc18_28.2: type = converted %Self.ref.loc18_28, %Self.as_type.loc18_28 [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = out_param call_param2 +// CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %assoc0: %BitAnd.assoc_type = assoc_entity element0, %Op.decl [concrete = constants.%assoc0.121] +// 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(%T.loc21_14.1: type) { +// CHECK:STDOUT: %T.loc21_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_14.2 (constants.%T)] +// CHECK:STDOUT: %T.patt.loc21_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_14.2 (constants.%T.patt)] +// CHECK:STDOUT: %impl_witness: = impl_witness (%Op.decl), @impl(%T.loc21_14.2) [symbolic = %impl_witness (constants.%impl_witness)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%T.loc21_14.2) [symbolic = %Op.type (constants.%Op.type.28d)] +// CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.28d) = struct_value () [symbolic = %Op (constants.%Op.902)] +// CHECK:STDOUT: %require_complete: = require_complete_type @impl.%T.loc21_14.2 (%T) [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: +// CHECK:STDOUT: impl: %T.ref as %BitAnd.ref { +// CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.28d) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.902)] { +// CHECK:STDOUT: %self.patt: @Op.2.%T (%T) = binding_pattern self +// CHECK:STDOUT: %self.param_patt: @Op.2.%T (%T) = value_param_pattern %self.patt, call_param0 +// CHECK:STDOUT: %other.patt: @Op.2.%T (%T) = binding_pattern other +// CHECK:STDOUT: %other.param_patt: @Op.2.%T (%T) = value_param_pattern %other.patt, call_param1 +// CHECK:STDOUT: %return.patt: @Op.2.%T (%T) = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: @Op.2.%T (%T) = out_param_pattern %return.patt, call_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %Self.ref.loc22_37: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %self.param: @Op.2.%T (%T) = value_param call_param0 +// CHECK:STDOUT: %Self.ref.loc22_15: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %self: @Op.2.%T (%T) = bind_name self, %self.param +// CHECK:STDOUT: %other.param: @Op.2.%T (%T) = value_param call_param1 +// CHECK:STDOUT: %Self.ref.loc22_28: type = name_ref Self, @impl.%T.ref [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %other: @Op.2.%T (%T) = bind_name other, %other.param +// CHECK:STDOUT: %return.param: ref @Op.2.%T (%T) = out_param call_param2 +// CHECK:STDOUT: %return: ref @Op.2.%T (%T) = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Op = %Op.decl +// CHECK:STDOUT: witness = file.%impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.1(@As.%Dest.loc9_14.1: type, @As.%Self.1: @As.%As.type (%As.type.8ba)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.8ba)] +// CHECK:STDOUT: %Self: %As.type.8ba = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.b4e)] +// CHECK:STDOUT: %Self.as_type.loc10_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc10_20.1 (constants.%Self.as_type.7f0)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self.as_type.loc10_20.1 (%Self.as_type.7f0)]() -> @Convert.1.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Convert.2(@ImplicitAs.%Dest.loc13_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.07f)) { +// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.07f)] +// CHECK:STDOUT: %Self: %ImplicitAs.type.07f = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.0f3)] +// CHECK:STDOUT: %Self.as_type.loc14_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_20.1 (constants.%Self.as_type.419)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Convert.2.%Self.as_type.loc14_20.1 (%Self.as_type.419)]() -> @Convert.2.%Dest (%Dest); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.1(@BitAnd.%Self: %BitAnd.type) { +// CHECK:STDOUT: %Self: %BitAnd.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.e44)] +// CHECK:STDOUT: %Self.as_type.loc18_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc18_15.1 (constants.%Self.as_type.560)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)](%other.param_patt: @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560)) -> @Op.1.%Self.as_type.loc18_15.1 (%Self.as_type.560); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Op.2(@impl.%T.loc21_14.1: type) { +// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%T (%T)](%other.param_patt: @Op.2.%T (%T)) -> @Op.2.%T (%T) = "type.and"; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(constants.%Dest) { +// CHECK:STDOUT: %Dest.loc9_14.2 => constants.%Dest +// CHECK:STDOUT: %Dest.patt.loc9_14.2 => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.b4e) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %As.type => constants.%As.type.8ba +// CHECK:STDOUT: %Self => constants.%Self.b4e +// CHECK:STDOUT: %Self.as_type.loc10_20.1 => constants.%Self.as_type.7f0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(@Convert.1.%Dest) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @As(%Dest.loc9_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { +// CHECK:STDOUT: %Dest.loc13_22.2 => constants.%Dest +// CHECK:STDOUT: %Dest.patt.loc13_22.2 => constants.%Dest +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Convert.2(constants.%Dest, constants.%Self.0f3) { +// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.07f +// CHECK:STDOUT: %Self => constants.%Self.0f3 +// CHECK:STDOUT: %Self.as_type.loc14_20.1 => constants.%Self.as_type.419 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(@Convert.2.%Dest) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @ImplicitAs(%Dest.loc13_22.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%Self.e44) { +// CHECK:STDOUT: %Self => constants.%Self.e44 +// CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%Self.as_type.560 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(constants.%T) { +// CHECK:STDOUT: %T.loc21_14.2 => constants.%T +// CHECK:STDOUT: %T.patt.loc21_14.2 => constants.%T +// CHECK:STDOUT: %impl_witness => constants.%impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @impl(%T.loc21_14.2) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.2(constants.%T) { +// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Op.1(constants.%BitAnd.facet) { +// CHECK:STDOUT: %Self => constants.%BitAnd.facet +// CHECK:STDOUT: %Self.as_type.loc18_15.1 => constants.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/docs/adding_features.md b/toolchain/docs/adding_features.md index e3cae3d4211c..787f4e94bf1c 100644 --- a/toolchain/docs/adding_features.md +++ b/toolchain/docs/adding_features.md @@ -21,6 +21,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - [Running tests](#running-tests) - [Updating tests](#updating-tests) - [Reviewing test deltas](#reviewing-test-deltas) + - [Minimal Core prelude](#minimal-core-prelude) - [Verbose output](#verbose-output) - [Stack traces](#stack-traces) - [Dumping objects in interactive debuggers](#dumping-objects-in-interactive-debuggers) @@ -487,6 +488,28 @@ Using `autoupdate_testdata.py` can be useful to produce deltas during the development process because it allows `git status` and `git diff` to be used to examine what changed. +### Minimal Core prelude + +For most file tests in `check/`, very little of the `Core` package is used, and +the test is not intentionally testing the `Core` package itself. Compiling the +entire `Core` package adds a lot of noise during interactive debugging, which +can be avoided by using a minimal prelude. + +To replace the production `Core` package with a minimal one, add the path to a +minimal `Core` package and `prelude` library to the file test with the +`INCLUDE-FILE` directive, and tell the toolchain to avoid loading the production +`Core` package by adding `--custom-core` to the `EXTRA-ARGS` directive, for +example: + +``` +// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon +// EXTRA-ARGS: --custom-core +``` + +We have a set of minimal `Core` preludes for testing different compiler feature +areas in `//toolchain/testing/min_prelude/`. Each file begins with the line +`package Core library "prelude";` to make it provide a prelude. + ### Verbose output The `-v` flag can be passed to trace state, and should be specified before the diff --git a/toolchain/driver/compile_subcommand.cpp b/toolchain/driver/compile_subcommand.cpp index de9909854b1e..871214caf411 100644 --- a/toolchain/driver/compile_subcommand.cpp +++ b/toolchain/driver/compile_subcommand.cpp @@ -227,6 +227,23 @@ Whether to use the implicit prelude import. Enabled by default. arg_b.Default(true); arg_b.Set(&prelude_import); }); + b.AddFlag( + { + .name = "custom-core", + .value_name = "CUSTOM_CORE", + .help = R"""( +Whether to use a custom Core package, the files for which must all be included +in the compile command line. + +The prelude library in the Core package is imported automatically. By default, +the Core package shipped with the toolchain is used, and its files do not need +to be specified in the compile command line. +)""", + }, + [&](auto& arg_b) { + arg_b.Default(false); + arg_b.Set(&custom_core); + }); b.AddStringOption( { .name = "exclude-dump-file-prefix", @@ -739,7 +756,7 @@ auto CompileSubcommand::Run(DriverEnv& driver_env) -> DriverResult { // TODO: Replace this with a search for library api files in a // package-specific search path based on the library name. llvm::SmallVector prelude; - if (options_.prelude_import && + if (options_.prelude_import && !options_.custom_core && options_.phase >= CompileOptions::Phase::Check) { if (auto find = driver_env.installation->ReadPreludeManifest(); find.ok()) { prelude = std::move(*find); diff --git a/toolchain/driver/compile_subcommand.h b/toolchain/driver/compile_subcommand.h index b51469c753c9..7344881d0293 100644 --- a/toolchain/driver/compile_subcommand.h +++ b/toolchain/driver/compile_subcommand.h @@ -42,6 +42,7 @@ struct CompileOptions { bool asm_output = false; bool force_obj_output = false; + bool custom_core = false; bool dump_shared_values = false; bool dump_tokens = false; bool omit_file_boundary_tokens = false; diff --git a/toolchain/testing/BUILD b/toolchain/testing/BUILD index 50ecc2049ed9..1a6cca2b3c04 100644 --- a/toolchain/testing/BUILD +++ b/toolchain/testing/BUILD @@ -22,6 +22,13 @@ filegroup( ], ) +filegroup( + name = "minimal_preludes", + data = [ + "//toolchain/testing/min_prelude", + ], +) + cc_library( name = "compile_helper", testonly = 1, @@ -54,10 +61,12 @@ file_test( size = "small", timeout = "moderate", # Taking >60 seconds in GitHub actions srcs = ["file_test.cpp"], + data = [":minimal_preludes"], tests = [":all_testdata"], deps = [ "//common:all_llvm_targets", "//common:error", + "//testing/file_test:file_system", "//testing/file_test:file_test_base", "//toolchain/driver", "@llvm-project//llvm:Support", diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index bfc5316fc370..85f7c63298ba 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -5,6 +5,8 @@ #ifndef CARBON_TOOLCHAIN_DRIVER_DRIVER_FILE_TEST_BASE_H_ #define CARBON_TOOLCHAIN_DRIVER_DRIVER_FILE_TEST_BASE_H_ +#include +#include #include #include "common/error.h" @@ -13,6 +15,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/VirtualFileSystem.h" +#include "testing/file_test/file_system.h" #include "testing/file_test/file_test_base.h" #include "toolchain/driver/driver.h" @@ -58,10 +61,6 @@ class ToolchainFileTest : public FileTestBase { } private: - // Adds a file to the fs. - auto AddFile(llvm::vfs::InMemoryFileSystem& fs, llvm::StringRef path) const - -> ErrorOr; - // Controls whether `Run()` includes the prelude. auto is_no_prelude() const -> bool { return test_name().find("/no_prelude/") != llvm::StringRef::npos; @@ -222,21 +221,6 @@ auto ToolchainFileTest::DoExtraCheckReplacements(std::string& check_line) const } } -auto ToolchainFileTest::AddFile(llvm::vfs::InMemoryFileSystem& fs, - llvm::StringRef path) const - -> ErrorOr { - llvm::ErrorOr> file = - llvm::MemoryBuffer::getFile(path); - if (file.getError()) { - return ErrorBuilder() << "Getting `" << path - << "`: " << file.getError().message(); - } - if (!fs.addFile(path, /*ModificationTime=*/0, std::move(*file))) { - return ErrorBuilder() << "Duplicate file: `" << path << "`"; - } - return Success(); -} - } // namespace Carbon::Testing #endif // CARBON_TOOLCHAIN_DRIVER_DRIVER_FILE_TEST_BASE_H_ diff --git a/toolchain/testing/min_prelude/BUILD b/toolchain/testing/min_prelude/BUILD new file mode 100644 index 000000000000..8958e525f82e --- /dev/null +++ b/toolchain/testing/min_prelude/BUILD @@ -0,0 +1,9 @@ +# 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 + +filegroup( + name = "min_prelude", + srcs = glob(["**/*.carbon"]), + visibility = ["//visibility:public"], +) diff --git a/toolchain/testing/min_prelude/facet_types.carbon b/toolchain/testing/min_prelude/facet_types.carbon new file mode 100644 index 000000000000..6e37b335b2d5 --- /dev/null +++ b/toolchain/testing/min_prelude/facet_types.carbon @@ -0,0 +1,23 @@ +// 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 + +// A minimal prelude for testing facet types, their use as generic types, and +// conversions to and from them. +package Core library "prelude"; + +interface As(Dest:! type) { + fn Convert[self: Self]() -> Dest; +} + +interface ImplicitAs(Dest:! type) { + fn Convert[self: Self]() -> Dest; +} + +interface BitAnd { + fn Op[self: Self](other: Self) -> Self; +} + +impl forall [T:! type] T as BitAnd { + fn Op[self: Self](other: Self) -> Self = "type.and"; +}