Files
carbon-lang/toolchain/check/testdata/interop/cpp/operators/spaceship.carbon
T
Chandler CarruthandChristopher Di Bella 8a59f2a76b Fix mangling collision for C++ class template specializations (#7269)
Carbon-side thunks (for example the `Copy`/`Destroy` witness thunks
generated for imported C++ types) are mangled by Carbon, and their names
incorporate a fingerprint of the involved types. The instruction
fingerprinter identifies a class only by its name and parent scope,
which is sufficient for Carbon classes but not for imported C++ classes:
different specializations of one class template (and other cases such as
types in anonymous namespaces) share a Carbon name and parent scope. As
a result, the thunks for two distinct specializations could mangle to
the same name, producing a single LLVM function with two definitions and
failing `verifyModule` during lowering.

When fingerprinting a class imported from C++, also include the Clang
mangled name of its type.

Test: toolchain/lower/testdata/interop/cpp/thunks.carbon gains a split
with two specializations of one class template, each requiring a thunk;
their thunks now get distinct mangled names instead of colliding.

Assisted-by: Claude Code

---------

Co-authored-by: Christopher Di Bella <cjdb.ns@gmail.com>
2026-05-30 08:13:00 +00:00

550 lines
50 KiB
Plaintext

// 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.1790d7.1: type = facet_type <@EqWith.1, @EqWith.1(%Other)> [symbolic]
// CHECK:STDOUT: %Self.7839ed.1: %EqWith.type.1790d7.1 = symbolic_binding Self, 1 [symbolic]
// CHECK:STDOUT: %EqWith.assoc_type.efa4d1.1: type = assoc_entity_type @EqWith.1, @EqWith.1(%Other) [symbolic]
// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.d0da48.1: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%Other, %Self.7839ed.1) [symbolic]
// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.f72b2f.1: %EqWith.WithSelf.NotEqual.type.d0da48.1 = struct_value () [symbolic]
// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.c6aebf.1: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%Other, %Self.7839ed.1) [symbolic]
// CHECK:STDOUT: %EqWith.WithSelf.Equal.b440b7.1: %EqWith.WithSelf.Equal.type.c6aebf.1 = struct_value () [symbolic]
// CHECK:STDOUT: %EqWith.type.1790d7.2: type = facet_type <@EqWith.1, @EqWith.1(%U)> [symbolic]
// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %EqWith.type.1790d7.2 [symbolic]
// CHECK:STDOUT: %T.783: %EqWith.type.1790d7.2 = symbolic_binding T, 1 [symbolic]
// CHECK:STDOUT: %EqWith.assoc_type.efa4d1.2: type = assoc_entity_type @EqWith.1, @EqWith.1(%U) [symbolic]
// CHECK:STDOUT: %assoc0.5e77ba.2: %EqWith.assoc_type.efa4d1.2 = assoc_entity element0, imports.%Core.import_ref.5f3 [symbolic]
// CHECK:STDOUT: %assoc1.7b7afb.2: %EqWith.assoc_type.efa4d1.2 = assoc_entity element1, imports.%Core.import_ref.515 [symbolic]
// CHECK:STDOUT: %T.as_type.c92: type = facet_access_type %T.783 [symbolic]
// CHECK:STDOUT: %pattern_type.96b8c1.2: type = pattern_type %T.as_type.c92 [symbolic]
// CHECK:STDOUT: %pattern_type.51d1c4.2: type = pattern_type %U [symbolic]
// CHECK:STDOUT: %require_complete.d87: <witness> = require_complete_type %EqWith.type.1790d7.2 [symbolic]
// CHECK:STDOUT: %assoc0.b78: %EqWith.assoc_type.efa4d1.1 = assoc_entity element0, imports.%Core.import_ref.c6b [symbolic]
// CHECK:STDOUT: %EqWith.lookup_impl_witness: <witness> = lookup_impl_witness %T.783, @EqWith.1, @EqWith.1(%U) [symbolic]
// CHECK:STDOUT: %EqWith.WithSelf.Equal.type.c6aebf.3: type = fn_type @EqWith.WithSelf.Equal, @EqWith.WithSelf(%U, %T.783) [symbolic]
// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.type.d0da48.3: type = fn_type @EqWith.WithSelf.NotEqual, @EqWith.WithSelf(%U, %T.783) [symbolic]
// CHECK:STDOUT: %.10a: type = fn_type_with_self_type %EqWith.WithSelf.Equal.type.c6aebf.3, %T.783 [symbolic]
// CHECK:STDOUT: %impl.elem0.734: %.10a = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic]
// CHECK:STDOUT: %specific_impl_fn.b75: <specific function> = specific_impl_function %impl.elem0.734, @EqWith.WithSelf.Equal(%U, %T.783) [symbolic]
// CHECK:STDOUT: %assoc1.579: %EqWith.assoc_type.efa4d1.1 = assoc_entity element1, imports.%Core.import_ref.4af [symbolic]
// CHECK:STDOUT: %.2bb: type = fn_type_with_self_type %EqWith.WithSelf.NotEqual.type.d0da48.3, %T.783 [symbolic]
// CHECK:STDOUT: %impl.elem1.f69: %.2bb = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic]
// CHECK:STDOUT: %specific_impl_fn.bc2: <specific function> = specific_impl_function %impl.elem1.f69, @EqWith.WithSelf.NotEqual(%U, %T.783) [symbolic]
// CHECK:STDOUT: %OrderedWith.type.1ce6d7.1: type = facet_type <@OrderedWith.1, @OrderedWith.1(%Other)> [symbolic]
// CHECK:STDOUT: %Self.5899f7.1: %OrderedWith.type.1ce6d7.1 = symbolic_binding Self, 1 [symbolic]
// CHECK:STDOUT: %OrderedWith.assoc_type.72f2ab.1: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%Other) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.cd7ce3.1: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.5899f7.1) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.433a82.1: %OrderedWith.WithSelf.GreaterOrEquivalent.type.cd7ce3.1 = struct_value () [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.8e8d9f.1: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%Other, %Self.5899f7.1) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.4b40f6.1: %OrderedWith.WithSelf.Greater.type.8e8d9f.1 = struct_value () [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.8f86f8.1: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%Other, %Self.5899f7.1) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.cf3f1c.1: %OrderedWith.WithSelf.LessOrEquivalent.type.8f86f8.1 = struct_value () [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.0103c6.1: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Other, %Self.5899f7.1) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.Less.828cee.1: %OrderedWith.WithSelf.Less.type.0103c6.1 = struct_value () [symbolic]
// CHECK:STDOUT: %OrderedWith.type.1ce6d7.2: type = facet_type <@OrderedWith.1, @OrderedWith.1(%U)> [symbolic]
// CHECK:STDOUT: %pattern_type.9c4: type = pattern_type %OrderedWith.type.1ce6d7.2 [symbolic]
// CHECK:STDOUT: %T.589: %OrderedWith.type.1ce6d7.2 = symbolic_binding T, 1 [symbolic]
// CHECK:STDOUT: %OrderedWith.assoc_type.72f2ab.2: type = assoc_entity_type @OrderedWith.1, @OrderedWith.1(%U) [symbolic]
// CHECK:STDOUT: %assoc0.76ced5.2: %OrderedWith.assoc_type.72f2ab.2 = assoc_entity element0, imports.%Core.import_ref.250 [symbolic]
// CHECK:STDOUT: %assoc1.248efd.2: %OrderedWith.assoc_type.72f2ab.2 = assoc_entity element1, imports.%Core.import_ref.af2 [symbolic]
// CHECK:STDOUT: %assoc2.cac9ed.2: %OrderedWith.assoc_type.72f2ab.2 = assoc_entity element2, imports.%Core.import_ref.ece [symbolic]
// CHECK:STDOUT: %assoc3.9908c2.2: %OrderedWith.assoc_type.72f2ab.2 = assoc_entity element3, imports.%Core.import_ref.bcf [symbolic]
// CHECK:STDOUT: %T.as_type.9c1: type = facet_access_type %T.589 [symbolic]
// CHECK:STDOUT: %pattern_type.2e7263.2: type = pattern_type %T.as_type.9c1 [symbolic]
// CHECK:STDOUT: %require_complete.028: <witness> = require_complete_type %OrderedWith.type.1ce6d7.2 [symbolic]
// CHECK:STDOUT: %assoc0.d47: %OrderedWith.assoc_type.72f2ab.1 = assoc_entity element0, imports.%Core.import_ref.516 [symbolic]
// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: <witness> = lookup_impl_witness %T.589, @OrderedWith.1, @OrderedWith.1(%U) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.0103c6.3: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%U, %T.589) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.8f86f8.3: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%U, %T.589) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.8e8d9f.3: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%U, %T.589) [symbolic]
// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.cd7ce3.3: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%U, %T.589) [symbolic]
// CHECK:STDOUT: %.e72: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.0103c6.3, %T.589 [symbolic]
// CHECK:STDOUT: %impl.elem0.664: %.e72 = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic]
// CHECK:STDOUT: %specific_impl_fn.fd5: <specific function> = specific_impl_function %impl.elem0.664, @OrderedWith.WithSelf.Less(%U, %T.589) [symbolic]
// CHECK:STDOUT: %assoc1.d74: %OrderedWith.assoc_type.72f2ab.1 = assoc_entity element1, imports.%Core.import_ref.785 [symbolic]
// CHECK:STDOUT: %.951: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.8f86f8.3, %T.589 [symbolic]
// CHECK:STDOUT: %impl.elem1.2de: %.951 = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic]
// CHECK:STDOUT: %specific_impl_fn.315: <specific function> = specific_impl_function %impl.elem1.2de, @OrderedWith.WithSelf.LessOrEquivalent(%U, %T.589) [symbolic]
// CHECK:STDOUT: %assoc2.4ac: %OrderedWith.assoc_type.72f2ab.1 = assoc_entity element2, imports.%Core.import_ref.3b8 [symbolic]
// CHECK:STDOUT: %.813: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.8e8d9f.3, %T.589 [symbolic]
// CHECK:STDOUT: %impl.elem2: %.813 = impl_witness_access %OrderedWith.lookup_impl_witness, element2 [symbolic]
// CHECK:STDOUT: %specific_impl_fn.9d6: <specific function> = specific_impl_function %impl.elem2, @OrderedWith.WithSelf.Greater(%U, %T.589) [symbolic]
// CHECK:STDOUT: %assoc3.89a: %OrderedWith.assoc_type.72f2ab.1 = assoc_entity element3, imports.%Core.import_ref.29c [symbolic]
// CHECK:STDOUT: %.137: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.cd7ce3.3, %T.589 [symbolic]
// CHECK:STDOUT: %impl.elem3: %.137 = impl_witness_access %OrderedWith.lookup_impl_witness, element3 [symbolic]
// CHECK:STDOUT: %specific_impl_fn.261: <specific function> = specific_impl_function %impl.elem3, @OrderedWith.WithSelf.GreaterOrEquivalent(%U, %T.589) [symbolic]
// CHECK:STDOUT: %DefaultSpaceshipOnly: type = class_type @DefaultSpaceshipOnly [concrete]
// CHECK:STDOUT: %pattern_type.cce: type = pattern_type %DefaultSpaceshipOnly [concrete]
// CHECK:STDOUT: %ReturnsStrongOrdering: type = class_type @ReturnsStrongOrdering [concrete]
// CHECK:STDOUT: %pattern_type.a93: type = pattern_type %ReturnsStrongOrdering [concrete]
// CHECK:STDOUT: %ReturnsPartialOrdering: type = class_type @ReturnsPartialOrdering [concrete]
// CHECK:STDOUT: %pattern_type.dbf: type = pattern_type %ReturnsPartialOrdering [concrete]
// CHECK:STDOUT: %CrossTypeLhs: type = class_type @CrossTypeLhs [concrete]
// CHECK:STDOUT: %pattern_type.f3d: type = pattern_type %CrossTypeLhs [concrete]
// CHECK:STDOUT: %CrossTypeRhs: type = class_type @CrossTypeRhs [concrete]
// CHECK:STDOUT: %pattern_type.bd1: type = pattern_type %CrossTypeRhs [concrete]
// CHECK:STDOUT: %EqWith.type.d71: type = facet_type <@EqWith.1, @EqWith.1(%DefaultSpaceshipOnly)> [concrete]
// CHECK:STDOUT: %pattern_type.375: type = pattern_type %EqWith.type.d71 [concrete]
// CHECK:STDOUT: %OrderedWith.type.519: type = facet_type <@OrderedWith.1, @OrderedWith.1(%DefaultSpaceshipOnly)> [concrete]
// CHECK:STDOUT: %pattern_type.0e9: type = pattern_type %OrderedWith.type.519 [concrete]
// CHECK:STDOUT: %OrderedWith.type.62a: type = facet_type <@OrderedWith.1, @OrderedWith.1(%ReturnsStrongOrdering)> [concrete]
// CHECK:STDOUT: %pattern_type.453: type = pattern_type %OrderedWith.type.62a [concrete]
// CHECK:STDOUT: %OrderedWith.type.c87: type = facet_type <@OrderedWith.1, @OrderedWith.1(%ReturnsPartialOrdering)> [concrete]
// CHECK:STDOUT: %pattern_type.ac7: type = pattern_type %OrderedWith.type.c87 [concrete]
// CHECK:STDOUT: %OrderedWith.type.079: type = facet_type <@OrderedWith.1, @OrderedWith.1(%CrossTypeRhs)> [concrete]
// CHECK:STDOUT: %pattern_type.f80: type = pattern_type %OrderedWith.type.079 [concrete]
// CHECK:STDOUT: %OrderedWith.type.ec4: type = facet_type <@OrderedWith.1, @OrderedWith.1(%CrossTypeLhs)> [concrete]
// CHECK:STDOUT: %pattern_type.cee: type = pattern_type %OrderedWith.type.ec4 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core.import_ref.c6d: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc0 (constants.%assoc0.b78)]
// CHECK:STDOUT: %Core.import_ref.5a3: @EqWith.WithSelf.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%assoc1 (constants.%assoc1.579)]
// CHECK:STDOUT: %Core.import_ref.515: @EqWith.WithSelf.%EqWith.WithSelf.NotEqual.type (%EqWith.WithSelf.NotEqual.type.d0da48.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.NotEqual (constants.%EqWith.WithSelf.NotEqual.f72b2f.1)]
// CHECK:STDOUT: %Core.import_ref.5f3: @EqWith.WithSelf.%EqWith.WithSelf.Equal.type (%EqWith.WithSelf.Equal.type.c6aebf.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @EqWith.WithSelf.%EqWith.WithSelf.Equal (constants.%EqWith.WithSelf.Equal.b440b7.1)]
// CHECK:STDOUT: %Core.import_ref.c6b = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded
// CHECK:STDOUT: %Core.import_ref.4af = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded
// CHECK:STDOUT: %Core.import_ref.08c: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc0 (constants.%assoc0.d47)]
// CHECK:STDOUT: %Core.import_ref.6b7: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc1 (constants.%assoc1.d74)]
// CHECK:STDOUT: %Core.import_ref.bc5: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc2 (constants.%assoc2.4ac)]
// CHECK:STDOUT: %Core.import_ref.cfb: @OrderedWith.WithSelf.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%assoc3 (constants.%assoc3.89a)]
// CHECK:STDOUT: %Core.import_ref.bcf: @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent.type (%OrderedWith.WithSelf.GreaterOrEquivalent.type.cd7ce3.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.GreaterOrEquivalent (constants.%OrderedWith.WithSelf.GreaterOrEquivalent.433a82.1)]
// CHECK:STDOUT: %Core.import_ref.ece: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater.type (%OrderedWith.WithSelf.Greater.type.8e8d9f.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Greater (constants.%OrderedWith.WithSelf.Greater.4b40f6.1)]
// CHECK:STDOUT: %Core.import_ref.af2: @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent.type (%OrderedWith.WithSelf.LessOrEquivalent.type.8f86f8.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.LessOrEquivalent (constants.%OrderedWith.WithSelf.LessOrEquivalent.cf3f1c.1)]
// CHECK:STDOUT: %Core.import_ref.250: @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less.type (%OrderedWith.WithSelf.Less.type.0103c6.1) = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, loaded [symbolic = @OrderedWith.WithSelf.%OrderedWith.WithSelf.Less (constants.%OrderedWith.WithSelf.Less.828cee.1)]
// CHECK:STDOUT: %Core.import_ref.516 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded
// CHECK:STDOUT: %Core.import_ref.785 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded
// CHECK:STDOUT: %Core.import_ref.3b8 = import_ref Core//prelude/operators/comparison, loc{{\d+_\d+}}, unloaded
// CHECK:STDOUT: %Core.import_ref.29c = 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.1790d7.2)) {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %require_complete.loc6: <witness> = require_complete_type %EqWith.type.loc4_38.1 [symbolic = %require_complete.loc6 (constants.%require_complete.d87)]
// 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.efa4d1.2)]
// CHECK:STDOUT: %assoc0: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.2) = assoc_entity element0, imports.%Core.import_ref.5f3 [symbolic = %assoc0 (constants.%assoc0.5e77ba.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.c6aebf.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.%.10a)]
// CHECK:STDOUT: %EqWith.lookup_impl_witness: <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 (%.10a) = impl_witness_access %EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_5.2 (constants.%impl.elem0.734)]
// CHECK:STDOUT: %specific_impl_fn.loc6_5.2: <specific function> = 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.b75)]
// CHECK:STDOUT: %assoc1: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.2) = assoc_entity element1, imports.%Core.import_ref.515 [symbolic = %assoc1 (constants.%assoc1.7b7afb.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.d0da48.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.%.2bb)]
// CHECK:STDOUT: %impl.elem1.loc7_5.2: @EqWith.loc4.%.loc7_5.2 (%.2bb) = impl_witness_access %EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc7_5.2 (constants.%impl.elem1.f69)]
// CHECK:STDOUT: %specific_impl_fn.loc7_5.2: <specific function> = 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.bc2)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%x.param: @EqWith.loc4.%T.as_type.loc4_44.1 (%T.as_type.c92), %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.c92) = 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.1790d7.2)]
// CHECK:STDOUT: %.loc6_5.1: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.2) = specific_constant imports.%Core.import_ref.c6d, @EqWith.WithSelf(constants.%U, constants.%Self.7839ed.1) [symbolic = %assoc0 (constants.%assoc0.5e77ba.2)]
// CHECK:STDOUT: %Equal.ref: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.2) = name_ref Equal, %.loc6_5.1 [symbolic = %assoc0 (constants.%assoc0.5e77ba.2)]
// CHECK:STDOUT: %impl.elem0.loc6_5.1: @EqWith.loc4.%.loc6_5.2 (%.10a) = impl_witness_access constants.%EqWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_5.2 (constants.%impl.elem0.734)]
// CHECK:STDOUT: %bound_method.loc6_5.1: <bound method> = bound_method %x.ref.loc6, %impl.elem0.loc6_5.1
// CHECK:STDOUT: %specific_impl_fn.loc6_5.1: <specific function> = specific_impl_function %impl.elem0.loc6_5.1, @EqWith.WithSelf.Equal(constants.%U, constants.%T.783) [symbolic = %specific_impl_fn.loc6_5.2 (constants.%specific_impl_fn.b75)]
// CHECK:STDOUT: %bound_method.loc6_5.2: <bound method> = 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.c92) = 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.1790d7.2)]
// CHECK:STDOUT: %.loc7_5.1: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.2) = specific_constant imports.%Core.import_ref.5a3, @EqWith.WithSelf(constants.%U, constants.%Self.7839ed.1) [symbolic = %assoc1 (constants.%assoc1.7b7afb.2)]
// CHECK:STDOUT: %NotEqual.ref: @EqWith.loc4.%EqWith.assoc_type (%EqWith.assoc_type.efa4d1.2) = name_ref NotEqual, %.loc7_5.1 [symbolic = %assoc1 (constants.%assoc1.7b7afb.2)]
// CHECK:STDOUT: %impl.elem1.loc7_5.1: @EqWith.loc4.%.loc7_5.2 (%.2bb) = impl_witness_access constants.%EqWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc7_5.2 (constants.%impl.elem1.f69)]
// CHECK:STDOUT: %bound_method.loc7_5.1: <bound method> = bound_method %x.ref.loc7, %impl.elem1.loc7_5.1
// CHECK:STDOUT: %specific_impl_fn.loc7_5.1: <specific function> = specific_impl_function %impl.elem1.loc7_5.1, @EqWith.WithSelf.NotEqual(constants.%U, constants.%T.783) [symbolic = %specific_impl_fn.loc7_5.2 (constants.%specific_impl_fn.bc2)]
// CHECK:STDOUT: %bound_method.loc7_5.2: <bound method> = 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: <elided>
// 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.1ce6d7.2)) {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %require_complete.loc13: <witness> = require_complete_type %OrderedWith.type.loc11_48.1 [symbolic = %require_complete.loc13 (constants.%require_complete.028)]
// 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.72f2ab.2)]
// CHECK:STDOUT: %assoc0: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = assoc_entity element0, imports.%Core.import_ref.250 [symbolic = %assoc0 (constants.%assoc0.76ced5.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.0103c6.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.%.e72)]
// CHECK:STDOUT: %OrderedWith.lookup_impl_witness: <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 (%.e72) = impl_witness_access %OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_5.2 (constants.%impl.elem0.664)]
// CHECK:STDOUT: %specific_impl_fn.loc13_5.2: <specific function> = 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.fd5)]
// CHECK:STDOUT: %assoc1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = assoc_entity element1, imports.%Core.import_ref.af2 [symbolic = %assoc1 (constants.%assoc1.248efd.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.8f86f8.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.%.951)]
// CHECK:STDOUT: %impl.elem1.loc14_5.2: @OrderedWith.loc11.%.loc14_5.2 (%.951) = impl_witness_access %OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc14_5.2 (constants.%impl.elem1.2de)]
// CHECK:STDOUT: %specific_impl_fn.loc14_5.2: <specific function> = 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.315)]
// CHECK:STDOUT: %assoc2: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = assoc_entity element2, imports.%Core.import_ref.ece [symbolic = %assoc2 (constants.%assoc2.cac9ed.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.8e8d9f.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.%.813)]
// CHECK:STDOUT: %impl.elem2.loc15_5.2: @OrderedWith.loc11.%.loc15_5.2 (%.813) = 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 function> = 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.9d6)]
// CHECK:STDOUT: %assoc3: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = assoc_entity element3, imports.%Core.import_ref.bcf [symbolic = %assoc3 (constants.%assoc3.9908c2.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.cd7ce3.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.%.137)]
// CHECK:STDOUT: %impl.elem3.loc16_5.2: @OrderedWith.loc11.%.loc16_5.2 (%.137) = 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 function> = 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.261)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%x.param: @OrderedWith.loc11.%T.as_type.loc11_54.1 (%T.as_type.9c1), %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.9c1) = 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.1ce6d7.2)]
// CHECK:STDOUT: %.loc13_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = specific_constant imports.%Core.import_ref.08c, @OrderedWith.WithSelf(constants.%U, constants.%Self.5899f7.1) [symbolic = %assoc0 (constants.%assoc0.76ced5.2)]
// CHECK:STDOUT: %Less.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = name_ref Less, %.loc13_5.1 [symbolic = %assoc0 (constants.%assoc0.76ced5.2)]
// CHECK:STDOUT: %impl.elem0.loc13_5.1: @OrderedWith.loc11.%.loc13_5.2 (%.e72) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_5.2 (constants.%impl.elem0.664)]
// CHECK:STDOUT: %bound_method.loc13_5.1: <bound method> = bound_method %x.ref.loc13, %impl.elem0.loc13_5.1
// CHECK:STDOUT: %specific_impl_fn.loc13_5.1: <specific function> = specific_impl_function %impl.elem0.loc13_5.1, @OrderedWith.WithSelf.Less(constants.%U, constants.%T.589) [symbolic = %specific_impl_fn.loc13_5.2 (constants.%specific_impl_fn.fd5)]
// CHECK:STDOUT: %bound_method.loc13_5.2: <bound method> = 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.9c1) = 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.1ce6d7.2)]
// CHECK:STDOUT: %.loc14_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = specific_constant imports.%Core.import_ref.6b7, @OrderedWith.WithSelf(constants.%U, constants.%Self.5899f7.1) [symbolic = %assoc1 (constants.%assoc1.248efd.2)]
// CHECK:STDOUT: %LessOrEquivalent.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = name_ref LessOrEquivalent, %.loc14_5.1 [symbolic = %assoc1 (constants.%assoc1.248efd.2)]
// CHECK:STDOUT: %impl.elem1.loc14_5.1: @OrderedWith.loc11.%.loc14_5.2 (%.951) = impl_witness_access constants.%OrderedWith.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc14_5.2 (constants.%impl.elem1.2de)]
// CHECK:STDOUT: %bound_method.loc14_5.1: <bound method> = bound_method %x.ref.loc14, %impl.elem1.loc14_5.1
// CHECK:STDOUT: %specific_impl_fn.loc14_5.1: <specific function> = specific_impl_function %impl.elem1.loc14_5.1, @OrderedWith.WithSelf.LessOrEquivalent(constants.%U, constants.%T.589) [symbolic = %specific_impl_fn.loc14_5.2 (constants.%specific_impl_fn.315)]
// CHECK:STDOUT: %bound_method.loc14_5.2: <bound method> = 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.9c1) = 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.1ce6d7.2)]
// CHECK:STDOUT: %.loc15_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = specific_constant imports.%Core.import_ref.bc5, @OrderedWith.WithSelf(constants.%U, constants.%Self.5899f7.1) [symbolic = %assoc2 (constants.%assoc2.cac9ed.2)]
// CHECK:STDOUT: %Greater.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = name_ref Greater, %.loc15_5.1 [symbolic = %assoc2 (constants.%assoc2.cac9ed.2)]
// CHECK:STDOUT: %impl.elem2.loc15_5.1: @OrderedWith.loc11.%.loc15_5.2 (%.813) = 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> = bound_method %x.ref.loc15, %impl.elem2.loc15_5.1
// CHECK:STDOUT: %specific_impl_fn.loc15_5.1: <specific function> = specific_impl_function %impl.elem2.loc15_5.1, @OrderedWith.WithSelf.Greater(constants.%U, constants.%T.589) [symbolic = %specific_impl_fn.loc15_5.2 (constants.%specific_impl_fn.9d6)]
// CHECK:STDOUT: %bound_method.loc15_5.2: <bound method> = 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.9c1) = 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.1ce6d7.2)]
// CHECK:STDOUT: %.loc16_5.1: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = specific_constant imports.%Core.import_ref.cfb, @OrderedWith.WithSelf(constants.%U, constants.%Self.5899f7.1) [symbolic = %assoc3 (constants.%assoc3.9908c2.2)]
// CHECK:STDOUT: %GreaterOrEquivalent.ref: @OrderedWith.loc11.%OrderedWith.assoc_type (%OrderedWith.assoc_type.72f2ab.2) = name_ref GreaterOrEquivalent, %.loc16_5.1 [symbolic = %assoc3 (constants.%assoc3.9908c2.2)]
// CHECK:STDOUT: %impl.elem3.loc16_5.1: @OrderedWith.loc11.%.loc16_5.2 (%.137) = 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> = bound_method %x.ref.loc16, %impl.elem3.loc16_5.1
// CHECK:STDOUT: %specific_impl_fn.loc16_5.1: <specific function> = specific_impl_function %impl.elem3.loc16_5.1, @OrderedWith.WithSelf.GreaterOrEquivalent(constants.%U, constants.%T.589) [symbolic = %specific_impl_fn.loc16_5.2 (constants.%specific_impl_fn.261)]
// CHECK:STDOUT: %bound_method.loc16_5.2: <bound method> = 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: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @EqWith.loc4(constants.%U, constants.%T.783) {
// CHECK:STDOUT: %U.loc4_12.1 => constants.%U
// CHECK:STDOUT: %EqWith.type.loc4_38.1 => constants.%EqWith.type.1790d7.2
// CHECK:STDOUT: %T.loc4_22.1 => constants.%T.783
// CHECK:STDOUT: %pattern_type.loc4_22 => constants.%pattern_type.7dc
// CHECK:STDOUT: %T.as_type.loc4_44.1 => constants.%T.as_type.c92
// CHECK:STDOUT: %pattern_type.loc4_42 => constants.%pattern_type.96b8c1.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.589) {
// CHECK:STDOUT: %U.loc11_17.1 => constants.%U
// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.1ce6d7.2
// CHECK:STDOUT: %T.loc11_27.1 => constants.%T.589
// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.9c4
// CHECK:STDOUT: %T.as_type.loc11_54.1 => constants.%T.as_type.9c1
// CHECK:STDOUT: %pattern_type.loc11_52 => constants.%pattern_type.2e7263.2
// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.51d1c4.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @EqWith.loc4(constants.%DefaultSpaceshipOnly, <error>) {
// CHECK:STDOUT: %U.loc4_12.1 => constants.%DefaultSpaceshipOnly
// CHECK:STDOUT: %EqWith.type.loc4_38.1 => constants.%EqWith.type.d71
// CHECK:STDOUT: %T.loc4_22.1 => <error>
// CHECK:STDOUT: %pattern_type.loc4_22 => constants.%pattern_type.375
// CHECK:STDOUT: %T.as_type.loc4_44.1 => <error>
// CHECK:STDOUT: %pattern_type.loc4_42 => <error>
// CHECK:STDOUT: %pattern_type.loc4_48 => constants.%pattern_type.cce
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%DefaultSpaceshipOnly, <error>) {
// CHECK:STDOUT: %U.loc11_17.1 => constants.%DefaultSpaceshipOnly
// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.519
// CHECK:STDOUT: %T.loc11_27.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.0e9
// CHECK:STDOUT: %T.as_type.loc11_54.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_52 => <error>
// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.cce
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%ReturnsStrongOrdering, <error>) {
// CHECK:STDOUT: %U.loc11_17.1 => constants.%ReturnsStrongOrdering
// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.62a
// CHECK:STDOUT: %T.loc11_27.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.453
// CHECK:STDOUT: %T.as_type.loc11_54.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_52 => <error>
// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.a93
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%ReturnsPartialOrdering, <error>) {
// CHECK:STDOUT: %U.loc11_17.1 => constants.%ReturnsPartialOrdering
// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.c87
// CHECK:STDOUT: %T.loc11_27.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.ac7
// CHECK:STDOUT: %T.as_type.loc11_54.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_52 => <error>
// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.dbf
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%CrossTypeRhs, <error>) {
// CHECK:STDOUT: %U.loc11_17.1 => constants.%CrossTypeRhs
// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.079
// CHECK:STDOUT: %T.loc11_27.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.f80
// CHECK:STDOUT: %T.as_type.loc11_54.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_52 => <error>
// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.bd1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OrderedWith.loc11(constants.%CrossTypeLhs, <error>) {
// CHECK:STDOUT: %U.loc11_17.1 => constants.%CrossTypeLhs
// CHECK:STDOUT: %OrderedWith.type.loc11_48.1 => constants.%OrderedWith.type.ec4
// CHECK:STDOUT: %T.loc11_27.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_27 => constants.%pattern_type.cee
// CHECK:STDOUT: %T.as_type.loc11_54.1 => <error>
// CHECK:STDOUT: %pattern_type.loc11_52 => <error>
// CHECK:STDOUT: %pattern_type.loc11_58 => constants.%pattern_type.f3d
// CHECK:STDOUT: }
// CHECK:STDOUT: