diff --git a/toolchain/check/cpp/impl_lookup.cpp b/toolchain/check/cpp/impl_lookup.cpp index 7da70ba8b03b..a21d75c8bb61 100644 --- a/toolchain/check/cpp/impl_lookup.cpp +++ b/toolchain/check/cpp/impl_lookup.cpp @@ -19,6 +19,7 @@ #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" #include "toolchain/sem_ir/builtin_function_kind.h" +#include "toolchain/sem_ir/core_interface.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/typed_insts.h" @@ -301,6 +302,57 @@ static auto BuildCppBinaryOperatorWitness( query_specific_interface_id, {fn_id}); } +static auto BuildCppComparisonWitness( + Context& context, SemIR::LocId loc_id, CoreIdentifier interface, + llvm::ArrayRef operator_names, + SemIR::ConstantId query_self_const_id, + SemIR::SpecificInterfaceId query_specific_interface_id) -> SemIR::InstId { + auto self_type_id = + context.types().GetTypeIdForTypeConstantId(query_self_const_id); + auto args = + context.inst_blocks().Get(context.specifics() + .Get(context.specific_interfaces() + .Get(query_specific_interface_id) + .specific_id) + .args_id); + CARBON_CHECK(args.size() == 1, "Binary operator missing an argument"); + + auto arg_type_id = context.types().GetTypeIdForTypeInstId(args[0]); + auto operators = llvm::SmallVector(); + for (auto operator_name : operator_names) { + auto lookup_id = LookupCppOperator( + context, loc_id, + {.interface_name = interface, .op_name = operator_name}, + {self_type_id, arg_type_id}); + if (lookup_id == SemIR::ErrorInst::InstId || + lookup_id == SemIR::InstId::None) { + // `T.(Core.EqWith(U))` is only valid if both `t == u` and `t != u` are + // valid expressions. Looking for `t != u` is pointless if we're unable to + // find a valid `t == u`, because `t != u` won't provide further useful + // information at this point. + // + // The behavior is dependent on which expression is checked first: no + // diagnostic will be emitted for an erroneous `operator!=` if lookup for + // `operator==` produces `SemIR::InstId::None`. + return lookup_id; + } + + auto return_type_id = context.functions() + .Get(context.insts() + .GetAs(lookup_id) + .function_id) + .return_type_inst_id; + if (!return_type_id.has_value()) { + return SemIR::InstId::None; + } + + operators.push_back(lookup_id); + } + + return BuildCustomWitness(context, loc_id, query_self_const_id, + query_specific_interface_id, operators); +} + auto LookupCppImpl(Context& context, SemIR::LocId loc_id, SemIR::CoreInterface core_interface, SemIR::ConstantId query_self_const_id, @@ -341,6 +393,17 @@ auto LookupCppImpl(Context& context, SemIR::LocId loc_id, /*has_associated_result_type=*/false, query_self_const_id, query_specific_interface_id); + case SemIR::CoreInterface::EqWith: + return BuildCppComparisonWitness( + context, loc_id, CoreIdentifier::EqWith, + {CoreIdentifier::Equal, CoreIdentifier::NotEqual}, + query_self_const_id, query_specific_interface_id); + case SemIR::CoreInterface::OrderedWith: + return BuildCppComparisonWitness( + context, loc_id, CoreIdentifier::OrderedWith, + {CoreIdentifier::Less, CoreIdentifier::LessOrEquivalent, + CoreIdentifier::Greater, CoreIdentifier::GreaterOrEquivalent}, + query_self_const_id, query_specific_interface_id); case SemIR::CoreInterface::Copy: return BuildCopyWitness(context, loc_id, query_self_const_id, query_specific_interface_id); diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 510a784c662a..5a35af39e21a 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -709,12 +709,14 @@ auto LookupCustomWitness(Context& context, SemIR::LocId loc_id, case SemIR::CoreInterface::Default: case SemIR::CoreInterface::DivAssignWith: case SemIR::CoreInterface::DivWith: + case SemIR::CoreInterface::EqWith: case SemIR::CoreInterface::Inc: case SemIR::CoreInterface::ModAssignWith: case SemIR::CoreInterface::ModWith: case SemIR::CoreInterface::MulAssignWith: case SemIR::CoreInterface::MulWith: case SemIR::CoreInterface::Negate: + case SemIR::CoreInterface::OrderedWith: case SemIR::CoreInterface::SubAssignWith: case SemIR::CoreInterface::SubWith: case SemIR::CoreInterface::Unknown: diff --git a/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon b/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon new file mode 100644 index 000000000000..ecfd34584334 --- /dev/null +++ b/toolchain/check/testdata/interop/cpp/operators/eq_with.carbon @@ -0,0 +1,833 @@ +// 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: toolchain/testing/testdata/min_prelude/full.carbon +// EXTRA-ARGS: --target=x86_64-linux-gnu --clang-arg=-std=c++20 +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/operators/eq_with.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/operators/eq_with.carbon + +// --- returns_bool.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct EqualityComparable { + auto operator==(EqualityComparable const&) const -> bool; + auto operator!=(EqualityComparable const&) const -> bool; +}; +'''; + +fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + //@dump-sem-ir-begin + x == y; + x != y; + //@dump-sem-ir-end +} + +fn Test(equality_comparable: Cpp.EqualityComparable) { + EqWith(equality_comparable, equality_comparable); +} + +// --- cross_type_equality.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct B1; +struct A1 { + auto operator==(B1) const -> bool; + auto operator!=(B1) const -> bool; +}; +struct B1 { + auto operator==(A1) const -> bool; + auto operator!=(A1) const -> bool; +}; + +struct B2; +struct A2 { +}; +struct B2 { + auto operator==(A2) const -> bool; + auto operator!=(A2) const -> bool; +}; + +struct B3; +struct A3 { + auto operator==(B3) const -> bool; + friend auto operator==(B3, A3) -> bool; +}; +struct B3 { + auto operator!=(A3) const -> bool; + friend auto operator!=(A3, B3) -> bool; +}; +'''; + +fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + //@dump-sem-ir-begin + x == y; + x != y; + //@dump-sem-ir-end +} + +fn Test(a1: Cpp.A1, b1: Cpp.B1, + a2: Cpp.A2, b2: Cpp.B2, + a3: Cpp.A3, b3: Cpp.B3) { + EqWith(a1, b1); + EqWith(b1, a1); + + EqWith(b2, a2); + + EqWith(a3, b3); + EqWith(b3, a3); +} + +// --- fail_todo_returns_boolish.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct NeqBoolish { + auto operator==(NeqBoolish) const -> bool; + // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+9]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure] + // CHECK:STDERR: auto operator!=(NeqBoolish) const -> int; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: auto operator!=(NeqBoolish) const -> int; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:20:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn NotEqual[self: Self](other: Other) -> bool; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + auto operator!=(NeqBoolish) const -> int; +}; + +struct EqBoolish { + auto operator==(EqBoolish) const -> int*; + auto operator!=(EqBoolish) const -> bool; +}; + +struct BothBoolish { + enum Result { + False, + True, + }; + auto operator==(BothBoolish) const -> Result; + auto operator!=(BothBoolish) const -> Result; +}; +'''; + +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-18]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator==(EqBoolish) const -> int*; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-21]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator==(EqBoolish) const -> int*; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:19:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn Equal[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-22]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator==(BothBoolish) const -> Result; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-25]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator==(BothBoolish) const -> Result; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:19:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn Equal[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-34]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator!=(BothBoolish) const -> Result; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-37]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator!=(BothBoolish) const -> Result; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:20:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn NotEqual[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + x == y; + x != y; +} + +fn Test(neq_boolish: Cpp.NeqBoolish, + eq_boolish: Cpp.EqBoolish, + both_boolish: Cpp.BothBoolish) { + EqWith(neq_boolish, neq_boolish); + + EqWith(eq_boolish, eq_boolish); + + EqWith(both_boolish, both_boolish); +} + +// --- fail_todo_comparison_rewrites.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct DefaultEqOnly { +public: + auto operator==(const DefaultEqOnly&) const -> bool = default; +}; + +struct OnlyEqDeclared { +public: + auto operator==(OnlyEqDeclared) const -> bool; +}; +'''; + +fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + x == y; + x != y; +} + +fn Test(default_eq_only: Cpp.DefaultEqOnly, + // CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+4]]:33: error: member name `DefaultSpaceshipOnly` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: default_spaceship_only: Cpp.DefaultSpaceshipOnly, + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + default_spaceship_only: Cpp.DefaultSpaceshipOnly, + only_eq_declared: Cpp.OnlyEqDeclared) { + // CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo] + // CHECK:STDERR: EqWith(default_eq_only, default_eq_only); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-15]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(default_eq_only, default_eq_only); + + EqWith(default_spaceship_only, default_spaceship_only); + + // CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo] + // CHECK:STDERR: EqWith(only_eq_declared, only_eq_declared); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-26]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(only_eq_declared, only_eq_declared); +} + +// --- fail_never_valid.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct OnlyNeq { + auto operator!=(OnlyNeq) const -> bool; +}; + +struct NoRelevantMembers {}; + +struct EqReturnsVoid { + auto operator==(EqReturnsVoid) const -> void; + auto operator!=(EqReturnsVoid) const -> bool; +}; + +struct NeqReturnsVoid { + auto operator==(NeqReturnsVoid) const -> bool; + auto operator!=(NeqReturnsVoid) const -> void; +}; + +struct DeletedNeq { + auto operator==(DeletedNeq) const -> bool; + auto operator!=(DeletedNeq) const -> bool = delete; +}; + +struct NonConstEq { + auto operator==(NonConstEq) -> bool; + auto operator!=(NonConstEq) const -> bool; +}; + +struct A2 {}; +struct B2 { + auto operator==(A2) const -> bool; + auto operator!=(A2) const -> bool; +}; +'''; + +fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + x == y; + x != y; +} + +fn Test(only_neq: Cpp.OnlyNeq, + no_relevant_members: Cpp.NoRelevantMembers, + eq_returns_void: Cpp.EqReturnsVoid, + neq_returns_void: Cpp.NeqReturnsVoid, + deleted_neq: Cpp.DeletedNeq, + non_const_eq: Cpp.NonConstEq, + a2: Cpp.A2, b2: Cpp.B2) { + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.OnlyNeq` into type implementing `Core.EqWith(Cpp.OnlyNeq)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: EqWith(only_neq, only_neq); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-15]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(only_neq, only_neq); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+8]]:10: error: name `only_non_default_spaceship` not found [NameNotFound] + // CHECK:STDERR: EqWith(only_non_default_spaceship, only_non_default_spaceship); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+4]]:38: error: name `only_non_default_spaceship` not found [NameNotFound] + // CHECK:STDERR: EqWith(only_non_default_spaceship, only_non_default_spaceship); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(only_non_default_spaceship, only_non_default_spaceship); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.EqWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: EqWith(no_relevant_members, no_relevant_members); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-34]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(no_relevant_members, no_relevant_members); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.EqReturnsVoid` into type implementing `Core.EqWith(Cpp.EqReturnsVoid)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: EqWith(eq_returns_void, eq_returns_void); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(eq_returns_void, eq_returns_void); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NeqReturnsVoid` into type implementing `Core.EqWith(Cpp.NeqReturnsVoid)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: EqWith(neq_returns_void, neq_returns_void); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-52]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(neq_returns_void, neq_returns_void); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+13]]:34: error: overload resolution selected deleted operator '!=' [CppInteropParseError] + // CHECK:STDERR: 109 | EqWith(deleted_neq, deleted_neq); + // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-77]]:8: note: candidate function [CppInteropParseNote] + // CHECK:STDERR: 22 | auto operator==(DeletedNeq) const -> bool; + // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-79]]:8: note: candidate function has been explicitly deleted [CppInteropParseNote] + // CHECK:STDERR: 23 | auto operator!=(DeletedNeq) const -> bool = delete; + // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-67]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(deleted_neq, deleted_neq); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo] + // CHECK:STDERR: EqWith(non_const_eq, non_const_eq); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-76]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(non_const_eq, non_const_eq); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.A2` into type implementing `Core.EqWith(Cpp.B2)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: EqWith(a2, b2); + // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-85]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(a2, b2); +} + +// CHECK:STDOUT: --- returns_bool.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic] +// CHECK:STDOUT: %Other: type = symbolic_binding Other, 0 [symbolic] +// CHECK:STDOUT: %EqWith.type.411e55.1: type = facet_type <@EqWith.1, @EqWith.1(%Other)> [symbolic] +// CHECK:STDOUT: %Self.75d78e.1: %EqWith.type.411e55.1 = symbolic_binding Self, 1 [symbolic] +// CHECK:STDOUT: %EqWith.assoc_type.14b5be.1: type = assoc_entity_type @EqWith.1, @EqWith.1(%Other) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.e50259.1: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%Other, %Self.75d78e.1) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.ec9479.1: %EqWith.WithSelf.NotEqual.type.e50259.1 = struct_value () [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.838401.1: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%Other, %Self.75d78e.1) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.dd9722.1: %EqWith.WithSelf.Equal.type.838401.1 = struct_value () [symbolic] +// CHECK:STDOUT: %EqWith.type.411e55.2: type = facet_type <@EqWith.1, @EqWith.1(%U)> [symbolic] +// CHECK:STDOUT: %pattern_type.548: type = pattern_type %EqWith.type.411e55.2 [symbolic] +// CHECK:STDOUT: %T: %EqWith.type.411e55.2 = symbolic_binding T, 1 [symbolic] +// CHECK:STDOUT: %EqWith.assoc_type.14b5be.2: type = assoc_entity_type @EqWith.1, @EqWith.1(%U) [symbolic] +// CHECK:STDOUT: %assoc0.8eade4.2: %EqWith.assoc_type.14b5be.2 = assoc_entity element0, imports.%Core.import_ref.30a [symbolic] +// CHECK:STDOUT: %assoc1.c6914e.2: %EqWith.assoc_type.14b5be.2 = assoc_entity element1, imports.%Core.import_ref.b99 [symbolic] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %pattern_type.5dd0fd.2: type = pattern_type %T.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.51d1c4.2: type = pattern_type %U [symbolic] +// CHECK:STDOUT: %require_complete.b51: = require_complete_type %EqWith.type.411e55.2 [symbolic] +// CHECK:STDOUT: %assoc0.9e2: %EqWith.assoc_type.14b5be.1 = assoc_entity element0, imports.%Core.import_ref.27d [symbolic] +// CHECK:STDOUT: %EqWith.lookup_impl_witness: = lookup_impl_witness %T, @EqWith.1, @EqWith.1(%U) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.838401.3: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.e50259.3: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %.5a0: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.838401.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem0: %.5a0 = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.9eb: = specific_impl_function %impl.elem0, @EqWith.WithSelf.Equal(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc1.641: %EqWith.assoc_type.14b5be.1 = assoc_entity element1, imports.%Core.import_ref.6e8 [symbolic] +// CHECK:STDOUT: %.fc6: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.e50259.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem1: %.fc6 = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.494: = specific_impl_function %impl.elem1, @EqWith.WithSelf.NotEqual(%U, %T) [symbolic] +// CHECK:STDOUT: %EqualityComparable: type = class_type @EqualityComparable [concrete] +// CHECK:STDOUT: %pattern_type.aed: type = pattern_type %EqualityComparable [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %EqWith.type.1bd: type = facet_type <@EqWith.1, @EqWith.1(%EqualityComparable)> [concrete] +// CHECK:STDOUT: %EqWith.assoc_type.062: type = assoc_entity_type @EqWith.1, @EqWith.1(%EqualityComparable) [concrete] +// CHECK:STDOUT: %assoc0.fca: %EqWith.assoc_type.062 = assoc_entity element0, imports.%Core.import_ref.30a [concrete] +// CHECK:STDOUT: %assoc1.1e1: %EqWith.assoc_type.062 = assoc_entity element1, imports.%Core.import_ref.b99 [concrete] +// CHECK:STDOUT: %EqualityComparable.Equal.type: type = fn_type @EqualityComparable.Equal [concrete] +// CHECK:STDOUT: %EqualityComparable.Equal: %EqualityComparable.Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %EqualityComparable.NotEqual.type: type = fn_type @EqualityComparable.NotEqual [concrete] +// CHECK:STDOUT: %EqualityComparable.NotEqual: %EqualityComparable.NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.5b7: = custom_witness (%EqualityComparable.Equal, %EqualityComparable.NotEqual), @EqWith.1, @EqWith.1(%EqualityComparable) [concrete] +// CHECK:STDOUT: %EqWith.facet.11c: %EqWith.type.1bd = facet_value %EqualityComparable, (%custom_witness.5b7) [concrete] +// CHECK:STDOUT: %pattern_type.3f6: type = pattern_type %EqWith.type.1bd [concrete] +// CHECK:STDOUT: %complete_type.22f: = complete_type_witness %EqWith.type.1bd [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.19e: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%EqualityComparable, %EqWith.facet.11c) [concrete] +// CHECK:STDOUT: %.160: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.19e, %EqWith.facet.11c [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.49b: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%EqualityComparable, %EqWith.facet.11c) [concrete] +// CHECK:STDOUT: %.199: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.49b, %EqWith.facet.11c [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.3e8: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc0 (constants.%assoc0.9e2)] +// CHECK:STDOUT: %Core.import_ref.c1e: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc1 (constants.%assoc1.641)] +// CHECK:STDOUT: %Core.import_ref.b99: @EqWith.WithSelf.%EqWith.WithSelf.NotEqual.type (%EqWith.WithSelf.NotEqual.type.e50259.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.NotEqual (constants.%EqWith.WithSelf.NotEqual.ec9479.1)] +// CHECK:STDOUT: %Core.import_ref.30a: @EqWith.WithSelf.%EqWith.WithSelf.Equal.type (%EqWith.WithSelf.Equal.type.838401.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.Equal (constants.%EqWith.WithSelf.Equal.dd9722.1)] +// CHECK:STDOUT: %Core.import_ref.27d = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.6e8 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @EqWith.loc11(%U.loc11_12.2: type, %T.loc11_22.2: @EqWith.loc11.%EqWith.type.loc11_38.1 (%EqWith.type.411e55.2)) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %require_complete.loc13: = require_complete_type %EqWith.type.loc11_38.1 [symbolic = %require_complete.loc13 (constants.%require_complete.b51)] +// CHECK:STDOUT: %EqWith.assoc_type: type = assoc_entity_type @EqWith.1, @EqWith.1(%U.loc11_12.1) [symbolic = %EqWith.assoc_type (constants.%EqWith.assoc_type.14b5be.2)] +// CHECK:STDOUT: %assoc0: @EqWith.loc11.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = assoc_entity element0, imports.%Core.import_ref.30a [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%U.loc11_12.1, %T.loc11_22.1) [symbolic = %EqWith.WithSelf.Equal.type (constants.%EqWith.WithSelf.Equal.type.838401.3)] +// CHECK:STDOUT: %.loc13_5.2: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type, %T.loc11_22.1 [symbolic = %.loc13_5.2 (constants.%.5a0)] +// CHECK:STDOUT: %EqWith.lookup_impl_witness: = lookup_impl_witness %T.loc11_22.1, @EqWith.1, @EqWith.1(%U.loc11_12.1) [symbolic = %EqWith.lookup_impl_witness (constants.%EqWith.lookup_impl_witness)] +// CHECK:STDOUT: %impl.elem0.loc13_5.2: @EqWith.loc11.%.loc13_5.2 (%.5a0) = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc13_5.2: = specific_impl_function %impl.elem0.loc13_5.2, @EqWith.WithSelf.Equal(%U.loc11_12.1, %T.loc11_22.1) [symbolic = %specific_impl_fn.loc13_5.2 (constants.%specific_impl_fn.9eb)] +// CHECK:STDOUT: %assoc1: @EqWith.loc11.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = assoc_entity element1, imports.%Core.import_ref.b99 [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%U.loc11_12.1, %T.loc11_22.1) [symbolic = %EqWith.WithSelf.NotEqual.type (constants.%EqWith.WithSelf.NotEqual.type.e50259.3)] +// CHECK:STDOUT: %.loc14_5.2: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type, %T.loc11_22.1 [symbolic = %.loc14_5.2 (constants.%.fc6)] +// CHECK:STDOUT: %impl.elem1.loc14_5.2: @EqWith.loc11.%.loc14_5.2 (%.fc6) = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc14_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %specific_impl_fn.loc14_5.2: = specific_impl_function %impl.elem1.loc14_5.2, @EqWith.WithSelf.NotEqual(%U.loc11_12.1, %T.loc11_22.1) [symbolic = %specific_impl_fn.loc14_5.2 (constants.%specific_impl_fn.494)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param: @EqWith.loc11.%T.as_type.loc11_44.1 (%T.as_type), %y.param: @EqWith.loc11.%U.loc11_12.1 (%U)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc13: @EqWith.loc11.%T.as_type.loc11_44.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc13: @EqWith.loc11.%U.loc11_12.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %EqWith.type.loc13: type = facet_type <@EqWith.1, @EqWith.1(constants.%U)> [symbolic = %EqWith.type.loc11_38.1 (constants.%EqWith.type.411e55.2)] +// CHECK:STDOUT: %.loc13_5.1: @EqWith.loc11.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = specific_constant imports.%Core.import_ref.3e8, @EqWith.WithSelf(constants.%U, constants.%Self.75d78e.1) [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %Equal.ref: @EqWith.loc11.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = name_ref Equal, %.loc13_5.1 [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %impl.elem0.loc13_5.1: @EqWith.loc11.%.loc13_5.2 (%.5a0) = impl_witness_access constants.%EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %bound_method.loc13_5.1: = bound_method %x.ref.loc13, %impl.elem0.loc13_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc13_5.1: = specific_impl_function %impl.elem0.loc13_5.1, @EqWith.WithSelf.Equal(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc13_5.2 (constants.%specific_impl_fn.9eb)] +// CHECK:STDOUT: %bound_method.loc13_5.2: = bound_method %x.ref.loc13, %specific_impl_fn.loc13_5.1 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call: init bool = call %bound_method.loc13_5.2(%x.ref.loc13, %y.ref.loc13) +// CHECK:STDOUT: %x.ref.loc14: @EqWith.loc11.%T.as_type.loc11_44.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc14: @EqWith.loc11.%U.loc11_12.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %EqWith.type.loc14: type = facet_type <@EqWith.1, @EqWith.1(constants.%U)> [symbolic = %EqWith.type.loc11_38.1 (constants.%EqWith.type.411e55.2)] +// CHECK:STDOUT: %.loc14_5.1: @EqWith.loc11.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = specific_constant imports.%Core.import_ref.c1e, @EqWith.WithSelf(constants.%U, constants.%Self.75d78e.1) [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %NotEqual.ref: @EqWith.loc11.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = name_ref NotEqual, %.loc14_5.1 [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %impl.elem1.loc14_5.1: @EqWith.loc11.%.loc14_5.2 (%.fc6) = impl_witness_access constants.%EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc14_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %bound_method.loc14_5.1: = bound_method %x.ref.loc14, %impl.elem1.loc14_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc14_5.1: = specific_impl_function %impl.elem1.loc14_5.1, @EqWith.WithSelf.NotEqual(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc14_5.2 (constants.%specific_impl_fn.494)] +// CHECK:STDOUT: %bound_method.loc14_5.2: = bound_method %x.ref.loc14, %specific_impl_fn.loc14_5.1 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call: init bool = call %bound_method.loc14_5.2(%x.ref.loc14, %y.ref.loc14) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc11(constants.%U, constants.%T) { +// CHECK:STDOUT: %U.loc11_12.1 => constants.%U +// CHECK:STDOUT: %EqWith.type.loc11_38.1 => constants.%EqWith.type.411e55.2 +// CHECK:STDOUT: %T.loc11_22.1 => constants.%T +// CHECK:STDOUT: %pattern_type.loc11_22 => constants.%pattern_type.548 +// CHECK:STDOUT: %T.as_type.loc11_44.1 => constants.%T.as_type +// CHECK:STDOUT: %pattern_type.loc11_42 => constants.%pattern_type.5dd0fd.2 +// CHECK:STDOUT: %pattern_type.loc11_48 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc11(constants.%EqualityComparable, constants.%EqWith.facet.11c) { +// CHECK:STDOUT: %U.loc11_12.1 => constants.%EqualityComparable +// CHECK:STDOUT: %EqWith.type.loc11_38.1 => constants.%EqWith.type.1bd +// CHECK:STDOUT: %T.loc11_22.1 => constants.%EqWith.facet.11c +// CHECK:STDOUT: %pattern_type.loc11_22 => constants.%pattern_type.3f6 +// CHECK:STDOUT: %T.as_type.loc11_44.1 => constants.%EqualityComparable +// CHECK:STDOUT: %pattern_type.loc11_42 => constants.%pattern_type.aed +// CHECK:STDOUT: %pattern_type.loc11_48 => constants.%pattern_type.aed +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc11_42 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc11_48 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc13 => constants.%complete_type.22f +// CHECK:STDOUT: %EqWith.assoc_type => constants.%EqWith.assoc_type.062 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.fca +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type => constants.%EqWith.WithSelf.Equal.type.19e +// CHECK:STDOUT: %.loc13_5.2 => constants.%.160 +// CHECK:STDOUT: %EqWith.lookup_impl_witness => constants.%custom_witness.5b7 +// CHECK:STDOUT: %impl.elem0.loc13_5.2 => constants.%EqualityComparable.Equal +// CHECK:STDOUT: %specific_impl_fn.loc13_5.2 => constants.%EqualityComparable.Equal +// CHECK:STDOUT: %assoc1 => constants.%assoc1.1e1 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type => constants.%EqWith.WithSelf.NotEqual.type.49b +// CHECK:STDOUT: %.loc14_5.2 => constants.%.199 +// CHECK:STDOUT: %impl.elem1.loc14_5.2 => constants.%EqualityComparable.NotEqual +// CHECK:STDOUT: %specific_impl_fn.loc14_5.2 => constants.%EqualityComparable.NotEqual +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- cross_type_equality.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic] +// CHECK:STDOUT: %Other: type = symbolic_binding Other, 0 [symbolic] +// CHECK:STDOUT: %EqWith.type.411e55.1: type = facet_type <@EqWith.1, @EqWith.1(%Other)> [symbolic] +// CHECK:STDOUT: %Self.75d78e.1: %EqWith.type.411e55.1 = symbolic_binding Self, 1 [symbolic] +// CHECK:STDOUT: %EqWith.assoc_type.14b5be.1: type = assoc_entity_type @EqWith.1, @EqWith.1(%Other) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.e50259.1: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%Other, %Self.75d78e.1) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.ec9479.1: %EqWith.WithSelf.NotEqual.type.e50259.1 = struct_value () [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.838401.1: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%Other, %Self.75d78e.1) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.dd9722.1: %EqWith.WithSelf.Equal.type.838401.1 = struct_value () [symbolic] +// CHECK:STDOUT: %EqWith.type.411e55.2: type = facet_type <@EqWith.1, @EqWith.1(%U)> [symbolic] +// CHECK:STDOUT: %pattern_type.548: type = pattern_type %EqWith.type.411e55.2 [symbolic] +// CHECK:STDOUT: %T: %EqWith.type.411e55.2 = symbolic_binding T, 1 [symbolic] +// CHECK:STDOUT: %EqWith.assoc_type.14b5be.2: type = assoc_entity_type @EqWith.1, @EqWith.1(%U) [symbolic] +// CHECK:STDOUT: %assoc0.8eade4.2: %EqWith.assoc_type.14b5be.2 = assoc_entity element0, imports.%Core.import_ref.30a [symbolic] +// CHECK:STDOUT: %assoc1.c6914e.2: %EqWith.assoc_type.14b5be.2 = assoc_entity element1, imports.%Core.import_ref.b99 [symbolic] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %pattern_type.5dd0fd.2: type = pattern_type %T.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.51d1c4.2: type = pattern_type %U [symbolic] +// CHECK:STDOUT: %require_complete.b51: = require_complete_type %EqWith.type.411e55.2 [symbolic] +// CHECK:STDOUT: %assoc0.9e2: %EqWith.assoc_type.14b5be.1 = assoc_entity element0, imports.%Core.import_ref.27d [symbolic] +// CHECK:STDOUT: %EqWith.lookup_impl_witness: = lookup_impl_witness %T, @EqWith.1, @EqWith.1(%U) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.838401.3: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.e50259.3: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %.5a0: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.838401.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem0: %.5a0 = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.9eb: = specific_impl_function %impl.elem0, @EqWith.WithSelf.Equal(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc1.641: %EqWith.assoc_type.14b5be.1 = assoc_entity element1, imports.%Core.import_ref.6e8 [symbolic] +// CHECK:STDOUT: %.fc6: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.e50259.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem1: %.fc6 = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.494: = specific_impl_function %impl.elem1, @EqWith.WithSelf.NotEqual(%U, %T) [symbolic] +// CHECK:STDOUT: %A1: type = class_type @A1 [concrete] +// CHECK:STDOUT: %pattern_type.57d: type = pattern_type %A1 [concrete] +// CHECK:STDOUT: %B1: type = class_type @B1 [concrete] +// CHECK:STDOUT: %pattern_type.c01: type = pattern_type %B1 [concrete] +// CHECK:STDOUT: %A2: type = class_type @A2 [concrete] +// CHECK:STDOUT: %pattern_type.6ac: type = pattern_type %A2 [concrete] +// CHECK:STDOUT: %B2: type = class_type @B2 [concrete] +// CHECK:STDOUT: %pattern_type.fe2: type = pattern_type %B2 [concrete] +// CHECK:STDOUT: %A3: type = class_type @A3 [concrete] +// CHECK:STDOUT: %pattern_type.bb4: type = pattern_type %A3 [concrete] +// CHECK:STDOUT: %B3: type = class_type @B3 [concrete] +// CHECK:STDOUT: %pattern_type.b85: type = pattern_type %B3 [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %EqWith.type.c2c: type = facet_type <@EqWith.1, @EqWith.1(%B1)> [concrete] +// CHECK:STDOUT: %EqWith.assoc_type.e48: type = assoc_entity_type @EqWith.1, @EqWith.1(%B1) [concrete] +// CHECK:STDOUT: %assoc0.d45: %EqWith.assoc_type.e48 = assoc_entity element0, imports.%Core.import_ref.30a [concrete] +// CHECK:STDOUT: %assoc1.6ec: %EqWith.assoc_type.e48 = assoc_entity element1, imports.%Core.import_ref.b99 [concrete] +// CHECK:STDOUT: %A1.Equal.type: type = fn_type @A1.Equal [concrete] +// CHECK:STDOUT: %A1.Equal: %A1.Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %A1.NotEqual.type: type = fn_type @A1.NotEqual [concrete] +// CHECK:STDOUT: %A1.NotEqual: %A1.NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.622: = custom_witness (%A1.Equal, %A1.NotEqual), @EqWith.1, @EqWith.1(%B1) [concrete] +// CHECK:STDOUT: %EqWith.facet.50f: %EqWith.type.c2c = facet_value %A1, (%custom_witness.622) [concrete] +// CHECK:STDOUT: %pattern_type.385: type = pattern_type %EqWith.type.c2c [concrete] +// CHECK:STDOUT: %EqWith.type.31c: type = facet_type <@EqWith.1, @EqWith.1(%A1)> [concrete] +// CHECK:STDOUT: %EqWith.assoc_type.ef3: type = assoc_entity_type @EqWith.1, @EqWith.1(%A1) [concrete] +// CHECK:STDOUT: %assoc0.90d: %EqWith.assoc_type.ef3 = assoc_entity element0, imports.%Core.import_ref.30a [concrete] +// CHECK:STDOUT: %assoc1.f70: %EqWith.assoc_type.ef3 = assoc_entity element1, imports.%Core.import_ref.b99 [concrete] +// CHECK:STDOUT: %B1.Equal.type: type = fn_type @B1.Equal [concrete] +// CHECK:STDOUT: %B1.Equal: %B1.Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %B1.NotEqual.type: type = fn_type @B1.NotEqual [concrete] +// CHECK:STDOUT: %B1.NotEqual: %B1.NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b72: = custom_witness (%B1.Equal, %B1.NotEqual), @EqWith.1, @EqWith.1(%A1) [concrete] +// CHECK:STDOUT: %EqWith.facet.888: %EqWith.type.31c = facet_value %B1, (%custom_witness.b72) [concrete] +// CHECK:STDOUT: %pattern_type.a3e: type = pattern_type %EqWith.type.31c [concrete] +// CHECK:STDOUT: %EqWith.type.61f: type = facet_type <@EqWith.1, @EqWith.1(%A2)> [concrete] +// CHECK:STDOUT: %EqWith.assoc_type.c4f: type = assoc_entity_type @EqWith.1, @EqWith.1(%A2) [concrete] +// CHECK:STDOUT: %assoc0.1b8: %EqWith.assoc_type.c4f = assoc_entity element0, imports.%Core.import_ref.30a [concrete] +// CHECK:STDOUT: %assoc1.b76: %EqWith.assoc_type.c4f = assoc_entity element1, imports.%Core.import_ref.b99 [concrete] +// CHECK:STDOUT: %B2.Equal.type: type = fn_type @B2.Equal [concrete] +// CHECK:STDOUT: %B2.Equal: %B2.Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %B2.NotEqual.type: type = fn_type @B2.NotEqual [concrete] +// CHECK:STDOUT: %B2.NotEqual: %B2.NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.009: = custom_witness (%B2.Equal, %B2.NotEqual), @EqWith.1, @EqWith.1(%A2) [concrete] +// CHECK:STDOUT: %EqWith.facet.ae0: %EqWith.type.61f = facet_value %B2, (%custom_witness.009) [concrete] +// CHECK:STDOUT: %pattern_type.c70: type = pattern_type %EqWith.type.61f [concrete] +// CHECK:STDOUT: %EqWith.type.87c: type = facet_type <@EqWith.1, @EqWith.1(%B3)> [concrete] +// CHECK:STDOUT: %EqWith.assoc_type.717: type = assoc_entity_type @EqWith.1, @EqWith.1(%B3) [concrete] +// CHECK:STDOUT: %assoc0.164: %EqWith.assoc_type.717 = assoc_entity element0, imports.%Core.import_ref.30a [concrete] +// CHECK:STDOUT: %assoc1.d2d: %EqWith.assoc_type.717 = assoc_entity element1, imports.%Core.import_ref.b99 [concrete] +// CHECK:STDOUT: %A3.Equal.type: type = fn_type @A3.Equal [concrete] +// CHECK:STDOUT: %A3.Equal: %A3.Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] +// CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.bef: = custom_witness (%A3.Equal, %NotEqual), @EqWith.1, @EqWith.1(%B3) [concrete] +// CHECK:STDOUT: %EqWith.facet.745: %EqWith.type.87c = facet_value %A3, (%custom_witness.bef) [concrete] +// CHECK:STDOUT: %pattern_type.907: type = pattern_type %EqWith.type.87c [concrete] +// CHECK:STDOUT: %EqWith.type.3bf: type = facet_type <@EqWith.1, @EqWith.1(%A3)> [concrete] +// CHECK:STDOUT: %EqWith.assoc_type.813: type = assoc_entity_type @EqWith.1, @EqWith.1(%A3) [concrete] +// CHECK:STDOUT: %assoc0.b23: %EqWith.assoc_type.813 = assoc_entity element0, imports.%Core.import_ref.30a [concrete] +// CHECK:STDOUT: %assoc1.a0a: %EqWith.assoc_type.813 = assoc_entity element1, imports.%Core.import_ref.b99 [concrete] +// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] +// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %B3.NotEqual.type: type = fn_type @B3.NotEqual [concrete] +// CHECK:STDOUT: %B3.NotEqual: %B3.NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.7b9: = custom_witness (%Equal, %B3.NotEqual), @EqWith.1, @EqWith.1(%A3) [concrete] +// CHECK:STDOUT: %EqWith.facet.fcb: %EqWith.type.3bf = facet_value %B3, (%custom_witness.7b9) [concrete] +// CHECK:STDOUT: %pattern_type.2ce: type = pattern_type %EqWith.type.3bf [concrete] +// CHECK:STDOUT: %complete_type.30b: = complete_type_witness %EqWith.type.c2c [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.0bc: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%B1, %EqWith.facet.50f) [concrete] +// CHECK:STDOUT: %.555: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.0bc, %EqWith.facet.50f [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.c48: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%B1, %EqWith.facet.50f) [concrete] +// CHECK:STDOUT: %.dce: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.c48, %EqWith.facet.50f [concrete] +// CHECK:STDOUT: %complete_type.76e: = complete_type_witness %EqWith.type.31c [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.d0a: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%A1, %EqWith.facet.888) [concrete] +// CHECK:STDOUT: %.cca: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.d0a, %EqWith.facet.888 [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.be8: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%A1, %EqWith.facet.888) [concrete] +// CHECK:STDOUT: %.5ca: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.be8, %EqWith.facet.888 [concrete] +// CHECK:STDOUT: %complete_type.eee: = complete_type_witness %EqWith.type.61f [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.d00: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%A2, %EqWith.facet.ae0) [concrete] +// CHECK:STDOUT: %.8aa: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.d00, %EqWith.facet.ae0 [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.d04: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%A2, %EqWith.facet.ae0) [concrete] +// CHECK:STDOUT: %.d65: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.d04, %EqWith.facet.ae0 [concrete] +// CHECK:STDOUT: %complete_type.b91: = complete_type_witness %EqWith.type.87c [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.9f4: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%B3, %EqWith.facet.745) [concrete] +// CHECK:STDOUT: %.44f: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.9f4, %EqWith.facet.745 [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.500: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%B3, %EqWith.facet.745) [concrete] +// CHECK:STDOUT: %.eb9: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.500, %EqWith.facet.745 [concrete] +// CHECK:STDOUT: %complete_type.457: = complete_type_witness %EqWith.type.3bf [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.a93: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%A3, %EqWith.facet.fcb) [concrete] +// CHECK:STDOUT: %.1ac: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.a93, %EqWith.facet.fcb [concrete] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.6b7: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%A3, %EqWith.facet.fcb) [concrete] +// CHECK:STDOUT: %.ad8: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.6b7, %EqWith.facet.fcb [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.3e8: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc0 (constants.%assoc0.9e2)] +// CHECK:STDOUT: %Core.import_ref.c1e: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc1 (constants.%assoc1.641)] +// CHECK:STDOUT: %Core.import_ref.b99: @EqWith.WithSelf.%EqWith.WithSelf.NotEqual.type (%EqWith.WithSelf.NotEqual.type.e50259.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.NotEqual (constants.%EqWith.WithSelf.NotEqual.ec9479.1)] +// CHECK:STDOUT: %Core.import_ref.30a: @EqWith.WithSelf.%EqWith.WithSelf.Equal.type (%EqWith.WithSelf.Equal.type.838401.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.Equal (constants.%EqWith.WithSelf.Equal.dd9722.1)] +// CHECK:STDOUT: %Core.import_ref.27d = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.6e8 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @EqWith.loc34(%U.loc34_12.2: type, %T.loc34_22.2: @EqWith.loc34.%EqWith.type.loc34_38.1 (%EqWith.type.411e55.2)) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %require_complete.loc36: = require_complete_type %EqWith.type.loc34_38.1 [symbolic = %require_complete.loc36 (constants.%require_complete.b51)] +// CHECK:STDOUT: %EqWith.assoc_type: type = assoc_entity_type @EqWith.1, @EqWith.1(%U.loc34_12.1) [symbolic = %EqWith.assoc_type (constants.%EqWith.assoc_type.14b5be.2)] +// CHECK:STDOUT: %assoc0: @EqWith.loc34.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = assoc_entity element0, imports.%Core.import_ref.30a [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%U.loc34_12.1, %T.loc34_22.1) [symbolic = %EqWith.WithSelf.Equal.type (constants.%EqWith.WithSelf.Equal.type.838401.3)] +// CHECK:STDOUT: %.loc36_5.2: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type, %T.loc34_22.1 [symbolic = %.loc36_5.2 (constants.%.5a0)] +// CHECK:STDOUT: %EqWith.lookup_impl_witness: = lookup_impl_witness %T.loc34_22.1, @EqWith.1, @EqWith.1(%U.loc34_12.1) [symbolic = %EqWith.lookup_impl_witness (constants.%EqWith.lookup_impl_witness)] +// CHECK:STDOUT: %impl.elem0.loc36_5.2: @EqWith.loc34.%.loc36_5.2 (%.5a0) = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc36_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc36_5.2: = specific_impl_function %impl.elem0.loc36_5.2, @EqWith.WithSelf.Equal(%U.loc34_12.1, %T.loc34_22.1) [symbolic = %specific_impl_fn.loc36_5.2 (constants.%specific_impl_fn.9eb)] +// CHECK:STDOUT: %assoc1: @EqWith.loc34.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = assoc_entity element1, imports.%Core.import_ref.b99 [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%U.loc34_12.1, %T.loc34_22.1) [symbolic = %EqWith.WithSelf.NotEqual.type (constants.%EqWith.WithSelf.NotEqual.type.e50259.3)] +// CHECK:STDOUT: %.loc37_5.2: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type, %T.loc34_22.1 [symbolic = %.loc37_5.2 (constants.%.fc6)] +// CHECK:STDOUT: %impl.elem1.loc37_5.2: @EqWith.loc34.%.loc37_5.2 (%.fc6) = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc37_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %specific_impl_fn.loc37_5.2: = specific_impl_function %impl.elem1.loc37_5.2, @EqWith.WithSelf.NotEqual(%U.loc34_12.1, %T.loc34_22.1) [symbolic = %specific_impl_fn.loc37_5.2 (constants.%specific_impl_fn.494)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param: @EqWith.loc34.%T.as_type.loc34_44.1 (%T.as_type), %y.param: @EqWith.loc34.%U.loc34_12.1 (%U)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc36: @EqWith.loc34.%T.as_type.loc34_44.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc36: @EqWith.loc34.%U.loc34_12.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %EqWith.type.loc36: type = facet_type <@EqWith.1, @EqWith.1(constants.%U)> [symbolic = %EqWith.type.loc34_38.1 (constants.%EqWith.type.411e55.2)] +// CHECK:STDOUT: %.loc36_5.1: @EqWith.loc34.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = specific_constant imports.%Core.import_ref.3e8, @EqWith.WithSelf(constants.%U, constants.%Self.75d78e.1) [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %Equal.ref: @EqWith.loc34.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = name_ref Equal, %.loc36_5.1 [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %impl.elem0.loc36_5.1: @EqWith.loc34.%.loc36_5.2 (%.5a0) = impl_witness_access constants.%EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc36_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %bound_method.loc36_5.1: = bound_method %x.ref.loc36, %impl.elem0.loc36_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc36_5.1: = specific_impl_function %impl.elem0.loc36_5.1, @EqWith.WithSelf.Equal(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc36_5.2 (constants.%specific_impl_fn.9eb)] +// CHECK:STDOUT: %bound_method.loc36_5.2: = bound_method %x.ref.loc36, %specific_impl_fn.loc36_5.1 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call: init bool = call %bound_method.loc36_5.2(%x.ref.loc36, %y.ref.loc36) +// CHECK:STDOUT: %x.ref.loc37: @EqWith.loc34.%T.as_type.loc34_44.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc37: @EqWith.loc34.%U.loc34_12.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %EqWith.type.loc37: type = facet_type <@EqWith.1, @EqWith.1(constants.%U)> [symbolic = %EqWith.type.loc34_38.1 (constants.%EqWith.type.411e55.2)] +// CHECK:STDOUT: %.loc37_5.1: @EqWith.loc34.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = specific_constant imports.%Core.import_ref.c1e, @EqWith.WithSelf(constants.%U, constants.%Self.75d78e.1) [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %NotEqual.ref: @EqWith.loc34.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = name_ref NotEqual, %.loc37_5.1 [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %impl.elem1.loc37_5.1: @EqWith.loc34.%.loc37_5.2 (%.fc6) = impl_witness_access constants.%EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc37_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %bound_method.loc37_5.1: = bound_method %x.ref.loc37, %impl.elem1.loc37_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc37_5.1: = specific_impl_function %impl.elem1.loc37_5.1, @EqWith.WithSelf.NotEqual(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc37_5.2 (constants.%specific_impl_fn.494)] +// CHECK:STDOUT: %bound_method.loc37_5.2: = bound_method %x.ref.loc37, %specific_impl_fn.loc37_5.1 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call: init bool = call %bound_method.loc37_5.2(%x.ref.loc37, %y.ref.loc37) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc34(constants.%U, constants.%T) { +// CHECK:STDOUT: %U.loc34_12.1 => constants.%U +// CHECK:STDOUT: %EqWith.type.loc34_38.1 => constants.%EqWith.type.411e55.2 +// CHECK:STDOUT: %T.loc34_22.1 => constants.%T +// CHECK:STDOUT: %pattern_type.loc34_22 => constants.%pattern_type.548 +// CHECK:STDOUT: %T.as_type.loc34_44.1 => constants.%T.as_type +// CHECK:STDOUT: %pattern_type.loc34_42 => constants.%pattern_type.5dd0fd.2 +// CHECK:STDOUT: %pattern_type.loc34_48 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc34(constants.%B1, constants.%EqWith.facet.50f) { +// CHECK:STDOUT: %U.loc34_12.1 => constants.%B1 +// CHECK:STDOUT: %EqWith.type.loc34_38.1 => constants.%EqWith.type.c2c +// CHECK:STDOUT: %T.loc34_22.1 => constants.%EqWith.facet.50f +// CHECK:STDOUT: %pattern_type.loc34_22 => constants.%pattern_type.385 +// CHECK:STDOUT: %T.as_type.loc34_44.1 => constants.%A1 +// CHECK:STDOUT: %pattern_type.loc34_42 => constants.%pattern_type.57d +// CHECK:STDOUT: %pattern_type.loc34_48 => constants.%pattern_type.c01 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc34_42 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc34_48 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc36 => constants.%complete_type.30b +// CHECK:STDOUT: %EqWith.assoc_type => constants.%EqWith.assoc_type.e48 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.d45 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type => constants.%EqWith.WithSelf.Equal.type.0bc +// CHECK:STDOUT: %.loc36_5.2 => constants.%.555 +// CHECK:STDOUT: %EqWith.lookup_impl_witness => constants.%custom_witness.622 +// CHECK:STDOUT: %impl.elem0.loc36_5.2 => constants.%A1.Equal +// CHECK:STDOUT: %specific_impl_fn.loc36_5.2 => constants.%A1.Equal +// CHECK:STDOUT: %assoc1 => constants.%assoc1.6ec +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type => constants.%EqWith.WithSelf.NotEqual.type.c48 +// CHECK:STDOUT: %.loc37_5.2 => constants.%.dce +// CHECK:STDOUT: %impl.elem1.loc37_5.2 => constants.%A1.NotEqual +// CHECK:STDOUT: %specific_impl_fn.loc37_5.2 => constants.%A1.NotEqual +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc34(constants.%A1, constants.%EqWith.facet.888) { +// CHECK:STDOUT: %U.loc34_12.1 => constants.%A1 +// CHECK:STDOUT: %EqWith.type.loc34_38.1 => constants.%EqWith.type.31c +// CHECK:STDOUT: %T.loc34_22.1 => constants.%EqWith.facet.888 +// CHECK:STDOUT: %pattern_type.loc34_22 => constants.%pattern_type.a3e +// CHECK:STDOUT: %T.as_type.loc34_44.1 => constants.%B1 +// CHECK:STDOUT: %pattern_type.loc34_42 => constants.%pattern_type.c01 +// CHECK:STDOUT: %pattern_type.loc34_48 => constants.%pattern_type.57d +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc34_42 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc34_48 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc36 => constants.%complete_type.76e +// CHECK:STDOUT: %EqWith.assoc_type => constants.%EqWith.assoc_type.ef3 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.90d +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type => constants.%EqWith.WithSelf.Equal.type.d0a +// CHECK:STDOUT: %.loc36_5.2 => constants.%.cca +// CHECK:STDOUT: %EqWith.lookup_impl_witness => constants.%custom_witness.b72 +// CHECK:STDOUT: %impl.elem0.loc36_5.2 => constants.%B1.Equal +// CHECK:STDOUT: %specific_impl_fn.loc36_5.2 => constants.%B1.Equal +// CHECK:STDOUT: %assoc1 => constants.%assoc1.f70 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type => constants.%EqWith.WithSelf.NotEqual.type.be8 +// CHECK:STDOUT: %.loc37_5.2 => constants.%.5ca +// CHECK:STDOUT: %impl.elem1.loc37_5.2 => constants.%B1.NotEqual +// CHECK:STDOUT: %specific_impl_fn.loc37_5.2 => constants.%B1.NotEqual +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc34(constants.%A2, constants.%EqWith.facet.ae0) { +// CHECK:STDOUT: %U.loc34_12.1 => constants.%A2 +// CHECK:STDOUT: %EqWith.type.loc34_38.1 => constants.%EqWith.type.61f +// CHECK:STDOUT: %T.loc34_22.1 => constants.%EqWith.facet.ae0 +// CHECK:STDOUT: %pattern_type.loc34_22 => constants.%pattern_type.c70 +// CHECK:STDOUT: %T.as_type.loc34_44.1 => constants.%B2 +// CHECK:STDOUT: %pattern_type.loc34_42 => constants.%pattern_type.fe2 +// CHECK:STDOUT: %pattern_type.loc34_48 => constants.%pattern_type.6ac +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc34_42 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc34_48 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc36 => constants.%complete_type.eee +// CHECK:STDOUT: %EqWith.assoc_type => constants.%EqWith.assoc_type.c4f +// CHECK:STDOUT: %assoc0 => constants.%assoc0.1b8 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type => constants.%EqWith.WithSelf.Equal.type.d00 +// CHECK:STDOUT: %.loc36_5.2 => constants.%.8aa +// CHECK:STDOUT: %EqWith.lookup_impl_witness => constants.%custom_witness.009 +// CHECK:STDOUT: %impl.elem0.loc36_5.2 => constants.%B2.Equal +// CHECK:STDOUT: %specific_impl_fn.loc36_5.2 => constants.%B2.Equal +// CHECK:STDOUT: %assoc1 => constants.%assoc1.b76 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type => constants.%EqWith.WithSelf.NotEqual.type.d04 +// CHECK:STDOUT: %.loc37_5.2 => constants.%.d65 +// CHECK:STDOUT: %impl.elem1.loc37_5.2 => constants.%B2.NotEqual +// CHECK:STDOUT: %specific_impl_fn.loc37_5.2 => constants.%B2.NotEqual +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc34(constants.%B3, constants.%EqWith.facet.745) { +// CHECK:STDOUT: %U.loc34_12.1 => constants.%B3 +// CHECK:STDOUT: %EqWith.type.loc34_38.1 => constants.%EqWith.type.87c +// CHECK:STDOUT: %T.loc34_22.1 => constants.%EqWith.facet.745 +// CHECK:STDOUT: %pattern_type.loc34_22 => constants.%pattern_type.907 +// CHECK:STDOUT: %T.as_type.loc34_44.1 => constants.%A3 +// CHECK:STDOUT: %pattern_type.loc34_42 => constants.%pattern_type.bb4 +// CHECK:STDOUT: %pattern_type.loc34_48 => constants.%pattern_type.b85 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc34_42 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc34_48 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc36 => constants.%complete_type.b91 +// CHECK:STDOUT: %EqWith.assoc_type => constants.%EqWith.assoc_type.717 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.164 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type => constants.%EqWith.WithSelf.Equal.type.9f4 +// CHECK:STDOUT: %.loc36_5.2 => constants.%.44f +// CHECK:STDOUT: %EqWith.lookup_impl_witness => constants.%custom_witness.bef +// CHECK:STDOUT: %impl.elem0.loc36_5.2 => constants.%A3.Equal +// CHECK:STDOUT: %specific_impl_fn.loc36_5.2 => constants.%A3.Equal +// CHECK:STDOUT: %assoc1 => constants.%assoc1.d2d +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type => constants.%EqWith.WithSelf.NotEqual.type.500 +// CHECK:STDOUT: %.loc37_5.2 => constants.%.eb9 +// CHECK:STDOUT: %impl.elem1.loc37_5.2 => constants.%NotEqual +// CHECK:STDOUT: %specific_impl_fn.loc37_5.2 => constants.%NotEqual +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc34(constants.%A3, constants.%EqWith.facet.fcb) { +// CHECK:STDOUT: %U.loc34_12.1 => constants.%A3 +// CHECK:STDOUT: %EqWith.type.loc34_38.1 => constants.%EqWith.type.3bf +// CHECK:STDOUT: %T.loc34_22.1 => constants.%EqWith.facet.fcb +// CHECK:STDOUT: %pattern_type.loc34_22 => constants.%pattern_type.2ce +// CHECK:STDOUT: %T.as_type.loc34_44.1 => constants.%B3 +// CHECK:STDOUT: %pattern_type.loc34_42 => constants.%pattern_type.b85 +// CHECK:STDOUT: %pattern_type.loc34_48 => constants.%pattern_type.bb4 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc34_42 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc34_48 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc36 => constants.%complete_type.457 +// CHECK:STDOUT: %EqWith.assoc_type => constants.%EqWith.assoc_type.813 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.b23 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type => constants.%EqWith.WithSelf.Equal.type.a93 +// CHECK:STDOUT: %.loc36_5.2 => constants.%.1ac +// CHECK:STDOUT: %EqWith.lookup_impl_witness => constants.%custom_witness.7b9 +// CHECK:STDOUT: %impl.elem0.loc36_5.2 => constants.%Equal +// CHECK:STDOUT: %specific_impl_fn.loc36_5.2 => constants.%Equal +// CHECK:STDOUT: %assoc1 => constants.%assoc1.a0a +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type => constants.%EqWith.WithSelf.NotEqual.type.6b7 +// CHECK:STDOUT: %.loc37_5.2 => constants.%.ad8 +// CHECK:STDOUT: %impl.elem1.loc37_5.2 => constants.%B3.NotEqual +// CHECK:STDOUT: %specific_impl_fn.loc37_5.2 => constants.%B3.NotEqual +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon b/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon new file mode 100644 index 000000000000..d189043e4b8d --- /dev/null +++ b/toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon @@ -0,0 +1,1102 @@ +// 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: toolchain/testing/testdata/min_prelude/full.carbon +// EXTRA-ARGS: --target=x86_64-linux-gnu --clang-arg=-std=c++20 +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/operators/ordered_with.carbon + +// --- returns_bool.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct Ordered { + auto operator<(Ordered const&) const -> bool; + auto operator<=(Ordered const&) const -> bool; + auto operator>(Ordered const&) const -> bool; + auto operator>=(Ordered const&) const -> bool; +}; +'''; + +fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + //@dump-sem-ir-begin + x < y; + x <= y; + x > y; + x >= y; + //@dump-sem-ir-end +} + +fn Test(ordered: Cpp.Ordered) { + OrderedWith(ordered, ordered); +} + +// --- cross_type_ordering.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct B1; +struct A1 { + auto operator<(B1) const -> bool; + auto operator<=(B1) const -> bool; + auto operator>(B1) const -> bool; + auto operator>=(B1) const -> bool; +}; +struct B1 { + auto operator<(A1) const -> bool; + auto operator<=(A1) const -> bool; + auto operator>(A1) const -> bool; + auto operator>=(A1) const -> bool; +}; + +struct B2; +struct A2 {}; +struct B2 { + auto operator<(A2) const -> bool; + auto operator<=(A2) const -> bool; + auto operator>(A2) const -> bool; + auto operator>=(A2) const -> bool; +}; + +struct B3; +struct A3 { + auto operator<(B3 b3) const -> bool; + auto operator>(B3 b3) const -> bool; + + friend auto operator<(B3 const& b3, A3 a3) -> bool { + return true; + } + friend auto operator>(B3 const& b3, A3 a3) -> bool { + return false; + } +}; +struct B3 { + auto operator<=(A3 a3) const -> bool; + auto operator>=(A3 a3) const -> bool; + + friend auto operator<=(A3 const& a3, B3 b3) -> bool { + return false; + } + + friend auto operator>=(A3 const& a3, B3 b3) -> bool { + return true; + } +}; +'''; + +fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + //@dump-sem-ir-begin + x < y; + x <= y; + x > y; + x >= y; + //@dump-sem-ir-end +} + +fn Test(a1: Cpp.A1, b1: Cpp.B1, + a2: Cpp.A2, b2: Cpp.B2, + a3: Cpp.A3, b3: Cpp.B3) { + OrderedWith(a1, b1); + OrderedWith(b1, a1); + + OrderedWith(b2, a2); + + OrderedWith(a3, b3); + OrderedWith(b3, a3); +} + +// --- fail_todo_returns_boolish.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct LessReturnsBoolish { + // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+9]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure] + // CHECK:STDERR: auto operator<(LessReturnsBoolish) const -> int; + // CHECK:STDERR: ^ + // CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] + // CHECK:STDERR: auto operator<(LessReturnsBoolish) const -> int; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:26:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn Less[self: Self](other: Other) -> bool; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + auto operator<(LessReturnsBoolish) const -> int; + auto operator<=(LessReturnsBoolish) const -> bool; + auto operator>(LessReturnsBoolish) const -> bool; + auto operator>=(LessReturnsBoolish) const -> bool; +}; + +struct LessEqualReturnsBoolish { + auto operator<(LessEqualReturnsBoolish) const -> bool; + auto operator<=(LessEqualReturnsBoolish) const -> int*; + auto operator>(LessEqualReturnsBoolish) const -> bool; + auto operator>=(LessEqualReturnsBoolish) const -> bool; +}; + +struct GreaterEqualReturnsBoolish { + enum Result { False, True }; + auto operator<(GreaterEqualReturnsBoolish) const -> bool; + auto operator<=(GreaterEqualReturnsBoolish) const -> bool; + auto operator>(GreaterEqualReturnsBoolish) const -> bool; + auto operator>=(GreaterEqualReturnsBoolish) const -> Result; +}; + +struct GreaterReturnsBoolish { + struct BoolLike { + BoolLike(bool); + operator bool() const; + }; + auto operator<(GreaterReturnsBoolish) const -> bool; + auto operator<=(GreaterReturnsBoolish) const -> bool; + auto operator>(GreaterReturnsBoolish) const -> BoolLike; + auto operator>=(GreaterReturnsBoolish) const -> bool; +}; + +struct AllReturnBoolish { + auto operator<(AllReturnBoolish) const -> double; + auto operator<=(AllReturnBoolish) const -> double; + auto operator>(AllReturnBoolish) const -> double; + auto operator>=(AllReturnBoolish) const -> double; +}; +'''; + +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+82]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-36]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator<=(LessEqualReturnsBoolish) const -> int*; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-39]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator<=(LessEqualReturnsBoolish) const -> int*; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:27:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn LessOrEquivalent[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+69]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-39]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator>=(GreaterEqualReturnsBoolish) const -> Result; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-42]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator>=(GreaterEqualReturnsBoolish) const -> Result; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn GreaterOrEquivalent[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+56]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-37]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-40]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:26:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn Less[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-49]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-52]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:27:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn LessOrEquivalent[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-61]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-64]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn Greater[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-73]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure] +// CHECK:STDERR: auto operator>=(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-76]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext] +// CHECK:STDERR: auto operator>=(AllReturnBoolish) const -> double; +// CHECK:STDERR: ^ +// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature] +// CHECK:STDERR: fn GreaterOrEquivalent[self: Self](other: Other) -> bool; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] +// CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + x < y; + x <= y; + x > y; + x >= y; +} + +fn Test(less_returns_boolish: Cpp.LessReturnsBoolish, + less_equal_returns_boolish: Cpp.LessEqualReturnsBoolish, + greater_equal_returns_boolish: Cpp.GreaterEqualReturnsBoolish, + greater_returns_boolish: Cpp.GreaterReturnsBoolish, + all_return_boolish: Cpp.AllReturnBoolish) { + OrderedWith(less_returns_boolish, less_returns_boolish); + + OrderedWith(less_equal_returns_boolish, less_equal_returns_boolish); + + OrderedWith(greater_equal_returns_boolish, greater_equal_returns_boolish); + + OrderedWith(greater_returns_boolish, greater_returns_boolish); + + OrderedWith(all_return_boolish, all_return_boolish); +} + +// --- fail_never_valid.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct MissingLess { + auto operator<=(MissingLess) const -> bool; + auto operator>(MissingLess) const -> bool; + auto operator>=(MissingLess) const -> bool; +}; + +struct MissingLessEqual { + auto operator<(MissingLessEqual) const -> bool; + auto operator>(MissingLessEqual) const -> bool; + auto operator>=(MissingLessEqual) const -> bool; +}; + +struct MissingGreater { + auto operator<(MissingGreater) const -> bool; + auto operator<=(MissingGreater) const -> bool; + auto operator>=(MissingGreater) const -> bool; +}; + +struct MissingGreaterEqual { + auto operator<(MissingGreaterEqual) const -> bool; + auto operator<=(MissingGreaterEqual) const -> bool; + auto operator>(MissingGreaterEqual) const -> bool; +}; + +struct NoRelevantMembers {}; + +struct LessReturnsVoid { + auto operator<(LessReturnsVoid) const -> void; + auto operator<=(LessReturnsVoid) const -> bool; + auto operator>(LessReturnsVoid) const -> bool; + auto operator>=(LessReturnsVoid) const -> bool; +}; + +struct LessNonConst { + auto operator<(LessNonConst) -> bool; + auto operator<=(LessNonConst) const -> bool; + auto operator>(LessNonConst) const -> bool; + auto operator>=(LessNonConst) const -> bool; +}; +'''; + +fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + x < y; + x <= y; + x > y; + x >= y; +} + +fn Test(missing_less: Cpp.MissingLess, + missing_less_equal: Cpp.MissingLessEqual, + missing_greater: Cpp.MissingGreater, + missing_greater_equal: Cpp.MissingGreaterEqual, + no_relevant_members: Cpp.NoRelevantMembers, + less_returns_void: Cpp.LessReturnsVoid, + less_non_const: Cpp.LessNonConst) { + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingLess` into type implementing `Core.OrderedWith(Cpp.MissingLess)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: OrderedWith(missing_less, missing_less); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(missing_less, missing_less); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingLessEqual` into type implementing `Core.OrderedWith(Cpp.MissingLessEqual)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: OrderedWith(missing_less_equal, missing_less_equal); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-26]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(missing_less_equal, missing_less_equal); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingGreater` into type implementing `Core.OrderedWith(Cpp.MissingGreater)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: OrderedWith(missing_greater, missing_greater); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-35]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(missing_greater, missing_greater); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingGreaterEqual` into type implementing `Core.OrderedWith(Cpp.MissingGreaterEqual)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: OrderedWith(missing_greater_equal, missing_greater_equal); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-44]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(missing_greater_equal, missing_greater_equal); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.OrderedWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: OrderedWith(no_relevant_members, no_relevant_members); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-53]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(no_relevant_members, no_relevant_members); + + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+20]]:3: error: cannot convert type `Cpp.LessReturnsVoid` into type implementing `Core.OrderedWith(Cpp.LessReturnsVoid)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: OrderedWith(less_returns_void, less_returns_void); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-62]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:26:11: error: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fn Less[self: Self](other: Other) -> bool; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-76]]:8: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: auto operator<(LessNonConst) -> bool; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:26:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn Less[self: Self](other: Other) -> bool; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-75]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(less_returns_void, less_returns_void); + + OrderedWith(less_non_const, less_non_const); +} + +// CHECK:STDOUT: --- returns_bool.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic] +// CHECK:STDOUT: %Other: type = symbolic_binding Other, 0 [symbolic] +// CHECK:STDOUT: %OrderedWith.type.ca8786.1: type = facet_type <@OrderedWith.1, @OrderedWith.1(%Other)> [symbolic] +// CHECK:STDOUT: %Self.adc9f7.1: %OrderedWith.type.ca8786.1 = symbolic_binding Self, 1 [symbolic] +// CHECK:STDOUT: %OrderedWith.assoc_type.2b366e.1: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%Other) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.975556.1: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.6f28f1.1: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.c82b75.1: %OrderedWith.WithSelf.Greater.type.6f28f1.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.1: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.86efc4.1: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.df27e9.1: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.1a4163.1: %OrderedWith.WithSelf.Less.type.df27e9.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.type.ca8786.2: type = facet_type <@OrderedWith.1, @OrderedWith.1(%U)> [symbolic] +// CHECK:STDOUT: %pattern_type.d3f: type = pattern_type %OrderedWith.type.ca8786.2 [symbolic] +// CHECK:STDOUT: %T: %OrderedWith.type.ca8786.2 = symbolic_binding T, 1 [symbolic] +// CHECK:STDOUT: %OrderedWith.assoc_type.2b366e.2: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%U) [symbolic] +// CHECK:STDOUT: %assoc0.f6e965.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element0, imports.%Core.import_ref.255 [symbolic] +// CHECK:STDOUT: %assoc1.23402c.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element1, imports.%Core.import_ref.857 [symbolic] +// CHECK:STDOUT: %assoc2.771acd.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element2, imports.%Core.import_ref.a0a [symbolic] +// CHECK:STDOUT: %assoc3.ba2aca.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element3, imports.%Core.import_ref.bb2 [symbolic] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %pattern_type.c70b34.2: type = pattern_type %T.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.51d1c4.2: type = pattern_type %U [symbolic] +// CHECK:STDOUT: %require_complete.3d2: = require_complete_type %OrderedWith.type.ca8786.2 [symbolic] +// CHECK:STDOUT: %assoc0.666: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element0, imports.%Core.import_ref.e2b [symbolic] +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: = lookup_impl_witness %T, @OrderedWith.1, @OrderedWith.1(%U) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.df27e9.3: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.3: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.6f28f1.3: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %.0af: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.df27e9.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem0: %.0af = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.072: = specific_impl_function %impl.elem0, @OrderedWith.WithSelf.Less(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc1.e40: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element1, imports.%Core.import_ref.ce4 [symbolic] +// CHECK:STDOUT: %.81b: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.970504.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem1: %.81b = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.2f8: = specific_impl_function %impl.elem1, @OrderedWith.WithSelf.LessOrEquivalent(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc2.b0e: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element2, imports.%Core.import_ref.40e [symbolic] +// CHECK:STDOUT: %.f69: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.6f28f1.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem2: %.f69 = impl_witness_access %OrderedWith.lookup_impl_witness, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1cd: = specific_impl_function %impl.elem2, @OrderedWith.WithSelf.Greater(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc3.078: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element3, imports.%Core.import_ref.a50 [symbolic] +// CHECK:STDOUT: %.206: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem3: %.206 = impl_witness_access %OrderedWith.lookup_impl_witness, element3 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.b2f: = specific_impl_function %impl.elem3, @OrderedWith.WithSelf.GreaterOrEquivalent(%U, %T) [symbolic] +// CHECK:STDOUT: %Ordered: type = class_type @Ordered [concrete] +// CHECK:STDOUT: %pattern_type.88f: type = pattern_type %Ordered [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %OrderedWith.type.356: type = facet_type <@OrderedWith.1, @OrderedWith.1(%Ordered)> [concrete] +// CHECK:STDOUT: %OrderedWith.assoc_type.03f: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%Ordered) [concrete] +// CHECK:STDOUT: %assoc0.5a7: %OrderedWith.assoc_type.03f = assoc_entity element0, imports.%Core.import_ref.255 [concrete] +// CHECK:STDOUT: %assoc1.dce: %OrderedWith.assoc_type.03f = assoc_entity element1, imports.%Core.import_ref.857 [concrete] +// CHECK:STDOUT: %assoc2.36d: %OrderedWith.assoc_type.03f = assoc_entity element2, imports.%Core.import_ref.a0a [concrete] +// CHECK:STDOUT: %assoc3.00d: %OrderedWith.assoc_type.03f = assoc_entity element3, imports.%Core.import_ref.bb2 [concrete] +// CHECK:STDOUT: %Ordered.Less.type: type = fn_type @Ordered.Less [concrete] +// CHECK:STDOUT: %Ordered.Less: %Ordered.Less.type = struct_value () [concrete] +// CHECK:STDOUT: %Ordered.LessOrEquivalent.type: type = fn_type @Ordered.LessOrEquivalent [concrete] +// CHECK:STDOUT: %Ordered.LessOrEquivalent: %Ordered.LessOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %Ordered.Greater.type: type = fn_type @Ordered.Greater [concrete] +// CHECK:STDOUT: %Ordered.Greater: %Ordered.Greater.type = struct_value () [concrete] +// CHECK:STDOUT: %Ordered.GreaterOrEquivalent.type: type = fn_type @Ordered.GreaterOrEquivalent [concrete] +// CHECK:STDOUT: %Ordered.GreaterOrEquivalent: %Ordered.GreaterOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.756: = custom_witness (%Ordered.Less, %Ordered.LessOrEquivalent, %Ordered.Greater, %Ordered.GreaterOrEquivalent), @OrderedWith.1, @OrderedWith.1(%Ordered) [concrete] +// CHECK:STDOUT: %OrderedWith.facet.251: %OrderedWith.type.356 = facet_value %Ordered, (%custom_witness.756) [concrete] +// CHECK:STDOUT: %pattern_type.86e: type = pattern_type %OrderedWith.type.356 [concrete] +// CHECK:STDOUT: %complete_type.18e: = complete_type_witness %OrderedWith.type.356 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.ce4: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Ordered, %OrderedWith.facet.251) [concrete] +// CHECK:STDOUT: %.e21: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.ce4, %OrderedWith.facet.251 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.73b: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%Ordered, %OrderedWith.facet.251) [concrete] +// CHECK:STDOUT: %.4af: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.73b, %OrderedWith.facet.251 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.cb0: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%Ordered, %OrderedWith.facet.251) [concrete] +// CHECK:STDOUT: %.6fb: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.cb0, %OrderedWith.facet.251 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.df2: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%Ordered, %OrderedWith.facet.251) [concrete] +// CHECK:STDOUT: %.c15: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.df2, %OrderedWith.facet.251 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.7e9: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc0 (constants.%assoc0.666)] +// CHECK:STDOUT: %Core.import_ref.c86: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc1 (constants.%assoc1.e40)] +// CHECK:STDOUT: %Core.import_ref.f4f: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc2 (constants.%assoc2.b0e)] +// CHECK:STDOUT: %Core.import_ref.065: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc3 (constants.%assoc3.078)] +// CHECK:STDOUT: %Core.import_ref.bb2: @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent.type (%OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent (constants.%OrderedWith.WithSelf.GreaterOrEquivalent.975556.1)] +// CHECK:STDOUT: %Core.import_ref.a0a: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater.type (%OrderedWith.WithSelf.Greater.type.6f28f1.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater (constants.%OrderedWith.WithSelf.Greater.c82b75.1)] +// CHECK:STDOUT: %Core.import_ref.857: @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent.type (%OrderedWith.WithSelf.LessOrEquivalent.type.970504.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent (constants.%OrderedWith.WithSelf.LessOrEquivalent.86efc4.1)] +// CHECK:STDOUT: %Core.import_ref.255: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less.type (%OrderedWith.WithSelf.Less.type.df27e9.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less (constants.%OrderedWith.WithSelf.Less.1a4163.1)] +// CHECK:STDOUT: %Core.import_ref.e2b = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.ce4 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.40e = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.a50 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @OrderedWith.loc13(%U.loc13_17.2: type, %T.loc13_27.2: @OrderedWith.loc13.%OrderedWith.type.loc13_48.1 (%OrderedWith.type.ca8786.2)) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %require_complete.loc15: = require_complete_type %OrderedWith.type.loc13_48.1 [symbolic = %require_complete.loc15 (constants.%require_complete.3d2)] +// CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%U.loc13_17.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.2b366e.2)] +// CHECK:STDOUT: %assoc0: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element0, imports.%Core.import_ref.255 [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %OrderedWith.WithSelf.Less.type (constants.%OrderedWith.WithSelf.Less.type.df27e9.3)] +// CHECK:STDOUT: %.loc15_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type, %T.loc13_27.1 [symbolic = %.loc15_5.2 (constants.%.0af)] +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: = lookup_impl_witness %T.loc13_27.1, @OrderedWith.1, @OrderedWith.1(%U.loc13_17.1) [symbolic = %OrderedWith.lookup_impl_witness (constants.%OrderedWith.lookup_impl_witness)] +// CHECK:STDOUT: %impl.elem0.loc15_5.2: @OrderedWith.loc13.%.loc15_5.2 (%.0af) = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc15_5.2: = specific_impl_function %impl.elem0.loc15_5.2, @OrderedWith.WithSelf.Less(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %specific_impl_fn.loc15_5.2 (constants.%specific_impl_fn.072)] +// CHECK:STDOUT: %assoc1: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element1, imports.%Core.import_ref.857 [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %OrderedWith.WithSelf.LessOrEquivalent.type (constants.%OrderedWith.WithSelf.LessOrEquivalent.type.970504.3)] +// CHECK:STDOUT: %.loc16_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type, %T.loc13_27.1 [symbolic = %.loc16_5.2 (constants.%.81b)] +// CHECK:STDOUT: %impl.elem1.loc16_5.2: @OrderedWith.loc13.%.loc16_5.2 (%.81b) = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc16_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %specific_impl_fn.loc16_5.2: = specific_impl_function %impl.elem1.loc16_5.2, @OrderedWith.WithSelf.LessOrEquivalent(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %specific_impl_fn.loc16_5.2 (constants.%specific_impl_fn.2f8)] +// CHECK:STDOUT: %assoc2: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element2, imports.%Core.import_ref.a0a [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %OrderedWith.WithSelf.Greater.type (constants.%OrderedWith.WithSelf.Greater.type.6f28f1.3)] +// CHECK:STDOUT: %.loc17_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type, %T.loc13_27.1 [symbolic = %.loc17_5.2 (constants.%.f69)] +// CHECK:STDOUT: %impl.elem2.loc17_5.2: @OrderedWith.loc13.%.loc17_5.2 (%.f69) = impl_witness_access %OrderedWith.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc17_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc17_5.2: = specific_impl_function %impl.elem2.loc17_5.2, @OrderedWith.WithSelf.Greater(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %specific_impl_fn.loc17_5.2 (constants.%specific_impl_fn.1cd)] +// CHECK:STDOUT: %assoc3: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element3, imports.%Core.import_ref.bb2 [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %OrderedWith.WithSelf.GreaterOrEquivalent.type (constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3)] +// CHECK:STDOUT: %.loc18_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type, %T.loc13_27.1 [symbolic = %.loc18_5.2 (constants.%.206)] +// CHECK:STDOUT: %impl.elem3.loc18_5.2: @OrderedWith.loc13.%.loc18_5.2 (%.206) = impl_witness_access %OrderedWith.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc18_5.2 (constants.%impl.elem3)] +// CHECK:STDOUT: %specific_impl_fn.loc18_5.2: = specific_impl_function %impl.elem3.loc18_5.2, @OrderedWith.WithSelf.GreaterOrEquivalent(%U.loc13_17.1, %T.loc13_27.1) [symbolic = %specific_impl_fn.loc18_5.2 (constants.%specific_impl_fn.b2f)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param: @OrderedWith.loc13.%T.as_type.loc13_54.1 (%T.as_type), %y.param: @OrderedWith.loc13.%U.loc13_17.1 (%U)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc15: @OrderedWith.loc13.%T.as_type.loc13_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc15: @OrderedWith.loc13.%U.loc13_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc15: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc13_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc15_5.1: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.7e9, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %Less.ref: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref Less, %.loc15_5.1 [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %impl.elem0.loc15_5.1: @OrderedWith.loc13.%.loc15_5.2 (%.0af) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %bound_method.loc15_5.1: = bound_method %x.ref.loc15, %impl.elem0.loc15_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc15_5.1: = specific_impl_function %impl.elem0.loc15_5.1, @OrderedWith.WithSelf.Less(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc15_5.2 (constants.%specific_impl_fn.072)] +// CHECK:STDOUT: %bound_method.loc15_5.2: = bound_method %x.ref.loc15, %specific_impl_fn.loc15_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call: init bool = call %bound_method.loc15_5.2(%x.ref.loc15, %y.ref.loc15) +// CHECK:STDOUT: %x.ref.loc16: @OrderedWith.loc13.%T.as_type.loc13_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc16: @OrderedWith.loc13.%U.loc13_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc16: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc13_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc16_5.1: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.c86, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %LessOrEquivalent.ref: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref LessOrEquivalent, %.loc16_5.1 [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %impl.elem1.loc16_5.1: @OrderedWith.loc13.%.loc16_5.2 (%.81b) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc16_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %bound_method.loc16_5.1: = bound_method %x.ref.loc16, %impl.elem1.loc16_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc16_5.1: = specific_impl_function %impl.elem1.loc16_5.1, @OrderedWith.WithSelf.LessOrEquivalent(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc16_5.2 (constants.%specific_impl_fn.2f8)] +// CHECK:STDOUT: %bound_method.loc16_5.2: = bound_method %x.ref.loc16, %specific_impl_fn.loc16_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call: init bool = call %bound_method.loc16_5.2(%x.ref.loc16, %y.ref.loc16) +// CHECK:STDOUT: %x.ref.loc17: @OrderedWith.loc13.%T.as_type.loc13_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc17: @OrderedWith.loc13.%U.loc13_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc17: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc13_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc17_5.1: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.f4f, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %Greater.ref: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref Greater, %.loc17_5.1 [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %impl.elem2.loc17_5.1: @OrderedWith.loc13.%.loc17_5.2 (%.f69) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc17_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc17_5.1: = bound_method %x.ref.loc17, %impl.elem2.loc17_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc17_5.1: = specific_impl_function %impl.elem2.loc17_5.1, @OrderedWith.WithSelf.Greater(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc17_5.2 (constants.%specific_impl_fn.1cd)] +// CHECK:STDOUT: %bound_method.loc17_5.2: = bound_method %x.ref.loc17, %specific_impl_fn.loc17_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call: init bool = call %bound_method.loc17_5.2(%x.ref.loc17, %y.ref.loc17) +// CHECK:STDOUT: %x.ref.loc18: @OrderedWith.loc13.%T.as_type.loc13_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc18: @OrderedWith.loc13.%U.loc13_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc18: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc13_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc18_5.1: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.065, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %GreaterOrEquivalent.ref: @OrderedWith.loc13.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref GreaterOrEquivalent, %.loc18_5.1 [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %impl.elem3.loc18_5.1: @OrderedWith.loc13.%.loc18_5.2 (%.206) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc18_5.2 (constants.%impl.elem3)] +// CHECK:STDOUT: %bound_method.loc18_5.1: = bound_method %x.ref.loc18, %impl.elem3.loc18_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc18_5.1: = specific_impl_function %impl.elem3.loc18_5.1, @OrderedWith.WithSelf.GreaterOrEquivalent(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc18_5.2 (constants.%specific_impl_fn.b2f)] +// CHECK:STDOUT: %bound_method.loc18_5.2: = bound_method %x.ref.loc18, %specific_impl_fn.loc18_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call: init bool = call %bound_method.loc18_5.2(%x.ref.loc18, %y.ref.loc18) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc13(constants.%U, constants.%T) { +// CHECK:STDOUT: %U.loc13_17.1 => constants.%U +// CHECK:STDOUT: %OrderedWith.type.loc13_48.1 => constants.%OrderedWith.type.ca8786.2 +// CHECK:STDOUT: %T.loc13_27.1 => constants.%T +// CHECK:STDOUT: %pattern_type.loc13_27 => constants.%pattern_type.d3f +// CHECK:STDOUT: %T.as_type.loc13_54.1 => constants.%T.as_type +// CHECK:STDOUT: %pattern_type.loc13_52 => constants.%pattern_type.c70b34.2 +// CHECK:STDOUT: %pattern_type.loc13_58 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc13(constants.%Ordered, constants.%OrderedWith.facet.251) { +// CHECK:STDOUT: %U.loc13_17.1 => constants.%Ordered +// CHECK:STDOUT: %OrderedWith.type.loc13_48.1 => constants.%OrderedWith.type.356 +// CHECK:STDOUT: %T.loc13_27.1 => constants.%OrderedWith.facet.251 +// CHECK:STDOUT: %pattern_type.loc13_27 => constants.%pattern_type.86e +// CHECK:STDOUT: %T.as_type.loc13_54.1 => constants.%Ordered +// CHECK:STDOUT: %pattern_type.loc13_52 => constants.%pattern_type.88f +// CHECK:STDOUT: %pattern_type.loc13_58 => constants.%pattern_type.88f +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc13_52 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc13_58 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc15 => constants.%complete_type.18e +// CHECK:STDOUT: %OrderedWith.assoc_type => constants.%OrderedWith.assoc_type.03f +// CHECK:STDOUT: %assoc0 => constants.%assoc0.5a7 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type => constants.%OrderedWith.WithSelf.Less.type.ce4 +// CHECK:STDOUT: %.loc15_5.2 => constants.%.e21 +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness => constants.%custom_witness.756 +// CHECK:STDOUT: %impl.elem0.loc15_5.2 => constants.%Ordered.Less +// CHECK:STDOUT: %specific_impl_fn.loc15_5.2 => constants.%Ordered.Less +// CHECK:STDOUT: %assoc1 => constants.%assoc1.dce +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type => constants.%OrderedWith.WithSelf.LessOrEquivalent.type.73b +// CHECK:STDOUT: %.loc16_5.2 => constants.%.4af +// CHECK:STDOUT: %impl.elem1.loc16_5.2 => constants.%Ordered.LessOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc16_5.2 => constants.%Ordered.LessOrEquivalent +// CHECK:STDOUT: %assoc2 => constants.%assoc2.36d +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type => constants.%OrderedWith.WithSelf.Greater.type.cb0 +// CHECK:STDOUT: %.loc17_5.2 => constants.%.6fb +// CHECK:STDOUT: %impl.elem2.loc17_5.2 => constants.%Ordered.Greater +// CHECK:STDOUT: %specific_impl_fn.loc17_5.2 => constants.%Ordered.Greater +// CHECK:STDOUT: %assoc3 => constants.%assoc3.00d +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type => constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.df2 +// CHECK:STDOUT: %.loc18_5.2 => constants.%.c15 +// CHECK:STDOUT: %impl.elem3.loc18_5.2 => constants.%Ordered.GreaterOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc18_5.2 => constants.%Ordered.GreaterOrEquivalent +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- cross_type_ordering.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic] +// CHECK:STDOUT: %Other: type = symbolic_binding Other, 0 [symbolic] +// CHECK:STDOUT: %OrderedWith.type.ca8786.1: type = facet_type <@OrderedWith.1, @OrderedWith.1(%Other)> [symbolic] +// CHECK:STDOUT: %Self.adc9f7.1: %OrderedWith.type.ca8786.1 = symbolic_binding Self, 1 [symbolic] +// CHECK:STDOUT: %OrderedWith.assoc_type.2b366e.1: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%Other) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.975556.1: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.6f28f1.1: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.c82b75.1: %OrderedWith.WithSelf.Greater.type.6f28f1.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.1: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.86efc4.1: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.df27e9.1: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.1a4163.1: %OrderedWith.WithSelf.Less.type.df27e9.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.type.ca8786.2: type = facet_type <@OrderedWith.1, @OrderedWith.1(%U)> [symbolic] +// CHECK:STDOUT: %pattern_type.d3f: type = pattern_type %OrderedWith.type.ca8786.2 [symbolic] +// CHECK:STDOUT: %T: %OrderedWith.type.ca8786.2 = symbolic_binding T, 1 [symbolic] +// CHECK:STDOUT: %OrderedWith.assoc_type.2b366e.2: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%U) [symbolic] +// CHECK:STDOUT: %assoc0.f6e965.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element0, imports.%Core.import_ref.255 [symbolic] +// CHECK:STDOUT: %assoc1.23402c.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element1, imports.%Core.import_ref.857 [symbolic] +// CHECK:STDOUT: %assoc2.771acd.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element2, imports.%Core.import_ref.a0a [symbolic] +// CHECK:STDOUT: %assoc3.ba2aca.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element3, imports.%Core.import_ref.bb2 [symbolic] +// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic] +// CHECK:STDOUT: %pattern_type.c70b34.2: type = pattern_type %T.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.51d1c4.2: type = pattern_type %U [symbolic] +// CHECK:STDOUT: %require_complete.3d2: = require_complete_type %OrderedWith.type.ca8786.2 [symbolic] +// CHECK:STDOUT: %assoc0.666: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element0, imports.%Core.import_ref.e2b [symbolic] +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: = lookup_impl_witness %T, @OrderedWith.1, @OrderedWith.1(%U) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.df27e9.3: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.3: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.6f28f1.3: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%U, %T) [symbolic] +// CHECK:STDOUT: %.0af: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.df27e9.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem0: %.0af = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.072: = specific_impl_function %impl.elem0, @OrderedWith.WithSelf.Less(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc1.e40: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element1, imports.%Core.import_ref.ce4 [symbolic] +// CHECK:STDOUT: %.81b: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.970504.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem1: %.81b = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.2f8: = specific_impl_function %impl.elem1, @OrderedWith.WithSelf.LessOrEquivalent(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc2.b0e: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element2, imports.%Core.import_ref.40e [symbolic] +// CHECK:STDOUT: %.f69: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.6f28f1.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem2: %.f69 = impl_witness_access %OrderedWith.lookup_impl_witness, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1cd: = specific_impl_function %impl.elem2, @OrderedWith.WithSelf.Greater(%U, %T) [symbolic] +// CHECK:STDOUT: %assoc3.078: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element3, imports.%Core.import_ref.a50 [symbolic] +// CHECK:STDOUT: %.206: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3, %T [symbolic] +// CHECK:STDOUT: %impl.elem3: %.206 = impl_witness_access %OrderedWith.lookup_impl_witness, element3 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.b2f: = specific_impl_function %impl.elem3, @OrderedWith.WithSelf.GreaterOrEquivalent(%U, %T) [symbolic] +// CHECK:STDOUT: %A1: type = class_type @A1 [concrete] +// CHECK:STDOUT: %pattern_type.57d: type = pattern_type %A1 [concrete] +// CHECK:STDOUT: %B1: type = class_type @B1 [concrete] +// CHECK:STDOUT: %pattern_type.c01: type = pattern_type %B1 [concrete] +// CHECK:STDOUT: %A2: type = class_type @A2 [concrete] +// CHECK:STDOUT: %pattern_type.6ac: type = pattern_type %A2 [concrete] +// CHECK:STDOUT: %B2: type = class_type @B2 [concrete] +// CHECK:STDOUT: %pattern_type.fe2: type = pattern_type %B2 [concrete] +// CHECK:STDOUT: %A3: type = class_type @A3 [concrete] +// CHECK:STDOUT: %pattern_type.bb4: type = pattern_type %A3 [concrete] +// CHECK:STDOUT: %B3: type = class_type @B3 [concrete] +// CHECK:STDOUT: %pattern_type.b85: type = pattern_type %B3 [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %OrderedWith.type.773: type = facet_type <@OrderedWith.1, @OrderedWith.1(%B1)> [concrete] +// CHECK:STDOUT: %OrderedWith.assoc_type.5e8: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%B1) [concrete] +// CHECK:STDOUT: %assoc0.d03: %OrderedWith.assoc_type.5e8 = assoc_entity element0, imports.%Core.import_ref.255 [concrete] +// CHECK:STDOUT: %assoc1.f6b: %OrderedWith.assoc_type.5e8 = assoc_entity element1, imports.%Core.import_ref.857 [concrete] +// CHECK:STDOUT: %assoc2.911: %OrderedWith.assoc_type.5e8 = assoc_entity element2, imports.%Core.import_ref.a0a [concrete] +// CHECK:STDOUT: %assoc3.a71: %OrderedWith.assoc_type.5e8 = assoc_entity element3, imports.%Core.import_ref.bb2 [concrete] +// CHECK:STDOUT: %A1.Less.type: type = fn_type @A1.Less [concrete] +// CHECK:STDOUT: %A1.Less: %A1.Less.type = struct_value () [concrete] +// CHECK:STDOUT: %A1.LessOrEquivalent.type: type = fn_type @A1.LessOrEquivalent [concrete] +// CHECK:STDOUT: %A1.LessOrEquivalent: %A1.LessOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %A1.Greater.type: type = fn_type @A1.Greater [concrete] +// CHECK:STDOUT: %A1.Greater: %A1.Greater.type = struct_value () [concrete] +// CHECK:STDOUT: %A1.GreaterOrEquivalent.type: type = fn_type @A1.GreaterOrEquivalent [concrete] +// CHECK:STDOUT: %A1.GreaterOrEquivalent: %A1.GreaterOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e39: = custom_witness (%A1.Less, %A1.LessOrEquivalent, %A1.Greater, %A1.GreaterOrEquivalent), @OrderedWith.1, @OrderedWith.1(%B1) [concrete] +// CHECK:STDOUT: %OrderedWith.facet.0fa: %OrderedWith.type.773 = facet_value %A1, (%custom_witness.e39) [concrete] +// CHECK:STDOUT: %pattern_type.f4b: type = pattern_type %OrderedWith.type.773 [concrete] +// CHECK:STDOUT: %OrderedWith.type.cf0: type = facet_type <@OrderedWith.1, @OrderedWith.1(%A1)> [concrete] +// CHECK:STDOUT: %OrderedWith.assoc_type.42c: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%A1) [concrete] +// CHECK:STDOUT: %assoc0.4b4: %OrderedWith.assoc_type.42c = assoc_entity element0, imports.%Core.import_ref.255 [concrete] +// CHECK:STDOUT: %assoc1.e14: %OrderedWith.assoc_type.42c = assoc_entity element1, imports.%Core.import_ref.857 [concrete] +// CHECK:STDOUT: %assoc2.733: %OrderedWith.assoc_type.42c = assoc_entity element2, imports.%Core.import_ref.a0a [concrete] +// CHECK:STDOUT: %assoc3.ffa: %OrderedWith.assoc_type.42c = assoc_entity element3, imports.%Core.import_ref.bb2 [concrete] +// CHECK:STDOUT: %B1.Less.type: type = fn_type @B1.Less [concrete] +// CHECK:STDOUT: %B1.Less: %B1.Less.type = struct_value () [concrete] +// CHECK:STDOUT: %B1.LessOrEquivalent.type: type = fn_type @B1.LessOrEquivalent [concrete] +// CHECK:STDOUT: %B1.LessOrEquivalent: %B1.LessOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %B1.Greater.type: type = fn_type @B1.Greater [concrete] +// CHECK:STDOUT: %B1.Greater: %B1.Greater.type = struct_value () [concrete] +// CHECK:STDOUT: %B1.GreaterOrEquivalent.type: type = fn_type @B1.GreaterOrEquivalent [concrete] +// CHECK:STDOUT: %B1.GreaterOrEquivalent: %B1.GreaterOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b81: = custom_witness (%B1.Less, %B1.LessOrEquivalent, %B1.Greater, %B1.GreaterOrEquivalent), @OrderedWith.1, @OrderedWith.1(%A1) [concrete] +// CHECK:STDOUT: %OrderedWith.facet.d5c: %OrderedWith.type.cf0 = facet_value %B1, (%custom_witness.b81) [concrete] +// CHECK:STDOUT: %pattern_type.3f7: type = pattern_type %OrderedWith.type.cf0 [concrete] +// CHECK:STDOUT: %OrderedWith.type.26a: type = facet_type <@OrderedWith.1, @OrderedWith.1(%A2)> [concrete] +// CHECK:STDOUT: %OrderedWith.assoc_type.688: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%A2) [concrete] +// CHECK:STDOUT: %assoc0.a70: %OrderedWith.assoc_type.688 = assoc_entity element0, imports.%Core.import_ref.255 [concrete] +// CHECK:STDOUT: %assoc1.54d: %OrderedWith.assoc_type.688 = assoc_entity element1, imports.%Core.import_ref.857 [concrete] +// CHECK:STDOUT: %assoc2.15d: %OrderedWith.assoc_type.688 = assoc_entity element2, imports.%Core.import_ref.a0a [concrete] +// CHECK:STDOUT: %assoc3.68c: %OrderedWith.assoc_type.688 = assoc_entity element3, imports.%Core.import_ref.bb2 [concrete] +// CHECK:STDOUT: %B2.Less.type: type = fn_type @B2.Less [concrete] +// CHECK:STDOUT: %B2.Less: %B2.Less.type = struct_value () [concrete] +// CHECK:STDOUT: %B2.LessOrEquivalent.type: type = fn_type @B2.LessOrEquivalent [concrete] +// CHECK:STDOUT: %B2.LessOrEquivalent: %B2.LessOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %B2.Greater.type: type = fn_type @B2.Greater [concrete] +// CHECK:STDOUT: %B2.Greater: %B2.Greater.type = struct_value () [concrete] +// CHECK:STDOUT: %B2.GreaterOrEquivalent.type: type = fn_type @B2.GreaterOrEquivalent [concrete] +// CHECK:STDOUT: %B2.GreaterOrEquivalent: %B2.GreaterOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.176: = custom_witness (%B2.Less, %B2.LessOrEquivalent, %B2.Greater, %B2.GreaterOrEquivalent), @OrderedWith.1, @OrderedWith.1(%A2) [concrete] +// CHECK:STDOUT: %OrderedWith.facet.edc: %OrderedWith.type.26a = facet_value %B2, (%custom_witness.176) [concrete] +// CHECK:STDOUT: %pattern_type.899: type = pattern_type %OrderedWith.type.26a [concrete] +// CHECK:STDOUT: %OrderedWith.type.232: type = facet_type <@OrderedWith.1, @OrderedWith.1(%B3)> [concrete] +// CHECK:STDOUT: %OrderedWith.assoc_type.02d: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%B3) [concrete] +// CHECK:STDOUT: %assoc0.0d8: %OrderedWith.assoc_type.02d = assoc_entity element0, imports.%Core.import_ref.255 [concrete] +// CHECK:STDOUT: %assoc1.f4d: %OrderedWith.assoc_type.02d = assoc_entity element1, imports.%Core.import_ref.857 [concrete] +// CHECK:STDOUT: %assoc2.ba7: %OrderedWith.assoc_type.02d = assoc_entity element2, imports.%Core.import_ref.a0a [concrete] +// CHECK:STDOUT: %assoc3.fa1: %OrderedWith.assoc_type.02d = assoc_entity element3, imports.%Core.import_ref.bb2 [concrete] +// CHECK:STDOUT: %A3.Less.type: type = fn_type @A3.Less [concrete] +// CHECK:STDOUT: %A3.Less: %A3.Less.type = struct_value () [concrete] +// CHECK:STDOUT: %LessOrEquivalent.type: type = fn_type @LessOrEquivalent [concrete] +// CHECK:STDOUT: %LessOrEquivalent: %LessOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %A3.Greater.type: type = fn_type @A3.Greater [concrete] +// CHECK:STDOUT: %A3.Greater: %A3.Greater.type = struct_value () [concrete] +// CHECK:STDOUT: %GreaterOrEquivalent.type: type = fn_type @GreaterOrEquivalent [concrete] +// CHECK:STDOUT: %GreaterOrEquivalent: %GreaterOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.499: = custom_witness (%A3.Less, %LessOrEquivalent, %A3.Greater, %GreaterOrEquivalent), @OrderedWith.1, @OrderedWith.1(%B3) [concrete] +// CHECK:STDOUT: %OrderedWith.facet.ba3: %OrderedWith.type.232 = facet_value %A3, (%custom_witness.499) [concrete] +// CHECK:STDOUT: %pattern_type.f06: type = pattern_type %OrderedWith.type.232 [concrete] +// CHECK:STDOUT: %OrderedWith.type.343: type = facet_type <@OrderedWith.1, @OrderedWith.1(%A3)> [concrete] +// CHECK:STDOUT: %OrderedWith.assoc_type.8f8: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%A3) [concrete] +// CHECK:STDOUT: %assoc0.4c0: %OrderedWith.assoc_type.8f8 = assoc_entity element0, imports.%Core.import_ref.255 [concrete] +// CHECK:STDOUT: %assoc1.c91: %OrderedWith.assoc_type.8f8 = assoc_entity element1, imports.%Core.import_ref.857 [concrete] +// CHECK:STDOUT: %assoc2.7b7: %OrderedWith.assoc_type.8f8 = assoc_entity element2, imports.%Core.import_ref.a0a [concrete] +// CHECK:STDOUT: %assoc3.1c2: %OrderedWith.assoc_type.8f8 = assoc_entity element3, imports.%Core.import_ref.bb2 [concrete] +// CHECK:STDOUT: %Less.type: type = fn_type @Less [concrete] +// CHECK:STDOUT: %Less: %Less.type = struct_value () [concrete] +// CHECK:STDOUT: %B3.LessOrEquivalent.type: type = fn_type @B3.LessOrEquivalent [concrete] +// CHECK:STDOUT: %B3.LessOrEquivalent: %B3.LessOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %Greater.type: type = fn_type @Greater [concrete] +// CHECK:STDOUT: %Greater: %Greater.type = struct_value () [concrete] +// CHECK:STDOUT: %B3.GreaterOrEquivalent.type: type = fn_type @B3.GreaterOrEquivalent [concrete] +// CHECK:STDOUT: %B3.GreaterOrEquivalent: %B3.GreaterOrEquivalent.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.679: = custom_witness (%Less, %B3.LessOrEquivalent, %Greater, %B3.GreaterOrEquivalent), @OrderedWith.1, @OrderedWith.1(%A3) [concrete] +// CHECK:STDOUT: %OrderedWith.facet.b33: %OrderedWith.type.343 = facet_value %B3, (%custom_witness.679) [concrete] +// CHECK:STDOUT: %pattern_type.e5d: type = pattern_type %OrderedWith.type.343 [concrete] +// CHECK:STDOUT: %complete_type.68a: = complete_type_witness %OrderedWith.type.773 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.e0f: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%B1, %OrderedWith.facet.0fa) [concrete] +// CHECK:STDOUT: %.e26: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.e0f, %OrderedWith.facet.0fa [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.15d: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%B1, %OrderedWith.facet.0fa) [concrete] +// CHECK:STDOUT: %.c48: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.15d, %OrderedWith.facet.0fa [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.3a1: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%B1, %OrderedWith.facet.0fa) [concrete] +// CHECK:STDOUT: %.dba: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.3a1, %OrderedWith.facet.0fa [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.ccd: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%B1, %OrderedWith.facet.0fa) [concrete] +// CHECK:STDOUT: %.64a: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.ccd, %OrderedWith.facet.0fa [concrete] +// CHECK:STDOUT: %complete_type.ee8: = complete_type_witness %OrderedWith.type.cf0 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.f2f: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%A1, %OrderedWith.facet.d5c) [concrete] +// CHECK:STDOUT: %.d99: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.f2f, %OrderedWith.facet.d5c [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.64e: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%A1, %OrderedWith.facet.d5c) [concrete] +// CHECK:STDOUT: %.d5b: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.64e, %OrderedWith.facet.d5c [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.4af: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%A1, %OrderedWith.facet.d5c) [concrete] +// CHECK:STDOUT: %.b8a: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.4af, %OrderedWith.facet.d5c [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.037: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%A1, %OrderedWith.facet.d5c) [concrete] +// CHECK:STDOUT: %.edc: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.037, %OrderedWith.facet.d5c [concrete] +// CHECK:STDOUT: %complete_type.518: = complete_type_witness %OrderedWith.type.26a [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.c1b: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%A2, %OrderedWith.facet.edc) [concrete] +// CHECK:STDOUT: %.ff0: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.c1b, %OrderedWith.facet.edc [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.341: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%A2, %OrderedWith.facet.edc) [concrete] +// CHECK:STDOUT: %.d0f: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.341, %OrderedWith.facet.edc [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.bb0: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%A2, %OrderedWith.facet.edc) [concrete] +// CHECK:STDOUT: %.e4f: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.bb0, %OrderedWith.facet.edc [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.c69: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%A2, %OrderedWith.facet.edc) [concrete] +// CHECK:STDOUT: %.fe6: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.c69, %OrderedWith.facet.edc [concrete] +// CHECK:STDOUT: %complete_type.7ba: = complete_type_witness %OrderedWith.type.232 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.3f8: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%B3, %OrderedWith.facet.ba3) [concrete] +// CHECK:STDOUT: %.7f9: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.3f8, %OrderedWith.facet.ba3 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.a19: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%B3, %OrderedWith.facet.ba3) [concrete] +// CHECK:STDOUT: %.d93: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.a19, %OrderedWith.facet.ba3 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.ae5: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%B3, %OrderedWith.facet.ba3) [concrete] +// CHECK:STDOUT: %.152: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.ae5, %OrderedWith.facet.ba3 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.17e: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%B3, %OrderedWith.facet.ba3) [concrete] +// CHECK:STDOUT: %.4d1: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.17e, %OrderedWith.facet.ba3 [concrete] +// CHECK:STDOUT: %complete_type.af4: = complete_type_witness %OrderedWith.type.343 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.444: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%A3, %OrderedWith.facet.b33) [concrete] +// CHECK:STDOUT: %.5ac: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.444, %OrderedWith.facet.b33 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.e9d: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%A3, %OrderedWith.facet.b33) [concrete] +// CHECK:STDOUT: %.158: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.e9d, %OrderedWith.facet.b33 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.7e9: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%A3, %OrderedWith.facet.b33) [concrete] +// CHECK:STDOUT: %.8ef: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.7e9, %OrderedWith.facet.b33 [concrete] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.408: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%A3, %OrderedWith.facet.b33) [concrete] +// CHECK:STDOUT: %.002: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.408, %OrderedWith.facet.b33 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.7e9: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc0 (constants.%assoc0.666)] +// CHECK:STDOUT: %Core.import_ref.c86: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc1 (constants.%assoc1.e40)] +// CHECK:STDOUT: %Core.import_ref.f4f: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc2 (constants.%assoc2.b0e)] +// CHECK:STDOUT: %Core.import_ref.065: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc3 (constants.%assoc3.078)] +// CHECK:STDOUT: %Core.import_ref.bb2: @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent.type (%OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent (constants.%OrderedWith.WithSelf.GreaterOrEquivalent.975556.1)] +// CHECK:STDOUT: %Core.import_ref.a0a: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater.type (%OrderedWith.WithSelf.Greater.type.6f28f1.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater (constants.%OrderedWith.WithSelf.Greater.c82b75.1)] +// CHECK:STDOUT: %Core.import_ref.857: @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent.type (%OrderedWith.WithSelf.LessOrEquivalent.type.970504.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent (constants.%OrderedWith.WithSelf.LessOrEquivalent.86efc4.1)] +// CHECK:STDOUT: %Core.import_ref.255: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less.type (%OrderedWith.WithSelf.Less.type.df27e9.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less (constants.%OrderedWith.WithSelf.Less.1a4163.1)] +// CHECK:STDOUT: %Core.import_ref.e2b = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.ce4 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.40e = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.a50 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @OrderedWith.loc54(%U.loc54_17.2: type, %T.loc54_27.2: @OrderedWith.loc54.%OrderedWith.type.loc54_48.1 (%OrderedWith.type.ca8786.2)) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %require_complete.loc56: = require_complete_type %OrderedWith.type.loc54_48.1 [symbolic = %require_complete.loc56 (constants.%require_complete.3d2)] +// CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%U.loc54_17.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.2b366e.2)] +// CHECK:STDOUT: %assoc0: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element0, imports.%Core.import_ref.255 [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %OrderedWith.WithSelf.Less.type (constants.%OrderedWith.WithSelf.Less.type.df27e9.3)] +// CHECK:STDOUT: %.loc56_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type, %T.loc54_27.1 [symbolic = %.loc56_5.2 (constants.%.0af)] +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: = lookup_impl_witness %T.loc54_27.1, @OrderedWith.1, @OrderedWith.1(%U.loc54_17.1) [symbolic = %OrderedWith.lookup_impl_witness (constants.%OrderedWith.lookup_impl_witness)] +// CHECK:STDOUT: %impl.elem0.loc56_5.2: @OrderedWith.loc54.%.loc56_5.2 (%.0af) = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc56_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %specific_impl_fn.loc56_5.2: = specific_impl_function %impl.elem0.loc56_5.2, @OrderedWith.WithSelf.Less(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %specific_impl_fn.loc56_5.2 (constants.%specific_impl_fn.072)] +// CHECK:STDOUT: %assoc1: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element1, imports.%Core.import_ref.857 [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %OrderedWith.WithSelf.LessOrEquivalent.type (constants.%OrderedWith.WithSelf.LessOrEquivalent.type.970504.3)] +// CHECK:STDOUT: %.loc57_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type, %T.loc54_27.1 [symbolic = %.loc57_5.2 (constants.%.81b)] +// CHECK:STDOUT: %impl.elem1.loc57_5.2: @OrderedWith.loc54.%.loc57_5.2 (%.81b) = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc57_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %specific_impl_fn.loc57_5.2: = specific_impl_function %impl.elem1.loc57_5.2, @OrderedWith.WithSelf.LessOrEquivalent(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %specific_impl_fn.loc57_5.2 (constants.%specific_impl_fn.2f8)] +// CHECK:STDOUT: %assoc2: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element2, imports.%Core.import_ref.a0a [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %OrderedWith.WithSelf.Greater.type (constants.%OrderedWith.WithSelf.Greater.type.6f28f1.3)] +// CHECK:STDOUT: %.loc58_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type, %T.loc54_27.1 [symbolic = %.loc58_5.2 (constants.%.f69)] +// CHECK:STDOUT: %impl.elem2.loc58_5.2: @OrderedWith.loc54.%.loc58_5.2 (%.f69) = impl_witness_access %OrderedWith.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc58_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc58_5.2: = specific_impl_function %impl.elem2.loc58_5.2, @OrderedWith.WithSelf.Greater(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %specific_impl_fn.loc58_5.2 (constants.%specific_impl_fn.1cd)] +// CHECK:STDOUT: %assoc3: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element3, imports.%Core.import_ref.bb2 [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %OrderedWith.WithSelf.GreaterOrEquivalent.type (constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3)] +// CHECK:STDOUT: %.loc59_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type, %T.loc54_27.1 [symbolic = %.loc59_5.2 (constants.%.206)] +// CHECK:STDOUT: %impl.elem3.loc59_5.2: @OrderedWith.loc54.%.loc59_5.2 (%.206) = impl_witness_access %OrderedWith.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc59_5.2 (constants.%impl.elem3)] +// CHECK:STDOUT: %specific_impl_fn.loc59_5.2: = specific_impl_function %impl.elem3.loc59_5.2, @OrderedWith.WithSelf.GreaterOrEquivalent(%U.loc54_17.1, %T.loc54_27.1) [symbolic = %specific_impl_fn.loc59_5.2 (constants.%specific_impl_fn.b2f)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param: @OrderedWith.loc54.%T.as_type.loc54_54.1 (%T.as_type), %y.param: @OrderedWith.loc54.%U.loc54_17.1 (%U)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc56: @OrderedWith.loc54.%T.as_type.loc54_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc56: @OrderedWith.loc54.%U.loc54_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc56: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc54_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc56_5.1: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.7e9, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %Less.ref: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref Less, %.loc56_5.1 [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %impl.elem0.loc56_5.1: @OrderedWith.loc54.%.loc56_5.2 (%.0af) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc56_5.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %bound_method.loc56_5.1: = bound_method %x.ref.loc56, %impl.elem0.loc56_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc56_5.1: = specific_impl_function %impl.elem0.loc56_5.1, @OrderedWith.WithSelf.Less(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc56_5.2 (constants.%specific_impl_fn.072)] +// CHECK:STDOUT: %bound_method.loc56_5.2: = bound_method %x.ref.loc56, %specific_impl_fn.loc56_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call: init bool = call %bound_method.loc56_5.2(%x.ref.loc56, %y.ref.loc56) +// CHECK:STDOUT: %x.ref.loc57: @OrderedWith.loc54.%T.as_type.loc54_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc57: @OrderedWith.loc54.%U.loc54_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc57: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc54_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc57_5.1: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.c86, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %LessOrEquivalent.ref: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref LessOrEquivalent, %.loc57_5.1 [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %impl.elem1.loc57_5.1: @OrderedWith.loc54.%.loc57_5.2 (%.81b) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc57_5.2 (constants.%impl.elem1)] +// CHECK:STDOUT: %bound_method.loc57_5.1: = bound_method %x.ref.loc57, %impl.elem1.loc57_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc57_5.1: = specific_impl_function %impl.elem1.loc57_5.1, @OrderedWith.WithSelf.LessOrEquivalent(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc57_5.2 (constants.%specific_impl_fn.2f8)] +// CHECK:STDOUT: %bound_method.loc57_5.2: = bound_method %x.ref.loc57, %specific_impl_fn.loc57_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call: init bool = call %bound_method.loc57_5.2(%x.ref.loc57, %y.ref.loc57) +// CHECK:STDOUT: %x.ref.loc58: @OrderedWith.loc54.%T.as_type.loc54_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc58: @OrderedWith.loc54.%U.loc54_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc58: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc54_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc58_5.1: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.f4f, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %Greater.ref: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref Greater, %.loc58_5.1 [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %impl.elem2.loc58_5.1: @OrderedWith.loc54.%.loc58_5.2 (%.f69) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc58_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc58_5.1: = bound_method %x.ref.loc58, %impl.elem2.loc58_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc58_5.1: = specific_impl_function %impl.elem2.loc58_5.1, @OrderedWith.WithSelf.Greater(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc58_5.2 (constants.%specific_impl_fn.1cd)] +// CHECK:STDOUT: %bound_method.loc58_5.2: = bound_method %x.ref.loc58, %specific_impl_fn.loc58_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call: init bool = call %bound_method.loc58_5.2(%x.ref.loc58, %y.ref.loc58) +// CHECK:STDOUT: %x.ref.loc59: @OrderedWith.loc54.%T.as_type.loc54_54.1 (%T.as_type) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc59: @OrderedWith.loc54.%U.loc54_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc59: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc54_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc59_5.1: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.065, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %GreaterOrEquivalent.ref: @OrderedWith.loc54.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref GreaterOrEquivalent, %.loc59_5.1 [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %impl.elem3.loc59_5.1: @OrderedWith.loc54.%.loc59_5.2 (%.206) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc59_5.2 (constants.%impl.elem3)] +// CHECK:STDOUT: %bound_method.loc59_5.1: = bound_method %x.ref.loc59, %impl.elem3.loc59_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc59_5.1: = specific_impl_function %impl.elem3.loc59_5.1, @OrderedWith.WithSelf.GreaterOrEquivalent(constants.%U, constants.%T) [symbolic = %specific_impl_fn.loc59_5.2 (constants.%specific_impl_fn.b2f)] +// CHECK:STDOUT: %bound_method.loc59_5.2: = bound_method %x.ref.loc59, %specific_impl_fn.loc59_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call: init bool = call %bound_method.loc59_5.2(%x.ref.loc59, %y.ref.loc59) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc54(constants.%U, constants.%T) { +// CHECK:STDOUT: %U.loc54_17.1 => constants.%U +// CHECK:STDOUT: %OrderedWith.type.loc54_48.1 => constants.%OrderedWith.type.ca8786.2 +// CHECK:STDOUT: %T.loc54_27.1 => constants.%T +// CHECK:STDOUT: %pattern_type.loc54_27 => constants.%pattern_type.d3f +// CHECK:STDOUT: %T.as_type.loc54_54.1 => constants.%T.as_type +// CHECK:STDOUT: %pattern_type.loc54_52 => constants.%pattern_type.c70b34.2 +// CHECK:STDOUT: %pattern_type.loc54_58 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc54(constants.%B1, constants.%OrderedWith.facet.0fa) { +// CHECK:STDOUT: %U.loc54_17.1 => constants.%B1 +// CHECK:STDOUT: %OrderedWith.type.loc54_48.1 => constants.%OrderedWith.type.773 +// CHECK:STDOUT: %T.loc54_27.1 => constants.%OrderedWith.facet.0fa +// CHECK:STDOUT: %pattern_type.loc54_27 => constants.%pattern_type.f4b +// CHECK:STDOUT: %T.as_type.loc54_54.1 => constants.%A1 +// CHECK:STDOUT: %pattern_type.loc54_52 => constants.%pattern_type.57d +// CHECK:STDOUT: %pattern_type.loc54_58 => constants.%pattern_type.c01 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc54_52 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc54_58 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc56 => constants.%complete_type.68a +// CHECK:STDOUT: %OrderedWith.assoc_type => constants.%OrderedWith.assoc_type.5e8 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.d03 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type => constants.%OrderedWith.WithSelf.Less.type.e0f +// CHECK:STDOUT: %.loc56_5.2 => constants.%.e26 +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness => constants.%custom_witness.e39 +// CHECK:STDOUT: %impl.elem0.loc56_5.2 => constants.%A1.Less +// CHECK:STDOUT: %specific_impl_fn.loc56_5.2 => constants.%A1.Less +// CHECK:STDOUT: %assoc1 => constants.%assoc1.f6b +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type => constants.%OrderedWith.WithSelf.LessOrEquivalent.type.15d +// CHECK:STDOUT: %.loc57_5.2 => constants.%.c48 +// CHECK:STDOUT: %impl.elem1.loc57_5.2 => constants.%A1.LessOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc57_5.2 => constants.%A1.LessOrEquivalent +// CHECK:STDOUT: %assoc2 => constants.%assoc2.911 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type => constants.%OrderedWith.WithSelf.Greater.type.3a1 +// CHECK:STDOUT: %.loc58_5.2 => constants.%.dba +// CHECK:STDOUT: %impl.elem2.loc58_5.2 => constants.%A1.Greater +// CHECK:STDOUT: %specific_impl_fn.loc58_5.2 => constants.%A1.Greater +// CHECK:STDOUT: %assoc3 => constants.%assoc3.a71 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type => constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.ccd +// CHECK:STDOUT: %.loc59_5.2 => constants.%.64a +// CHECK:STDOUT: %impl.elem3.loc59_5.2 => constants.%A1.GreaterOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc59_5.2 => constants.%A1.GreaterOrEquivalent +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc54(constants.%A1, constants.%OrderedWith.facet.d5c) { +// CHECK:STDOUT: %U.loc54_17.1 => constants.%A1 +// CHECK:STDOUT: %OrderedWith.type.loc54_48.1 => constants.%OrderedWith.type.cf0 +// CHECK:STDOUT: %T.loc54_27.1 => constants.%OrderedWith.facet.d5c +// CHECK:STDOUT: %pattern_type.loc54_27 => constants.%pattern_type.3f7 +// CHECK:STDOUT: %T.as_type.loc54_54.1 => constants.%B1 +// CHECK:STDOUT: %pattern_type.loc54_52 => constants.%pattern_type.c01 +// CHECK:STDOUT: %pattern_type.loc54_58 => constants.%pattern_type.57d +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc54_52 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc54_58 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc56 => constants.%complete_type.ee8 +// CHECK:STDOUT: %OrderedWith.assoc_type => constants.%OrderedWith.assoc_type.42c +// CHECK:STDOUT: %assoc0 => constants.%assoc0.4b4 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type => constants.%OrderedWith.WithSelf.Less.type.f2f +// CHECK:STDOUT: %.loc56_5.2 => constants.%.d99 +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness => constants.%custom_witness.b81 +// CHECK:STDOUT: %impl.elem0.loc56_5.2 => constants.%B1.Less +// CHECK:STDOUT: %specific_impl_fn.loc56_5.2 => constants.%B1.Less +// CHECK:STDOUT: %assoc1 => constants.%assoc1.e14 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type => constants.%OrderedWith.WithSelf.LessOrEquivalent.type.64e +// CHECK:STDOUT: %.loc57_5.2 => constants.%.d5b +// CHECK:STDOUT: %impl.elem1.loc57_5.2 => constants.%B1.LessOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc57_5.2 => constants.%B1.LessOrEquivalent +// CHECK:STDOUT: %assoc2 => constants.%assoc2.733 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type => constants.%OrderedWith.WithSelf.Greater.type.4af +// CHECK:STDOUT: %.loc58_5.2 => constants.%.b8a +// CHECK:STDOUT: %impl.elem2.loc58_5.2 => constants.%B1.Greater +// CHECK:STDOUT: %specific_impl_fn.loc58_5.2 => constants.%B1.Greater +// CHECK:STDOUT: %assoc3 => constants.%assoc3.ffa +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type => constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.037 +// CHECK:STDOUT: %.loc59_5.2 => constants.%.edc +// CHECK:STDOUT: %impl.elem3.loc59_5.2 => constants.%B1.GreaterOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc59_5.2 => constants.%B1.GreaterOrEquivalent +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc54(constants.%A2, constants.%OrderedWith.facet.edc) { +// CHECK:STDOUT: %U.loc54_17.1 => constants.%A2 +// CHECK:STDOUT: %OrderedWith.type.loc54_48.1 => constants.%OrderedWith.type.26a +// CHECK:STDOUT: %T.loc54_27.1 => constants.%OrderedWith.facet.edc +// CHECK:STDOUT: %pattern_type.loc54_27 => constants.%pattern_type.899 +// CHECK:STDOUT: %T.as_type.loc54_54.1 => constants.%B2 +// CHECK:STDOUT: %pattern_type.loc54_52 => constants.%pattern_type.fe2 +// CHECK:STDOUT: %pattern_type.loc54_58 => constants.%pattern_type.6ac +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc54_52 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc54_58 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc56 => constants.%complete_type.518 +// CHECK:STDOUT: %OrderedWith.assoc_type => constants.%OrderedWith.assoc_type.688 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.a70 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type => constants.%OrderedWith.WithSelf.Less.type.c1b +// CHECK:STDOUT: %.loc56_5.2 => constants.%.ff0 +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness => constants.%custom_witness.176 +// CHECK:STDOUT: %impl.elem0.loc56_5.2 => constants.%B2.Less +// CHECK:STDOUT: %specific_impl_fn.loc56_5.2 => constants.%B2.Less +// CHECK:STDOUT: %assoc1 => constants.%assoc1.54d +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type => constants.%OrderedWith.WithSelf.LessOrEquivalent.type.341 +// CHECK:STDOUT: %.loc57_5.2 => constants.%.d0f +// CHECK:STDOUT: %impl.elem1.loc57_5.2 => constants.%B2.LessOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc57_5.2 => constants.%B2.LessOrEquivalent +// CHECK:STDOUT: %assoc2 => constants.%assoc2.15d +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type => constants.%OrderedWith.WithSelf.Greater.type.bb0 +// CHECK:STDOUT: %.loc58_5.2 => constants.%.e4f +// CHECK:STDOUT: %impl.elem2.loc58_5.2 => constants.%B2.Greater +// CHECK:STDOUT: %specific_impl_fn.loc58_5.2 => constants.%B2.Greater +// CHECK:STDOUT: %assoc3 => constants.%assoc3.68c +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type => constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.c69 +// CHECK:STDOUT: %.loc59_5.2 => constants.%.fe6 +// CHECK:STDOUT: %impl.elem3.loc59_5.2 => constants.%B2.GreaterOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc59_5.2 => constants.%B2.GreaterOrEquivalent +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc54(constants.%B3, constants.%OrderedWith.facet.ba3) { +// CHECK:STDOUT: %U.loc54_17.1 => constants.%B3 +// CHECK:STDOUT: %OrderedWith.type.loc54_48.1 => constants.%OrderedWith.type.232 +// CHECK:STDOUT: %T.loc54_27.1 => constants.%OrderedWith.facet.ba3 +// CHECK:STDOUT: %pattern_type.loc54_27 => constants.%pattern_type.f06 +// CHECK:STDOUT: %T.as_type.loc54_54.1 => constants.%A3 +// CHECK:STDOUT: %pattern_type.loc54_52 => constants.%pattern_type.bb4 +// CHECK:STDOUT: %pattern_type.loc54_58 => constants.%pattern_type.b85 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc54_52 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc54_58 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc56 => constants.%complete_type.7ba +// CHECK:STDOUT: %OrderedWith.assoc_type => constants.%OrderedWith.assoc_type.02d +// CHECK:STDOUT: %assoc0 => constants.%assoc0.0d8 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type => constants.%OrderedWith.WithSelf.Less.type.3f8 +// CHECK:STDOUT: %.loc56_5.2 => constants.%.7f9 +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness => constants.%custom_witness.499 +// CHECK:STDOUT: %impl.elem0.loc56_5.2 => constants.%A3.Less +// CHECK:STDOUT: %specific_impl_fn.loc56_5.2 => constants.%A3.Less +// CHECK:STDOUT: %assoc1 => constants.%assoc1.f4d +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type => constants.%OrderedWith.WithSelf.LessOrEquivalent.type.a19 +// CHECK:STDOUT: %.loc57_5.2 => constants.%.d93 +// CHECK:STDOUT: %impl.elem1.loc57_5.2 => constants.%LessOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc57_5.2 => constants.%LessOrEquivalent +// CHECK:STDOUT: %assoc2 => constants.%assoc2.ba7 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type => constants.%OrderedWith.WithSelf.Greater.type.ae5 +// CHECK:STDOUT: %.loc58_5.2 => constants.%.152 +// CHECK:STDOUT: %impl.elem2.loc58_5.2 => constants.%A3.Greater +// CHECK:STDOUT: %specific_impl_fn.loc58_5.2 => constants.%A3.Greater +// CHECK:STDOUT: %assoc3 => constants.%assoc3.fa1 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type => constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.17e +// CHECK:STDOUT: %.loc59_5.2 => constants.%.4d1 +// CHECK:STDOUT: %impl.elem3.loc59_5.2 => constants.%GreaterOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc59_5.2 => constants.%GreaterOrEquivalent +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc54(constants.%A3, constants.%OrderedWith.facet.b33) { +// CHECK:STDOUT: %U.loc54_17.1 => constants.%A3 +// CHECK:STDOUT: %OrderedWith.type.loc54_48.1 => constants.%OrderedWith.type.343 +// CHECK:STDOUT: %T.loc54_27.1 => constants.%OrderedWith.facet.b33 +// CHECK:STDOUT: %pattern_type.loc54_27 => constants.%pattern_type.e5d +// CHECK:STDOUT: %T.as_type.loc54_54.1 => constants.%B3 +// CHECK:STDOUT: %pattern_type.loc54_52 => constants.%pattern_type.b85 +// CHECK:STDOUT: %pattern_type.loc54_58 => constants.%pattern_type.bb4 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc54_52 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc54_58 => constants.%complete_type.357 +// CHECK:STDOUT: %require_complete.loc56 => constants.%complete_type.af4 +// CHECK:STDOUT: %OrderedWith.assoc_type => constants.%OrderedWith.assoc_type.8f8 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.4c0 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type => constants.%OrderedWith.WithSelf.Less.type.444 +// CHECK:STDOUT: %.loc56_5.2 => constants.%.5ac +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness => constants.%custom_witness.679 +// CHECK:STDOUT: %impl.elem0.loc56_5.2 => constants.%Less +// CHECK:STDOUT: %specific_impl_fn.loc56_5.2 => constants.%Less +// CHECK:STDOUT: %assoc1 => constants.%assoc1.c91 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type => constants.%OrderedWith.WithSelf.LessOrEquivalent.type.e9d +// CHECK:STDOUT: %.loc57_5.2 => constants.%.158 +// CHECK:STDOUT: %impl.elem1.loc57_5.2 => constants.%B3.LessOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc57_5.2 => constants.%B3.LessOrEquivalent +// CHECK:STDOUT: %assoc2 => constants.%assoc2.7b7 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type => constants.%OrderedWith.WithSelf.Greater.type.7e9 +// CHECK:STDOUT: %.loc58_5.2 => constants.%.8ef +// CHECK:STDOUT: %impl.elem2.loc58_5.2 => constants.%Greater +// CHECK:STDOUT: %specific_impl_fn.loc58_5.2 => constants.%Greater +// CHECK:STDOUT: %assoc3 => constants.%assoc3.1c2 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type => constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.408 +// CHECK:STDOUT: %.loc59_5.2 => constants.%.002 +// CHECK:STDOUT: %impl.elem3.loc59_5.2 => constants.%B3.GreaterOrEquivalent +// CHECK:STDOUT: %specific_impl_fn.loc59_5.2 => constants.%B3.GreaterOrEquivalent +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon b/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon new file mode 100644 index 000000000000..e391990a12ec --- /dev/null +++ b/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon @@ -0,0 +1,549 @@ +// 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: toolchain/testing/testdata/min_prelude/full.carbon +// EXTRA-ARGS: --target=x86_64-linux-gnu --clang-arg=-std=c++20 +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/operators/spaceship.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/operators/spaceship.carbon + +// --- compare.h + +namespace std { + class partial_ordering { + public: + static const partial_ordering less; + static const partial_ordering equivalent; + static const partial_ordering greater; + static const partial_ordering unordered; + + friend constexpr bool operator==(partial_ordering v, int) noexcept; + friend constexpr bool operator==(partial_ordering v, partial_ordering w) noexcept = default; + friend constexpr bool operator<(partial_ordering v, int) noexcept; + friend constexpr bool operator>(partial_ordering v, int) noexcept; + friend constexpr bool operator<=(partial_ordering v, int) noexcept; + friend constexpr bool operator>=(partial_ordering v, int) noexcept; + friend constexpr bool operator<(int, partial_ordering v) noexcept; + friend constexpr bool operator>(int, partial_ordering v) noexcept; + friend constexpr bool operator<=(int, partial_ordering v) noexcept; + friend constexpr bool operator>=(int, partial_ordering v) noexcept; + friend constexpr partial_ordering operator<=>(partial_ordering v, int) noexcept; + friend constexpr partial_ordering operator<=>(int, partial_ordering v) noexcept; + private: + int value_; + constexpr explicit partial_ordering(int x) noexcept : value_(x) {} + }; + constexpr auto partial_ordering::less = partial_ordering(-1); + constexpr auto partial_ordering::equivalent = partial_ordering(0); + constexpr auto partial_ordering::greater = partial_ordering(1); + constexpr auto partial_ordering::unordered = partial_ordering(2); + + class weak_ordering { + public: + static const weak_ordering less; + static const weak_ordering equivalent; + static const weak_ordering greater; + + friend constexpr bool operator==(weak_ordering v, int) noexcept; + friend constexpr bool operator==(weak_ordering v, weak_ordering w) noexcept = default; + friend constexpr bool operator<(weak_ordering v, int) noexcept; + friend constexpr bool operator>(weak_ordering v, int) noexcept; + friend constexpr bool operator<=(weak_ordering v, int) noexcept; + friend constexpr bool operator>=(weak_ordering v, int) noexcept; + friend constexpr bool operator<(int, weak_ordering v) noexcept; + friend constexpr bool operator>(int, weak_ordering v) noexcept; + friend constexpr bool operator<=(int, weak_ordering v) noexcept; + friend constexpr bool operator>=(int, weak_ordering v) noexcept; + friend constexpr weak_ordering operator<=>(weak_ordering v, int) noexcept; + friend constexpr weak_ordering operator<=>(int, weak_ordering v) noexcept; + private: + int value_; + constexpr explicit weak_ordering(int x) noexcept : value_(x) {} + }; + constexpr auto weak_ordering::less = weak_ordering(-1); + constexpr auto weak_ordering::equivalent = weak_ordering(0); + constexpr auto weak_ordering::greater = weak_ordering(1); + + class strong_ordering { + public: + static const strong_ordering less; + static const strong_ordering equal; + static const strong_ordering equivalent; + static const strong_ordering greater; + + friend constexpr bool operator==(strong_ordering v, int) noexcept; + friend constexpr bool operator==(strong_ordering v, strong_ordering w) noexcept = default; + friend constexpr bool operator<(strong_ordering v, int) noexcept; + friend constexpr bool operator>(strong_ordering v, int) noexcept; + friend constexpr bool operator<=(strong_ordering v, int) noexcept; + friend constexpr bool operator>=(strong_ordering v, int) noexcept; + friend constexpr bool operator<(int, strong_ordering v) noexcept; + friend constexpr bool operator>(int, strong_ordering v) noexcept; + friend constexpr bool operator<=(int, strong_ordering v) noexcept; + friend constexpr bool operator>=(int, strong_ordering v) noexcept; + friend constexpr strong_ordering operator<=>(strong_ordering v, int) noexcept; + friend constexpr strong_ordering operator<=>(int, strong_ordering v) noexcept; + private: + int value_; + constexpr explicit strong_ordering(int x) noexcept : value_(x) {} + }; + constexpr auto strong_ordering::less = strong_ordering(-1); + constexpr auto strong_ordering::equal = strong_ordering(0); + constexpr auto strong_ordering::equivalent = strong_ordering(0); + constexpr auto strong_ordering::greater = strong_ordering(1); +} // namespace std + +// --- three_way_comparable_types.h + +#include "compare.h" + +struct DefaultSpaceshipOnly { +public: + auto operator<=>(const DefaultSpaceshipOnly&) const = default; +}; + +struct ReturnsStrongOrdering { + auto operator<=>(ReturnsStrongOrdering) const -> std::strong_ordering; +}; + +struct ReturnsWeakOrdering { + auto operator<=>(ReturnsWeakOrdering) const -> std::weak_ordering; +}; + +struct ReturnsPartialOrdering { + auto operator<=>(ReturnsPartialOrdering) const -> std::partial_ordering; +}; + +struct CrossTypeRhs; +struct CrossTypeLhs { + auto operator<=>(CrossTypeRhs) const -> std::strong_ordering; +}; +struct CrossTypeRhs { + auto operator<=>(CrossTypeLhs) const -> std::strong_ordering; +}; + +// --- fail_todo_spaceship_rewrites.carbon + +import Cpp library "three_way_comparable_types.h"; + +fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + //@dump-sem-ir-begin + x == y; + x != y; + //@dump-sem-ir-end +} + +fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + //@dump-sem-ir-begin + x < y; + x <= y; + x > y; + x >= y; + //@dump-sem-ir-end +} + +fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly, + returns_strong_ordering: Cpp.ReturnsStrongOrdering, + returns_weak_ordering: Cpp.ReturnsWeakOrdering, + returns_partial_ordering: Cpp.ReturnsPartialOrdering, + cross_type_lhs: Cpp.CrossTypeLhs, + cross_type_rhs: Cpp.CrossTypeRhs) { + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo] + // CHECK:STDERR: EqWith(default_spaceship_only, default_spaceship_only); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-25]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(default_spaceship_only, default_spaceship_only); + + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo] + // CHECK:STDERR: OrderedWith(default_spaceship_only, default_spaceship_only); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-27]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(default_spaceship_only, default_spaceship_only); + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo] + // CHECK:STDERR: OrderedWith(returns_strong_ordering, returns_strong_ordering); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-35]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(returns_strong_ordering, returns_strong_ordering); + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo] + // CHECK:STDERR: OrderedWith(returns_partial_ordering, returns_partial_ordering); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(returns_partial_ordering, returns_partial_ordering); + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo] + // CHECK:STDERR: OrderedWith(cross_type_lhs, cross_type_rhs); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-51]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(cross_type_lhs, cross_type_rhs); + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+11]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo] + // CHECK:STDERR: OrderedWith(cross_type_rhs, cross_type_lhs); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-59]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn OrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-52]]:9: warning: binding `returns_weak_ordering` unused [UnusedBinding] + // CHECK:STDERR: returns_weak_ordering: Cpp.ReturnsWeakOrdering, + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + OrderedWith(cross_type_rhs, cross_type_lhs); +} + +// --- fail_never_valid.carbon +// CHECK:STDERR: fail_never_valid.carbon: error: `Main//default` previously provided by `fail_todo_spaceship_rewrites.carbon` [DuplicateMainApi] +// CHECK:STDERR: + +import Cpp library "three_way_comparable_types.h"; + +fn EqWith[U:! type, T:! Core.EqWith(U)](unused x: T, unused y: U) {} + +fn Test(returns_strong_ordering: Cpp.ReturnsStrongOrdering) { + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.ReturnsStrongOrdering` into type implementing `Core.EqWith(Cpp.ReturnsStrongOrdering)` [ConversionFailureTypeToFacet] + // CHECK:STDERR: EqWith(returns_strong_ordering, returns_strong_ordering); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn EqWith[U:! type, T:! Core.EqWith(U)](unused x: T, unused y: U) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + EqWith(returns_strong_ordering, returns_strong_ordering); +} + +// CHECK:STDOUT: --- fail_todo_spaceship_rewrites.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %U: type = symbolic_binding U, 0 [symbolic] +// CHECK:STDOUT: %Other: type = symbolic_binding Other, 0 [symbolic] +// CHECK:STDOUT: %EqWith.type.411e55.1: type = facet_type <@EqWith.1, @EqWith.1(%Other)> [symbolic] +// CHECK:STDOUT: %Self.75d78e.1: %EqWith.type.411e55.1 = symbolic_binding Self, 1 [symbolic] +// CHECK:STDOUT: %EqWith.assoc_type.14b5be.1: type = assoc_entity_type @EqWith.1, @EqWith.1(%Other) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.e50259.1: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%Other, %Self.75d78e.1) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.ec9479.1: %EqWith.WithSelf.NotEqual.type.e50259.1 = struct_value () [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.838401.1: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%Other, %Self.75d78e.1) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.dd9722.1: %EqWith.WithSelf.Equal.type.838401.1 = struct_value () [symbolic] +// CHECK:STDOUT: %EqWith.type.411e55.2: type = facet_type <@EqWith.1, @EqWith.1(%U)> [symbolic] +// CHECK:STDOUT: %pattern_type.548: type = pattern_type %EqWith.type.411e55.2 [symbolic] +// CHECK:STDOUT: %T.75d: %EqWith.type.411e55.2 = symbolic_binding T, 1 [symbolic] +// CHECK:STDOUT: %EqWith.assoc_type.14b5be.2: type = assoc_entity_type @EqWith.1, @EqWith.1(%U) [symbolic] +// CHECK:STDOUT: %assoc0.8eade4.2: %EqWith.assoc_type.14b5be.2 = assoc_entity element0, imports.%Core.import_ref.30a [symbolic] +// CHECK:STDOUT: %assoc1.c6914e.2: %EqWith.assoc_type.14b5be.2 = assoc_entity element1, imports.%Core.import_ref.b99 [symbolic] +// CHECK:STDOUT: %T.as_type.300: type = facet_access_type %T.75d [symbolic] +// CHECK:STDOUT: %pattern_type.5dd0fd.2: type = pattern_type %T.as_type.300 [symbolic] +// CHECK:STDOUT: %pattern_type.51d1c4.2: type = pattern_type %U [symbolic] +// CHECK:STDOUT: %require_complete.b51: = require_complete_type %EqWith.type.411e55.2 [symbolic] +// CHECK:STDOUT: %assoc0.9e2: %EqWith.assoc_type.14b5be.1 = assoc_entity element0, imports.%Core.import_ref.27d [symbolic] +// CHECK:STDOUT: %EqWith.lookup_impl_witness: = lookup_impl_witness %T.75d, @EqWith.1, @EqWith.1(%U) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.838401.3: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%U, %T.75d) [symbolic] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.e50259.3: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%U, %T.75d) [symbolic] +// CHECK:STDOUT: %.5a0: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.838401.3, %T.75d [symbolic] +// CHECK:STDOUT: %impl.elem0.d9c: %.5a0 = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.9eb: = specific_impl_function %impl.elem0.d9c, @EqWith.WithSelf.Equal(%U, %T.75d) [symbolic] +// CHECK:STDOUT: %assoc1.641: %EqWith.assoc_type.14b5be.1 = assoc_entity element1, imports.%Core.import_ref.6e8 [symbolic] +// CHECK:STDOUT: %.fc6: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.e50259.3, %T.75d [symbolic] +// CHECK:STDOUT: %impl.elem1.802: %.fc6 = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.494: = specific_impl_function %impl.elem1.802, @EqWith.WithSelf.NotEqual(%U, %T.75d) [symbolic] +// CHECK:STDOUT: %OrderedWith.type.ca8786.1: type = facet_type <@OrderedWith.1, @OrderedWith.1(%Other)> [symbolic] +// CHECK:STDOUT: %Self.adc9f7.1: %OrderedWith.type.ca8786.1 = symbolic_binding Self, 1 [symbolic] +// CHECK:STDOUT: %OrderedWith.assoc_type.2b366e.1: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%Other) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.975556.1: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.6f28f1.1: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.c82b75.1: %OrderedWith.WithSelf.Greater.type.6f28f1.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.1: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.86efc4.1: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.df27e9.1: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Other, %Self.adc9f7.1) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.1a4163.1: %OrderedWith.WithSelf.Less.type.df27e9.1 = struct_value () [symbolic] +// CHECK:STDOUT: %OrderedWith.type.ca8786.2: type = facet_type <@OrderedWith.1, @OrderedWith.1(%U)> [symbolic] +// CHECK:STDOUT: %pattern_type.d3f: type = pattern_type %OrderedWith.type.ca8786.2 [symbolic] +// CHECK:STDOUT: %T.adc: %OrderedWith.type.ca8786.2 = symbolic_binding T, 1 [symbolic] +// CHECK:STDOUT: %OrderedWith.assoc_type.2b366e.2: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%U) [symbolic] +// CHECK:STDOUT: %assoc0.f6e965.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element0, imports.%Core.import_ref.255 [symbolic] +// CHECK:STDOUT: %assoc1.23402c.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element1, imports.%Core.import_ref.857 [symbolic] +// CHECK:STDOUT: %assoc2.771acd.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element2, imports.%Core.import_ref.a0a [symbolic] +// CHECK:STDOUT: %assoc3.ba2aca.2: %OrderedWith.assoc_type.2b366e.2 = assoc_entity element3, imports.%Core.import_ref.bb2 [symbolic] +// CHECK:STDOUT: %T.as_type.5ac: type = facet_access_type %T.adc [symbolic] +// CHECK:STDOUT: %pattern_type.c70b34.2: type = pattern_type %T.as_type.5ac [symbolic] +// CHECK:STDOUT: %require_complete.3d2: = require_complete_type %OrderedWith.type.ca8786.2 [symbolic] +// CHECK:STDOUT: %assoc0.666: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element0, imports.%Core.import_ref.e2b [symbolic] +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: = lookup_impl_witness %T.adc, @OrderedWith.1, @OrderedWith.1(%U) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.df27e9.3: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.970504.3: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.6f28f1.3: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %.0af: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.df27e9.3, %T.adc [symbolic] +// CHECK:STDOUT: %impl.elem0.544: %.0af = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.072: = specific_impl_function %impl.elem0.544, @OrderedWith.WithSelf.Less(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %assoc1.e40: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element1, imports.%Core.import_ref.ce4 [symbolic] +// CHECK:STDOUT: %.81b: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.970504.3, %T.adc [symbolic] +// CHECK:STDOUT: %impl.elem1.503: %.81b = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.2f8: = specific_impl_function %impl.elem1.503, @OrderedWith.WithSelf.LessOrEquivalent(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %assoc2.b0e: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element2, imports.%Core.import_ref.40e [symbolic] +// CHECK:STDOUT: %.f69: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.6f28f1.3, %T.adc [symbolic] +// CHECK:STDOUT: %impl.elem2: %.f69 = impl_witness_access %OrderedWith.lookup_impl_witness, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1cd: = specific_impl_function %impl.elem2, @OrderedWith.WithSelf.Greater(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %assoc3.078: %OrderedWith.assoc_type.2b366e.1 = assoc_entity element3, imports.%Core.import_ref.a50 [symbolic] +// CHECK:STDOUT: %.206: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3, %T.adc [symbolic] +// CHECK:STDOUT: %impl.elem3: %.206 = impl_witness_access %OrderedWith.lookup_impl_witness, element3 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.b2f: = specific_impl_function %impl.elem3, @OrderedWith.WithSelf.GreaterOrEquivalent(%U, %T.adc) [symbolic] +// CHECK:STDOUT: %DefaultSpaceshipOnly: type = class_type @DefaultSpaceshipOnly [concrete] +// CHECK:STDOUT: %pattern_type.b0d: type = pattern_type %DefaultSpaceshipOnly [concrete] +// CHECK:STDOUT: %ReturnsStrongOrdering: type = class_type @ReturnsStrongOrdering [concrete] +// CHECK:STDOUT: %pattern_type.eea: type = pattern_type %ReturnsStrongOrdering [concrete] +// CHECK:STDOUT: %ReturnsPartialOrdering: type = class_type @ReturnsPartialOrdering [concrete] +// CHECK:STDOUT: %pattern_type.b82: type = pattern_type %ReturnsPartialOrdering [concrete] +// CHECK:STDOUT: %CrossTypeLhs: type = class_type @CrossTypeLhs [concrete] +// CHECK:STDOUT: %pattern_type.8a9: type = pattern_type %CrossTypeLhs [concrete] +// CHECK:STDOUT: %CrossTypeRhs: type = class_type @CrossTypeRhs [concrete] +// CHECK:STDOUT: %pattern_type.217: type = pattern_type %CrossTypeRhs [concrete] +// CHECK:STDOUT: %EqWith.type.d83: type = facet_type <@EqWith.1, @EqWith.1(%DefaultSpaceshipOnly)> [concrete] +// CHECK:STDOUT: %pattern_type.91e: type = pattern_type %EqWith.type.d83 [concrete] +// CHECK:STDOUT: %OrderedWith.type.9d3: type = facet_type <@OrderedWith.1, @OrderedWith.1(%DefaultSpaceshipOnly)> [concrete] +// CHECK:STDOUT: %pattern_type.072: type = pattern_type %OrderedWith.type.9d3 [concrete] +// CHECK:STDOUT: %OrderedWith.type.075: type = facet_type <@OrderedWith.1, @OrderedWith.1(%ReturnsStrongOrdering)> [concrete] +// CHECK:STDOUT: %pattern_type.f88: type = pattern_type %OrderedWith.type.075 [concrete] +// CHECK:STDOUT: %OrderedWith.type.413: type = facet_type <@OrderedWith.1, @OrderedWith.1(%ReturnsPartialOrdering)> [concrete] +// CHECK:STDOUT: %pattern_type.0bb: type = pattern_type %OrderedWith.type.413 [concrete] +// CHECK:STDOUT: %OrderedWith.type.6fd: type = facet_type <@OrderedWith.1, @OrderedWith.1(%CrossTypeRhs)> [concrete] +// CHECK:STDOUT: %pattern_type.757: type = pattern_type %OrderedWith.type.6fd [concrete] +// CHECK:STDOUT: %OrderedWith.type.685: type = facet_type <@OrderedWith.1, @OrderedWith.1(%CrossTypeLhs)> [concrete] +// CHECK:STDOUT: %pattern_type.736: type = pattern_type %OrderedWith.type.685 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.3e8: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc0 (constants.%assoc0.9e2)] +// CHECK:STDOUT: %Core.import_ref.c1e: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc1 (constants.%assoc1.641)] +// CHECK:STDOUT: %Core.import_ref.b99: @EqWith.WithSelf.%EqWith.WithSelf.NotEqual.type (%EqWith.WithSelf.NotEqual.type.e50259.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.NotEqual (constants.%EqWith.WithSelf.NotEqual.ec9479.1)] +// CHECK:STDOUT: %Core.import_ref.30a: @EqWith.WithSelf.%EqWith.WithSelf.Equal.type (%EqWith.WithSelf.Equal.type.838401.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.Equal (constants.%EqWith.WithSelf.Equal.dd9722.1)] +// CHECK:STDOUT: %Core.import_ref.27d = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.6e8 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.7e9: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc0 (constants.%assoc0.666)] +// CHECK:STDOUT: %Core.import_ref.c86: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc1 (constants.%assoc1.e40)] +// CHECK:STDOUT: %Core.import_ref.f4f: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc2 (constants.%assoc2.b0e)] +// CHECK:STDOUT: %Core.import_ref.065: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc3 (constants.%assoc3.078)] +// CHECK:STDOUT: %Core.import_ref.bb2: @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent.type (%OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent (constants.%OrderedWith.WithSelf.GreaterOrEquivalent.975556.1)] +// CHECK:STDOUT: %Core.import_ref.a0a: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater.type (%OrderedWith.WithSelf.Greater.type.6f28f1.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater (constants.%OrderedWith.WithSelf.Greater.c82b75.1)] +// CHECK:STDOUT: %Core.import_ref.857: @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent.type (%OrderedWith.WithSelf.LessOrEquivalent.type.970504.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent (constants.%OrderedWith.WithSelf.LessOrEquivalent.86efc4.1)] +// CHECK:STDOUT: %Core.import_ref.255: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less.type (%OrderedWith.WithSelf.Less.type.df27e9.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less (constants.%OrderedWith.WithSelf.Less.1a4163.1)] +// CHECK:STDOUT: %Core.import_ref.e2b = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.ce4 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.40e = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: %Core.import_ref.a50 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @EqWith.loc4(%U.loc4_12.2: type, %T.loc4_22.2: @EqWith.loc4.%EqWith.type.loc4_38.1 (%EqWith.type.411e55.2)) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %require_complete.loc6: = require_complete_type %EqWith.type.loc4_38.1 [symbolic = %require_complete.loc6 (constants.%require_complete.b51)] +// CHECK:STDOUT: %EqWith.assoc_type: type = assoc_entity_type @EqWith.1, @EqWith.1(%U.loc4_12.1) [symbolic = %EqWith.assoc_type (constants.%EqWith.assoc_type.14b5be.2)] +// CHECK:STDOUT: %assoc0: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = assoc_entity element0, imports.%Core.import_ref.30a [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %EqWith.WithSelf.Equal.type: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%U.loc4_12.1, %T.loc4_22.1) [symbolic = %EqWith.WithSelf.Equal.type (constants.%EqWith.WithSelf.Equal.type.838401.3)] +// CHECK:STDOUT: %.loc6_5.2: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type, %T.loc4_22.1 [symbolic = %.loc6_5.2 (constants.%.5a0)] +// CHECK:STDOUT: %EqWith.lookup_impl_witness: = lookup_impl_witness %T.loc4_22.1, @EqWith.1, @EqWith.1(%U.loc4_12.1) [symbolic = %EqWith.lookup_impl_witness (constants.%EqWith.lookup_impl_witness)] +// CHECK:STDOUT: %impl.elem0.loc6_5.2: @EqWith.loc4.%.loc6_5.2 (%.5a0) = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_5.2 (constants.%impl.elem0.d9c)] +// CHECK:STDOUT: %specific_impl_fn.loc6_5.2: = specific_impl_function %impl.elem0.loc6_5.2, @EqWith.WithSelf.Equal(%U.loc4_12.1, %T.loc4_22.1) [symbolic = %specific_impl_fn.loc6_5.2 (constants.%specific_impl_fn.9eb)] +// CHECK:STDOUT: %assoc1: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = assoc_entity element1, imports.%Core.import_ref.b99 [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%U.loc4_12.1, %T.loc4_22.1) [symbolic = %EqWith.WithSelf.NotEqual.type (constants.%EqWith.WithSelf.NotEqual.type.e50259.3)] +// CHECK:STDOUT: %.loc7_5.2: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type, %T.loc4_22.1 [symbolic = %.loc7_5.2 (constants.%.fc6)] +// CHECK:STDOUT: %impl.elem1.loc7_5.2: @EqWith.loc4.%.loc7_5.2 (%.fc6) = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc7_5.2 (constants.%impl.elem1.802)] +// CHECK:STDOUT: %specific_impl_fn.loc7_5.2: = specific_impl_function %impl.elem1.loc7_5.2, @EqWith.WithSelf.NotEqual(%U.loc4_12.1, %T.loc4_22.1) [symbolic = %specific_impl_fn.loc7_5.2 (constants.%specific_impl_fn.494)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param: @EqWith.loc4.%T.as_type.loc4_44.1 (%T.as_type.300), %y.param: @EqWith.loc4.%U.loc4_12.1 (%U)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc6: @EqWith.loc4.%T.as_type.loc4_44.1 (%T.as_type.300) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc6: @EqWith.loc4.%U.loc4_12.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %EqWith.type.loc6: type = facet_type <@EqWith.1, @EqWith.1(constants.%U)> [symbolic = %EqWith.type.loc4_38.1 (constants.%EqWith.type.411e55.2)] +// CHECK:STDOUT: %.loc6_5.1: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = specific_constant imports.%Core.import_ref.3e8, @EqWith.WithSelf(constants.%U, constants.%Self.75d78e.1) [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %Equal.ref: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = name_ref Equal, %.loc6_5.1 [symbolic = %assoc0 (constants.%assoc0.8eade4.2)] +// CHECK:STDOUT: %impl.elem0.loc6_5.1: @EqWith.loc4.%.loc6_5.2 (%.5a0) = impl_witness_access constants.%EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_5.2 (constants.%impl.elem0.d9c)] +// CHECK:STDOUT: %bound_method.loc6_5.1: = bound_method %x.ref.loc6, %impl.elem0.loc6_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc6_5.1: = specific_impl_function %impl.elem0.loc6_5.1, @EqWith.WithSelf.Equal(constants.%U, constants.%T.75d) [symbolic = %specific_impl_fn.loc6_5.2 (constants.%specific_impl_fn.9eb)] +// CHECK:STDOUT: %bound_method.loc6_5.2: = bound_method %x.ref.loc6, %specific_impl_fn.loc6_5.1 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call: init bool = call %bound_method.loc6_5.2(%x.ref.loc6, %y.ref.loc6) +// CHECK:STDOUT: %x.ref.loc7: @EqWith.loc4.%T.as_type.loc4_44.1 (%T.as_type.300) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc7: @EqWith.loc4.%U.loc4_12.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %EqWith.type.loc7: type = facet_type <@EqWith.1, @EqWith.1(constants.%U)> [symbolic = %EqWith.type.loc4_38.1 (constants.%EqWith.type.411e55.2)] +// CHECK:STDOUT: %.loc7_5.1: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = specific_constant imports.%Core.import_ref.c1e, @EqWith.WithSelf(constants.%U, constants.%Self.75d78e.1) [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %NotEqual.ref: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.14b5be.2) = name_ref NotEqual, %.loc7_5.1 [symbolic = %assoc1 (constants.%assoc1.c6914e.2)] +// CHECK:STDOUT: %impl.elem1.loc7_5.1: @EqWith.loc4.%.loc7_5.2 (%.fc6) = impl_witness_access constants.%EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc7_5.2 (constants.%impl.elem1.802)] +// CHECK:STDOUT: %bound_method.loc7_5.1: = bound_method %x.ref.loc7, %impl.elem1.loc7_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc7_5.1: = specific_impl_function %impl.elem1.loc7_5.1, @EqWith.WithSelf.NotEqual(constants.%U, constants.%T.75d) [symbolic = %specific_impl_fn.loc7_5.2 (constants.%specific_impl_fn.494)] +// CHECK:STDOUT: %bound_method.loc7_5.2: = bound_method %x.ref.loc7, %specific_impl_fn.loc7_5.1 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call: init bool = call %bound_method.loc7_5.2(%x.ref.loc7, %y.ref.loc7) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @OrderedWith.loc11(%U.loc11_17.2: type, %T.loc11_27.2: @OrderedWith.loc11.%OrderedWith.type.loc11_48.1 (%OrderedWith.type.ca8786.2)) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %require_complete.loc13: = require_complete_type %OrderedWith.type.loc11_48.1 [symbolic = %require_complete.loc13 (constants.%require_complete.3d2)] +// CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%U.loc11_17.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.2b366e.2)] +// CHECK:STDOUT: %assoc0: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element0, imports.%Core.import_ref.255 [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %OrderedWith.WithSelf.Less.type (constants.%OrderedWith.WithSelf.Less.type.df27e9.3)] +// CHECK:STDOUT: %.loc13_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type, %T.loc11_27.1 [symbolic = %.loc13_5.2 (constants.%.0af)] +// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: = lookup_impl_witness %T.loc11_27.1, @OrderedWith.1, @OrderedWith.1(%U.loc11_17.1) [symbolic = %OrderedWith.lookup_impl_witness (constants.%OrderedWith.lookup_impl_witness)] +// CHECK:STDOUT: %impl.elem0.loc13_5.2: @OrderedWith.loc11.%.loc13_5.2 (%.0af) = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_5.2 (constants.%impl.elem0.544)] +// CHECK:STDOUT: %specific_impl_fn.loc13_5.2: = specific_impl_function %impl.elem0.loc13_5.2, @OrderedWith.WithSelf.Less(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %specific_impl_fn.loc13_5.2 (constants.%specific_impl_fn.072)] +// CHECK:STDOUT: %assoc1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element1, imports.%Core.import_ref.857 [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %OrderedWith.WithSelf.LessOrEquivalent.type (constants.%OrderedWith.WithSelf.LessOrEquivalent.type.970504.3)] +// CHECK:STDOUT: %.loc14_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type, %T.loc11_27.1 [symbolic = %.loc14_5.2 (constants.%.81b)] +// CHECK:STDOUT: %impl.elem1.loc14_5.2: @OrderedWith.loc11.%.loc14_5.2 (%.81b) = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc14_5.2 (constants.%impl.elem1.503)] +// CHECK:STDOUT: %specific_impl_fn.loc14_5.2: = specific_impl_function %impl.elem1.loc14_5.2, @OrderedWith.WithSelf.LessOrEquivalent(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %specific_impl_fn.loc14_5.2 (constants.%specific_impl_fn.2f8)] +// CHECK:STDOUT: %assoc2: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element2, imports.%Core.import_ref.a0a [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %OrderedWith.WithSelf.Greater.type (constants.%OrderedWith.WithSelf.Greater.type.6f28f1.3)] +// CHECK:STDOUT: %.loc15_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type, %T.loc11_27.1 [symbolic = %.loc15_5.2 (constants.%.f69)] +// CHECK:STDOUT: %impl.elem2.loc15_5.2: @OrderedWith.loc11.%.loc15_5.2 (%.f69) = impl_witness_access %OrderedWith.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc15_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc15_5.2: = specific_impl_function %impl.elem2.loc15_5.2, @OrderedWith.WithSelf.Greater(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %specific_impl_fn.loc15_5.2 (constants.%specific_impl_fn.1cd)] +// CHECK:STDOUT: %assoc3: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = assoc_entity element3, imports.%Core.import_ref.bb2 [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %OrderedWith.WithSelf.GreaterOrEquivalent.type (constants.%OrderedWith.WithSelf.GreaterOrEquivalent.type.9696d2.3)] +// CHECK:STDOUT: %.loc16_5.2: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type, %T.loc11_27.1 [symbolic = %.loc16_5.2 (constants.%.206)] +// CHECK:STDOUT: %impl.elem3.loc16_5.2: @OrderedWith.loc11.%.loc16_5.2 (%.206) = impl_witness_access %OrderedWith.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc16_5.2 (constants.%impl.elem3)] +// CHECK:STDOUT: %specific_impl_fn.loc16_5.2: = specific_impl_function %impl.elem3.loc16_5.2, @OrderedWith.WithSelf.GreaterOrEquivalent(%U.loc11_17.1, %T.loc11_27.1) [symbolic = %specific_impl_fn.loc16_5.2 (constants.%specific_impl_fn.b2f)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%x.param: @OrderedWith.loc11.%T.as_type.loc11_54.1 (%T.as_type.5ac), %y.param: @OrderedWith.loc11.%U.loc11_17.1 (%U)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref.loc13: @OrderedWith.loc11.%T.as_type.loc11_54.1 (%T.as_type.5ac) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc13: @OrderedWith.loc11.%U.loc11_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc13: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc11_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc13_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.7e9, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %Less.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref Less, %.loc13_5.1 [symbolic = %assoc0 (constants.%assoc0.f6e965.2)] +// CHECK:STDOUT: %impl.elem0.loc13_5.1: @OrderedWith.loc11.%.loc13_5.2 (%.0af) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_5.2 (constants.%impl.elem0.544)] +// CHECK:STDOUT: %bound_method.loc13_5.1: = bound_method %x.ref.loc13, %impl.elem0.loc13_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc13_5.1: = specific_impl_function %impl.elem0.loc13_5.1, @OrderedWith.WithSelf.Less(constants.%U, constants.%T.adc) [symbolic = %specific_impl_fn.loc13_5.2 (constants.%specific_impl_fn.072)] +// CHECK:STDOUT: %bound_method.loc13_5.2: = bound_method %x.ref.loc13, %specific_impl_fn.loc13_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call: init bool = call %bound_method.loc13_5.2(%x.ref.loc13, %y.ref.loc13) +// CHECK:STDOUT: %x.ref.loc14: @OrderedWith.loc11.%T.as_type.loc11_54.1 (%T.as_type.5ac) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc14: @OrderedWith.loc11.%U.loc11_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc14: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc11_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc14_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.c86, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %LessOrEquivalent.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref LessOrEquivalent, %.loc14_5.1 [symbolic = %assoc1 (constants.%assoc1.23402c.2)] +// CHECK:STDOUT: %impl.elem1.loc14_5.1: @OrderedWith.loc11.%.loc14_5.2 (%.81b) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc14_5.2 (constants.%impl.elem1.503)] +// CHECK:STDOUT: %bound_method.loc14_5.1: = bound_method %x.ref.loc14, %impl.elem1.loc14_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc14_5.1: = specific_impl_function %impl.elem1.loc14_5.1, @OrderedWith.WithSelf.LessOrEquivalent(constants.%U, constants.%T.adc) [symbolic = %specific_impl_fn.loc14_5.2 (constants.%specific_impl_fn.2f8)] +// CHECK:STDOUT: %bound_method.loc14_5.2: = bound_method %x.ref.loc14, %specific_impl_fn.loc14_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call: init bool = call %bound_method.loc14_5.2(%x.ref.loc14, %y.ref.loc14) +// CHECK:STDOUT: %x.ref.loc15: @OrderedWith.loc11.%T.as_type.loc11_54.1 (%T.as_type.5ac) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc15: @OrderedWith.loc11.%U.loc11_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc15: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc11_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc15_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.f4f, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %Greater.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref Greater, %.loc15_5.1 [symbolic = %assoc2 (constants.%assoc2.771acd.2)] +// CHECK:STDOUT: %impl.elem2.loc15_5.1: @OrderedWith.loc11.%.loc15_5.2 (%.f69) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc15_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc15_5.1: = bound_method %x.ref.loc15, %impl.elem2.loc15_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc15_5.1: = specific_impl_function %impl.elem2.loc15_5.1, @OrderedWith.WithSelf.Greater(constants.%U, constants.%T.adc) [symbolic = %specific_impl_fn.loc15_5.2 (constants.%specific_impl_fn.1cd)] +// CHECK:STDOUT: %bound_method.loc15_5.2: = bound_method %x.ref.loc15, %specific_impl_fn.loc15_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call: init bool = call %bound_method.loc15_5.2(%x.ref.loc15, %y.ref.loc15) +// CHECK:STDOUT: %x.ref.loc16: @OrderedWith.loc11.%T.as_type.loc11_54.1 (%T.as_type.5ac) = name_ref x, %x +// CHECK:STDOUT: %y.ref.loc16: @OrderedWith.loc11.%U.loc11_17.1 (%U) = name_ref y, %y +// CHECK:STDOUT: %OrderedWith.type.loc16: type = facet_type <@OrderedWith.1, @OrderedWith.1(constants.%U)> [symbolic = %OrderedWith.type.loc11_48.1 (constants.%OrderedWith.type.ca8786.2)] +// CHECK:STDOUT: %.loc16_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = specific_constant imports.%Core.import_ref.065, @OrderedWith.WithSelf(constants.%U, constants.%Self.adc9f7.1) [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %GreaterOrEquivalent.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.2b366e.2) = name_ref GreaterOrEquivalent, %.loc16_5.1 [symbolic = %assoc3 (constants.%assoc3.ba2aca.2)] +// CHECK:STDOUT: %impl.elem3.loc16_5.1: @OrderedWith.loc11.%.loc16_5.2 (%.206) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc16_5.2 (constants.%impl.elem3)] +// CHECK:STDOUT: %bound_method.loc16_5.1: = bound_method %x.ref.loc16, %impl.elem3.loc16_5.1 +// CHECK:STDOUT: %specific_impl_fn.loc16_5.1: = specific_impl_function %impl.elem3.loc16_5.1, @OrderedWith.WithSelf.GreaterOrEquivalent(constants.%U, constants.%T.adc) [symbolic = %specific_impl_fn.loc16_5.2 (constants.%specific_impl_fn.b2f)] +// CHECK:STDOUT: %bound_method.loc16_5.2: = bound_method %x.ref.loc16, %specific_impl_fn.loc16_5.1 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call: init bool = call %bound_method.loc16_5.2(%x.ref.loc16, %y.ref.loc16) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc4(constants.%U, constants.%T.75d) { +// CHECK:STDOUT: %U.loc4_12.1 => constants.%U +// CHECK:STDOUT: %EqWith.type.loc4_38.1 => constants.%EqWith.type.411e55.2 +// CHECK:STDOUT: %T.loc4_22.1 => constants.%T.75d +// CHECK:STDOUT: %pattern_type.loc4_22 => constants.%pattern_type.548 +// CHECK:STDOUT: %T.as_type.loc4_44.1 => constants.%T.as_type.300 +// CHECK:STDOUT: %pattern_type.loc4_42 => constants.%pattern_type.5dd0fd.2 +// CHECK:STDOUT: %pattern_type.loc4_48 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%U, constants.%T.adc) { +// CHECK:STDOUT: %U.loc11_17.1 => constants.%U +// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.ca8786.2 +// CHECK:STDOUT: %T.loc11_27.1 => constants.%T.adc +// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.d3f +// CHECK:STDOUT: %T.as_type.loc11_54.1 => constants.%T.as_type.5ac +// CHECK:STDOUT: %pattern_type.loc11_52 => constants.%pattern_type.c70b34.2 +// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.51d1c4.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @EqWith.loc4(constants.%DefaultSpaceshipOnly, ) { +// CHECK:STDOUT: %U.loc4_12.1 => constants.%DefaultSpaceshipOnly +// CHECK:STDOUT: %EqWith.type.loc4_38.1 => constants.%EqWith.type.d83 +// CHECK:STDOUT: %T.loc4_22.1 => +// CHECK:STDOUT: %pattern_type.loc4_22 => constants.%pattern_type.91e +// CHECK:STDOUT: %T.as_type.loc4_44.1 => +// CHECK:STDOUT: %pattern_type.loc4_42 => +// CHECK:STDOUT: %pattern_type.loc4_48 => constants.%pattern_type.b0d +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%DefaultSpaceshipOnly, ) { +// CHECK:STDOUT: %U.loc11_17.1 => constants.%DefaultSpaceshipOnly +// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.9d3 +// CHECK:STDOUT: %T.loc11_27.1 => +// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.072 +// CHECK:STDOUT: %T.as_type.loc11_54.1 => +// CHECK:STDOUT: %pattern_type.loc11_52 => +// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.b0d +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%ReturnsStrongOrdering, ) { +// CHECK:STDOUT: %U.loc11_17.1 => constants.%ReturnsStrongOrdering +// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.075 +// CHECK:STDOUT: %T.loc11_27.1 => +// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.f88 +// CHECK:STDOUT: %T.as_type.loc11_54.1 => +// CHECK:STDOUT: %pattern_type.loc11_52 => +// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.eea +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%ReturnsPartialOrdering, ) { +// CHECK:STDOUT: %U.loc11_17.1 => constants.%ReturnsPartialOrdering +// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.413 +// CHECK:STDOUT: %T.loc11_27.1 => +// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.0bb +// CHECK:STDOUT: %T.as_type.loc11_54.1 => +// CHECK:STDOUT: %pattern_type.loc11_52 => +// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.b82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%CrossTypeRhs, ) { +// CHECK:STDOUT: %U.loc11_17.1 => constants.%CrossTypeRhs +// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.6fd +// CHECK:STDOUT: %T.loc11_27.1 => +// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.757 +// CHECK:STDOUT: %T.as_type.loc11_54.1 => +// CHECK:STDOUT: %pattern_type.loc11_52 => +// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.217 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%CrossTypeLhs, ) { +// CHECK:STDOUT: %U.loc11_17.1 => constants.%CrossTypeLhs +// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.685 +// CHECK:STDOUT: %T.loc11_27.1 => +// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.736 +// CHECK:STDOUT: %T.as_type.loc11_54.1 => +// CHECK:STDOUT: %pattern_type.loc11_52 => +// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.8a9 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/operators.carbon b/toolchain/lower/testdata/interop/cpp/operators.carbon new file mode 100644 index 000000000000..e839e38cf840 --- /dev/null +++ b/toolchain/lower/testdata/interop/cpp/operators.carbon @@ -0,0 +1,623 @@ +// 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: toolchain/testing/testdata/min_prelude/full.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/operators.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/operators.carbon + +// --- eq_with.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct A { + int value; + + friend auto operator==(A x, A y) -> bool { + return x.value == y.value; + } + + friend auto operator!=(A x, A y) -> bool { + return !(x == y); + } +}; +'''; + +fn CheckEqWith[U:! type, T:! Core.EqWith(U)](x: T, y: U) { + x == y; + x != y; +} + +fn Driver(x: Cpp.A, y: Cpp.A) { + CheckEqWith(x, y); +} + +// --- ordered_with.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +struct A { + int value; + + friend auto operator<(A x, A y) -> bool { + return x.value < y.value; + } + + friend auto operator>(A x, A y) -> bool { + return y < x; + } + + friend auto operator<=(A x, A y) -> bool { + return !(y < x); + } + + friend auto operator>=(A x, A y) -> bool { + return !(x < y); + } +}; +'''; + +fn CheckOrderedWith[U:! type, T:! Core.OrderedWith(U)](x: T, y: U) { + x < y; + x > y; + x <= y; + x >= y; +} + +fn Driver(x: Cpp.A, y: Cpp.A) { + CheckOrderedWith(x, y); +} + +// CHECK:STDOUT: ; ModuleID = 'eq_with.carbon' +// CHECK:STDOUT: source_filename = "eq_with.carbon" +// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" +// CHECK:STDOUT: +// CHECK:STDOUT: %struct.A = type { i32 } +// CHECK:STDOUT: +// CHECK:STDOUT: $_Zeq1AS_ = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: $_Zne1AS_ = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CCheckEqWith.Main.795833dfa91e6085(ptr %x, ptr %y), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Zeq1AS_.carbon_thunk(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x.addr = alloca ptr, align 8 +// CHECK:STDOUT: %y.addr = alloca ptr, align 8 +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 +// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zeq1AS_(i32 %3, i32 %4) +// CHECK:STDOUT: %storedv = zext i1 %call to i8 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Zne1AS_.carbon_thunk(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x.addr = alloca ptr, align 8 +// CHECK:STDOUT: %y.addr = alloca ptr, align 8 +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 +// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zne1AS_(i32 %3, i32 %4) +// CHECK:STDOUT: %storedv = zext i1 %call to i8 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.95dfad7558f19bf5.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !28 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !34 +// CHECK:STDOUT: call void @_Zeq1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !34 +// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !34 +// CHECK:STDOUT: ret i1 %0, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.95dfad7558f19bf5.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !39 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !39 +// CHECK:STDOUT: call void @_Zne1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !39 +// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !39 +// CHECK:STDOUT: ret i1 %0, !dbg !39 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CCheckEqWith.Main.795833dfa91e6085(ptr %x, ptr %y) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.95dfad7558f19bf5.Core:Cpp"(ptr %x, ptr %y), !dbg !44 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call = call i1 @"_CNotEqual:thunk:EqWith.95dfad7558f19bf5.Core:Cpp"(ptr %x, ptr %y), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zeq1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x = alloca %struct.A, align 4 +// CHECK:STDOUT: %y = alloca %struct.A, align 4 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 +// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !47 +// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !47 +// CHECK:STDOUT: %cmp = icmp eq i32 %0, %1 +// CHECK:STDOUT: ret i1 %cmp +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #5 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zne1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x = alloca %struct.A, align 4 +// CHECK:STDOUT: %y = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 +// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 +// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zeq1AS_(i32 %0, i32 %1) +// CHECK:STDOUT: %lnot = xor i1 %call, true +// CHECK:STDOUT: ret i1 %lnot +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 0, 1, 5, 4, 3, 2 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #2 = { alwaysinline nounwind } +// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4} +// CHECK:STDOUT: !llvm.dbg.cu = !{!5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!7} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !6 = !DIFile(filename: "eq_with.carbon", directory: "") +// CHECK:STDOUT: !7 = !{!8, !8, i64 0} +// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !6, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !15) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !14, !14} +// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !15 = !{!16, !17} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 2, scope: !11, type: !14) +// CHECK:STDOUT: !18 = !DILocation(line: 24, column: 3, scope: !11) +// CHECK:STDOUT: !19 = !DILocation(line: 23, column: 1, scope: !11) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} +// CHECK:STDOUT: !23 = !{!24, !24, i64 0} +// CHECK:STDOUT: !24 = !{!"p1 bool", !22, i64 0} +// CHECK:STDOUT: !25 = !{i64 0, i64 4, !7} +// CHECK:STDOUT: !26 = !{!27, !27, i64 0} +// CHECK:STDOUT: !27 = !{!"bool", !9, i64 0} +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.95dfad7558f19bf5.Core:Cpp", scope: null, file: !6, line: 8, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{!14, !14, !14} +// CHECK:STDOUT: !31 = !{!32, !33} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !14) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !28, type: !14) +// CHECK:STDOUT: !34 = !DILocation(line: 8, column: 15, scope: !28) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.95dfad7558f19bf5.Core:Cpp", scope: null, file: !6, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) +// CHECK:STDOUT: !36 = !{!37, !38} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !14) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 2, scope: !35, type: !14) +// CHECK:STDOUT: !39 = !DILocation(line: 12, column: 15, scope: !35) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "CheckEqWith", linkageName: "_CCheckEqWith.Main.795833dfa91e6085", scope: null, file: !6, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42, !43} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !14) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 2, scope: !40, type: !14) +// CHECK:STDOUT: !44 = !DILocation(line: 19, column: 3, scope: !40) +// CHECK:STDOUT: !45 = !DILocation(line: 20, column: 3, scope: !40) +// CHECK:STDOUT: !46 = !DILocation(line: 18, column: 1, scope: !40) +// CHECK:STDOUT: !47 = !{!48, !8, i64 0} +// CHECK:STDOUT: !48 = !{!"_ZTS1A", !8, i64 0} +// CHECK:STDOUT: ; ModuleID = 'ordered_with.carbon' +// CHECK:STDOUT: source_filename = "ordered_with.carbon" +// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" +// CHECK:STDOUT: +// CHECK:STDOUT: %struct.A = type { i32 } +// CHECK:STDOUT: +// CHECK:STDOUT: $_Zlt1AS_ = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: $_Zle1AS_ = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: $_Zgt1AS_ = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: $_Zge1AS_ = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !11 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CCheckOrderedWith.Main.2434026e6d8bb659(ptr %x, ptr %y), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Zlt1AS_.carbon_thunk(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x.addr = alloca ptr, align 8 +// CHECK:STDOUT: %y.addr = alloca ptr, align 8 +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 +// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %3, i32 %4) +// CHECK:STDOUT: %storedv = zext i1 %call to i8 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Zle1AS_.carbon_thunk(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x.addr = alloca ptr, align 8 +// CHECK:STDOUT: %y.addr = alloca ptr, align 8 +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 +// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zle1AS_(i32 %3, i32 %4) +// CHECK:STDOUT: %storedv = zext i1 %call to i8 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Zgt1AS_.carbon_thunk(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x.addr = alloca ptr, align 8 +// CHECK:STDOUT: %y.addr = alloca ptr, align 8 +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 +// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zgt1AS_(i32 %3, i32 %4) +// CHECK:STDOUT: %storedv = zext i1 %call to i8 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Zge1AS_.carbon_thunk(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x.addr = alloca ptr, align 8 +// CHECK:STDOUT: %y.addr = alloca ptr, align 8 +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 +// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zge1AS_(i32 %3, i32 %4) +// CHECK:STDOUT: %storedv = zext i1 %call to i8 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define i1 @"_CLess:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !28 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !34 +// CHECK:STDOUT: call void @_Zlt1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !34 +// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !34 +// CHECK:STDOUT: ret i1 %0, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define i1 @"_CLessOrEquivalent:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !39 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !39 +// CHECK:STDOUT: call void @_Zle1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !39 +// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !39 +// CHECK:STDOUT: ret i1 %0, !dbg !39 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define i1 @"_CGreater:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !44 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !44 +// CHECK:STDOUT: call void @_Zgt1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !44 +// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !44 +// CHECK:STDOUT: ret i1 %0, !dbg !44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !49 +// CHECK:STDOUT: call void @_Zge1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !49 +// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !49 +// CHECK:STDOUT: ret i1 %0, !dbg !49 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CCheckOrderedWith.Main.2434026e6d8bb659(ptr %x, ptr %y) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call = call i1 @"_CLess:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %x, ptr %y), !dbg !54 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call = call i1 @"_CGreater:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %x, ptr %y), !dbg !55 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call = call i1 @"_CLessOrEquivalent:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %x, ptr %y), !dbg !56 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call = call i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.c93a46d484590772.Core:Cpp"(ptr %x, ptr %y), !dbg !57 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zlt1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x = alloca %struct.A, align 4 +// CHECK:STDOUT: %y = alloca %struct.A, align 4 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 +// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !59 +// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !59 +// CHECK:STDOUT: %cmp = icmp slt i32 %0, %1 +// CHECK:STDOUT: ret i1 %cmp +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #5 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zle1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x = alloca %struct.A, align 4 +// CHECK:STDOUT: %y = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 +// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 +// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1) +// CHECK:STDOUT: %lnot = xor i1 %call, true +// CHECK:STDOUT: ret i1 %lnot +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zgt1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x = alloca %struct.A, align 4 +// CHECK:STDOUT: %y = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 +// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 +// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1) +// CHECK:STDOUT: ret i1 %call +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zge1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x = alloca %struct.A, align 4 +// CHECK:STDOUT: %y = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 +// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4 +// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 +// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 +// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 +// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 +// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 +// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 +// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4 +// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1) +// CHECK:STDOUT: %lnot = xor i1 %call, true +// CHECK:STDOUT: ret i1 %lnot +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 0, 1, 4, 5, 8, 9, 13, 12, 11, 10, 7, 6, 3, 2 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #2 = { alwaysinline nounwind } +// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4} +// CHECK:STDOUT: !llvm.dbg.cu = !{!5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!7} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !6 = !DIFile(filename: "ordered_with.carbon", directory: "") +// CHECK:STDOUT: !7 = !{!8, !8, i64 0} +// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !6, line: 33, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !15) +// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) +// CHECK:STDOUT: !13 = !{null, !14, !14} +// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !15 = !{!16, !17} +// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 2, scope: !11, type: !14) +// CHECK:STDOUT: !18 = !DILocation(line: 34, column: 3, scope: !11) +// CHECK:STDOUT: !19 = !DILocation(line: 33, column: 1, scope: !11) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} +// CHECK:STDOUT: !23 = !{!24, !24, i64 0} +// CHECK:STDOUT: !24 = !{!"p1 bool", !22, i64 0} +// CHECK:STDOUT: !25 = !{i64 0, i64 4, !7} +// CHECK:STDOUT: !26 = !{!27, !27, i64 0} +// CHECK:STDOUT: !27 = !{!"bool", !9, i64 0} +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Less", linkageName: "_CLess:thunk:OrderedWith.c93a46d484590772.Core:Cpp", scope: null, file: !6, line: 8, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{!14, !14, !14} +// CHECK:STDOUT: !31 = !{!32, !33} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !14) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !28, type: !14) +// CHECK:STDOUT: !34 = !DILocation(line: 8, column: 15, scope: !28) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "LessOrEquivalent", linkageName: "_CLessOrEquivalent:thunk:OrderedWith.c93a46d484590772.Core:Cpp", scope: null, file: !6, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) +// CHECK:STDOUT: !36 = !{!37, !38} +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !14) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 2, scope: !35, type: !14) +// CHECK:STDOUT: !39 = !DILocation(line: 16, column: 15, scope: !35) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Greater", linkageName: "_CGreater:thunk:OrderedWith.c93a46d484590772.Core:Cpp", scope: null, file: !6, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42, !43} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !14) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 2, scope: !40, type: !14) +// CHECK:STDOUT: !44 = !DILocation(line: 12, column: 15, scope: !40) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "GreaterOrEquivalent", linkageName: "_CGreaterOrEquivalent:thunk:OrderedWith.c93a46d484590772.Core:Cpp", scope: null, file: !6, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47, !48} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !14) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 2, scope: !45, type: !14) +// CHECK:STDOUT: !49 = !DILocation(line: 20, column: 15, scope: !45) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "CheckOrderedWith", linkageName: "_CCheckOrderedWith.Main.2434026e6d8bb659", scope: null, file: !6, line: 26, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !51 = !{!52, !53} +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !50, type: !14) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 2, scope: !50, type: !14) +// CHECK:STDOUT: !54 = !DILocation(line: 27, column: 3, scope: !50) +// CHECK:STDOUT: !55 = !DILocation(line: 28, column: 3, scope: !50) +// CHECK:STDOUT: !56 = !DILocation(line: 29, column: 3, scope: !50) +// CHECK:STDOUT: !57 = !DILocation(line: 30, column: 3, scope: !50) +// CHECK:STDOUT: !58 = !DILocation(line: 26, column: 1, scope: !50) +// CHECK:STDOUT: !59 = !{!60, !8, i64 0} +// CHECK:STDOUT: !60 = !{!"_ZTS1A", !8, i64 0} diff --git a/toolchain/sem_ir/core_interface_kind.def b/toolchain/sem_ir/core_interface_kind.def index 098bed023697..2cd1b7525911 100644 --- a/toolchain/sem_ir/core_interface_kind.def +++ b/toolchain/sem_ir/core_interface_kind.def @@ -25,6 +25,7 @@ CARBON_SEM_IR_CORE_INTERFACE_KIND(Default) CARBON_SEM_IR_CORE_INTERFACE_KIND(Destroy) CARBON_SEM_IR_CORE_INTERFACE_KIND(DivAssignWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(DivWith) +CARBON_SEM_IR_CORE_INTERFACE_KIND(EqWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(Inc) CARBON_SEM_IR_CORE_INTERFACE_KIND(IntFitsIn) CARBON_SEM_IR_CORE_INTERFACE_KIND(ModAssignWith) @@ -32,6 +33,7 @@ CARBON_SEM_IR_CORE_INTERFACE_KIND(ModWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(MulAssignWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(MulWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(Negate) +CARBON_SEM_IR_CORE_INTERFACE_KIND(OrderedWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(SubAssignWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(SubWith) @@ -39,5 +41,6 @@ CARBON_SEM_IR_CORE_INTERFACE_KIND(SubWith) CARBON_SEM_IR_CORE_INTERFACE_KIND(Unknown) #endif // CARBON_SEM_IR_CORE_INTERFACE_EXCLUDE_UNKNOWN +#undef CARBON_SEM_IR_CORE_INTERFACE_EXCLUDE_UNKNOWN #undef CARBON_SEM_IR_CORE_INTERFACE_KIND #undef CARBON_SEM_IR_CORE_INTERFACE_EXCLUDE_UNKNOWN