mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 01:50:29 +00:00
During impl lookup, for each (generic) impl candidate, we form a specific for that impl by deducing its generic arguments. Then we compare the query interface against the impl's specific interface. That comparison needs the deduced arguments applied to the impl's specific interface. Previously we were doing this by getting the impl's constraint facet type with the impl's specific applied (via `GetConstantValueInSpecific()`) and then identifying that facet type with the impl's deduced self. Identify is a fairly expensive operation. It runs subst, trying to replace `.Self` references. It walks named constraints. It collects require declarations. We're looking at making it do _more_ in the future too, including rewrite constraint resolution and collecting rewrite and same-type constraints. For this reason we have a cache to make it cheap on the second run, but it's still a very heavyweight operation to involve in impl lookup, when all we want is to apply the impl's specific to its target interface. We almost have all the information we need to avoid the identification step. We have the impl's specific after deduction. And we have the SpecificInterface that the impl is targeting in the `Impl` struct. When we form the specific for the impl itself, we resolve the declaration block and form new constant values for all instructions in there, but that does not cover the SpecificInterface that we're storing in the `Impl` struct. So we add a new instruction to the impl's eval block, which will be symbolic when the impl is generic and the target interface depends on a generic parameter. And we store the `InstId` in the `Impl` struct. This allows us to gets its constant value later with the impl's specific applied. From that constant value we can then pull out the SpecificInterface that the impl is targeting.
550 lines
38 KiB
Plaintext
550 lines
38 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
|
|
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
|
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/operators/overloaded/ordered.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/ordered.carbon
|
|
|
|
// --- user.carbon
|
|
|
|
package User;
|
|
|
|
class C {};
|
|
|
|
impl C as Core.OrderedWith(C) {
|
|
fn Less(self: C, other: C) -> bool;
|
|
fn LessOrEquivalent(self: C, other: C) -> bool;
|
|
fn Greater(self: C, other: C) -> bool;
|
|
fn GreaterOrEquivalent(self: C, other: C) -> bool;
|
|
}
|
|
|
|
fn TestLess(a: C, b: C) -> bool {
|
|
return a < b;
|
|
}
|
|
|
|
fn TestLessEqual(a: C, b: C) -> bool {
|
|
return a <= b;
|
|
}
|
|
|
|
fn TestGreater(a: C, b: C) -> bool {
|
|
return a > b;
|
|
}
|
|
|
|
fn TestGreaterEqual(a: C, b: C) -> bool {
|
|
return a >= b;
|
|
}
|
|
|
|
// --- fail_no_impl.carbon
|
|
|
|
package FailNoImpl;
|
|
|
|
class D {};
|
|
|
|
fn TestLess(a: D, b: D) -> bool {
|
|
// CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
|
|
// CHECK:STDERR: return a < b;
|
|
// CHECK:STDERR: ^~~~~
|
|
// CHECK:STDERR:
|
|
return a < b;
|
|
}
|
|
|
|
fn TestLessEqual(a: D, b: D) -> bool {
|
|
// CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
|
|
// CHECK:STDERR: return a <= b;
|
|
// CHECK:STDERR: ^~~~~~
|
|
// CHECK:STDERR:
|
|
return a <= b;
|
|
}
|
|
|
|
fn TestGreater(a: D, b: D) -> bool {
|
|
// CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
|
|
// CHECK:STDERR: return a > b;
|
|
// CHECK:STDERR: ^~~~~
|
|
// CHECK:STDERR:
|
|
return a > b;
|
|
}
|
|
|
|
fn TestGreaterEqual(a: D, b: D) -> bool {
|
|
// CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
|
|
// CHECK:STDERR: return a >= b;
|
|
// CHECK:STDERR: ^~~~~~
|
|
// CHECK:STDERR:
|
|
return a >= b;
|
|
}
|
|
|
|
// CHECK:STDOUT: --- user.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.type.ad8: type = generic_interface_type @OrderedWith [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.generic: %OrderedWith.type.ad8 = struct_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete]
|
|
// CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.type.108: type = facet_type <@OrderedWith, @OrderedWith(%C)> [concrete]
|
|
// CHECK:STDOUT: %.71b: <witness> = impl_self_witness %C, @OrderedWith, @OrderedWith(%C) [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.impl_witness: <witness> = impl_witness @C.as.OrderedWith.impl.%OrderedWith.impl_witness_table [concrete]
|
|
// CHECK:STDOUT: %pattern_type.4a7: type = pattern_type %C [concrete]
|
|
// CHECK:STDOUT: %self.param_patt.c03: %pattern_type.4a7 = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %self.patt.3a1: %pattern_type.4a7 = at_binding_pattern self, %self.param_patt.c03 [concrete]
|
|
// CHECK:STDOUT: %other.param_patt.b8c: %pattern_type.4a7 = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %other.patt.527: %pattern_type.4a7 = at_binding_pattern other, %other.param_patt.b8c [concrete]
|
|
// CHECK:STDOUT: %return.patt.c0c: %pattern_type.831 = return_slot_pattern %return.param_patt, bool [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Less.type: type = fn_type @C.as.OrderedWith.impl.Less [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Less: %C.as.OrderedWith.impl.Less.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent.type: type = fn_type @C.as.OrderedWith.impl.LessOrEquivalent [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent: %C.as.OrderedWith.impl.LessOrEquivalent.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Greater.type: type = fn_type @C.as.OrderedWith.impl.Greater [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Greater: %C.as.OrderedWith.impl.Greater.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent.type: type = fn_type @C.as.OrderedWith.impl.GreaterOrEquivalent [concrete]
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent: %C.as.OrderedWith.impl.GreaterOrEquivalent.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.facet: %OrderedWith.type.108 = facet_value %C, (%OrderedWith.impl_witness) [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type.671: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%C, %OrderedWith.facet) [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.type.392: type = fn_type @OrderedWith.WithSelf.LessOrEquivalent, @OrderedWith.WithSelf(%C, %OrderedWith.facet) [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.type.2b0: type = fn_type @OrderedWith.WithSelf.Greater, @OrderedWith.WithSelf(%C, %OrderedWith.facet) [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.type.9fb: type = fn_type @OrderedWith.WithSelf.GreaterOrEquivalent, @OrderedWith.WithSelf(%C, %OrderedWith.facet) [concrete]
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.4a7 = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.4a7 = at_binding_pattern a, %a.param_patt [concrete]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.4a7 = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.4a7 = at_binding_pattern b, %b.param_patt [concrete]
|
|
// CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [concrete]
|
|
// CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.e71: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type.671, %OrderedWith.facet [concrete]
|
|
// CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [concrete]
|
|
// CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.d4d: type = fn_type_with_self_type %OrderedWith.WithSelf.LessOrEquivalent.type.392, %OrderedWith.facet [concrete]
|
|
// CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [concrete]
|
|
// CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.f13: type = fn_type_with_self_type %OrderedWith.WithSelf.Greater.type.2b0, %OrderedWith.facet [concrete]
|
|
// CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [concrete]
|
|
// CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.909: type = fn_type_with_self_type %OrderedWith.WithSelf.GreaterOrEquivalent.type.9fb, %OrderedWith.facet [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: .OrderedWith = %Core.OrderedWith
|
|
// CHECK:STDOUT: .Bool = %Core.Bool
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.ad8 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic]
|
|
// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .C = %C.decl
|
|
// CHECK:STDOUT: .TestLess = %TestLess.decl
|
|
// CHECK:STDOUT: .TestLessEqual = %TestLessEqual.decl
|
|
// CHECK:STDOUT: .TestGreater = %TestGreater.decl
|
|
// CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
// CHECK:STDOUT: impl_decl @C.as.OrderedWith.impl [concrete] {} {
|
|
// CHECK:STDOUT: %C.ref.loc6_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
|
// CHECK:STDOUT: %OrderedWith.ref: %OrderedWith.type.ad8 = name_ref OrderedWith, imports.%Core.OrderedWith [concrete = constants.%OrderedWith.generic]
|
|
// CHECK:STDOUT: %C.ref.loc6_28: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %OrderedWith.type: type = facet_type <@OrderedWith, @OrderedWith(constants.%C)> [concrete = constants.%OrderedWith.type.108]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc6: <witness> = impl_self_witness @C.as.OrderedWith.impl.%C.ref.loc6_6, @OrderedWith, @OrderedWith(constants.%C) [concrete = constants.%.71b]
|
|
// CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [concrete = constants.%TestLess] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.4a7 = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.4a7 = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc13_28.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc13_28.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc13_28.2: Core.Form = init_form %.loc13_28.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %a: %C = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc13_22: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %b: %C = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [concrete = constants.%TestLessEqual] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.4a7 = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.4a7 = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc17_33.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc17_33.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc17_33.2: Core.Form = init_form %.loc17_33.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc17_21: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %a: %C = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc17_27: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %b: %C = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [concrete = constants.%TestGreater] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.4a7 = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.4a7 = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc21_31.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc21_31.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc21_31.2: Core.Form = init_form %.loc21_31.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc21_19: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %a: %C = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc21_25: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %b: %C = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [concrete = constants.%TestGreaterEqual] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.4a7 = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.4a7 = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc25_36.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc25_36.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc25_36.2: Core.Form = init_form %.loc25_36.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc25_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %a: %C = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc25_30: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %b: %C = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @C.as.OrderedWith.impl: %C.ref.loc6_6 as %OrderedWith.type {
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Less.decl: %C.as.OrderedWith.impl.Less.type = fn_decl @C.as.OrderedWith.impl.Less [concrete = constants.%C.as.OrderedWith.impl.Less] {
|
|
// CHECK:STDOUT: %self.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%self.param_patt.c03]
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.4a7 = at_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a1]
|
|
// CHECK:STDOUT: %other.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%other.param_patt.b8c]
|
|
// CHECK:STDOUT: %other.patt: %pattern_type.4a7 = at_binding_pattern other, %other.param_patt [concrete = constants.%other.patt.527]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc7_33.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc7_33.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc7_33.2: Core.Form = init_form %.loc7_33.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc7_17: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %self: %C = wrapper_binding self, %self.param
|
|
// CHECK:STDOUT: %other.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc7_27: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %other: %C = wrapper_binding other, %other.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent.decl: %C.as.OrderedWith.impl.LessOrEquivalent.type = fn_decl @C.as.OrderedWith.impl.LessOrEquivalent [concrete = constants.%C.as.OrderedWith.impl.LessOrEquivalent] {
|
|
// CHECK:STDOUT: %self.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%self.param_patt.c03]
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.4a7 = at_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a1]
|
|
// CHECK:STDOUT: %other.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%other.param_patt.b8c]
|
|
// CHECK:STDOUT: %other.patt: %pattern_type.4a7 = at_binding_pattern other, %other.param_patt [concrete = constants.%other.patt.527]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc8_45.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc8_45.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc8_45.2: Core.Form = init_form %.loc8_45.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %self: %C = wrapper_binding self, %self.param
|
|
// CHECK:STDOUT: %other.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc8_39: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %other: %C = wrapper_binding other, %other.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Greater.decl: %C.as.OrderedWith.impl.Greater.type = fn_decl @C.as.OrderedWith.impl.Greater [concrete = constants.%C.as.OrderedWith.impl.Greater] {
|
|
// CHECK:STDOUT: %self.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%self.param_patt.c03]
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.4a7 = at_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a1]
|
|
// CHECK:STDOUT: %other.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%other.param_patt.b8c]
|
|
// CHECK:STDOUT: %other.patt: %pattern_type.4a7 = at_binding_pattern other, %other.param_patt [concrete = constants.%other.patt.527]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc9_36.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc9_36.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc9_36.2: Core.Form = init_form %.loc9_36.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc9_20: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %self: %C = wrapper_binding self, %self.param
|
|
// CHECK:STDOUT: %other.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc9_30: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %other: %C = wrapper_binding other, %other.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent.decl: %C.as.OrderedWith.impl.GreaterOrEquivalent.type = fn_decl @C.as.OrderedWith.impl.GreaterOrEquivalent [concrete = constants.%C.as.OrderedWith.impl.GreaterOrEquivalent] {
|
|
// CHECK:STDOUT: %self.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%self.param_patt.c03]
|
|
// CHECK:STDOUT: %self.patt: %pattern_type.4a7 = at_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3a1]
|
|
// CHECK:STDOUT: %other.param_patt: %pattern_type.4a7 = value_param_pattern [concrete = constants.%other.param_patt.b8c]
|
|
// CHECK:STDOUT: %other.patt: %pattern_type.4a7 = at_binding_pattern other, %other.param_patt [concrete = constants.%other.patt.527]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc10_48.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc10_48.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc10_48.2: Core.Form = init_form %.loc10_48.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
// CHECK:STDOUT: %C.ref.loc10_32: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %self: %C = wrapper_binding self, %self.param
|
|
// CHECK:STDOUT: %other.param: %C = value_param call_param1
|
|
// CHECK:STDOUT: %C.ref.loc10_42: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
// CHECK:STDOUT: %other: %C = wrapper_binding other, %other.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %OrderedWith.impl_witness_table = impl_witness_table (%C.as.OrderedWith.impl.Less.decl, %C.as.OrderedWith.impl.LessOrEquivalent.decl, %C.as.OrderedWith.impl.Greater.decl, %C.as.OrderedWith.impl.GreaterOrEquivalent.decl), @C.as.OrderedWith.impl [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.impl_witness: <witness> = impl_witness %OrderedWith.impl_witness_table [concrete = constants.%OrderedWith.impl_witness]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .C = <poisoned>
|
|
// CHECK:STDOUT: .Less = %C.as.OrderedWith.impl.Less.decl
|
|
// CHECK:STDOUT: .LessOrEquivalent = %C.as.OrderedWith.impl.LessOrEquivalent.decl
|
|
// CHECK:STDOUT: .Greater = %C.as.OrderedWith.impl.Greater.decl
|
|
// CHECK:STDOUT: .GreaterOrEquivalent = %C.as.OrderedWith.impl.GreaterOrEquivalent.decl
|
|
// CHECK:STDOUT: extend %OrderedWith.type
|
|
// CHECK:STDOUT: witness = %OrderedWith.impl_witness
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.as.OrderedWith.impl.Less(%self.param: %C, %other.param: %C) -> out %return.param: bool;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.as.OrderedWith.impl.LessOrEquivalent(%self.param: %C, %other.param: %C) -> out %return.param: bool;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.as.OrderedWith.impl.Greater(%self.param: %C, %other.param: %C) -> out %return.param: bool;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.as.OrderedWith.impl.GreaterOrEquivalent(%self.param: %C, %other.param: %C) -> out %return.param: bool;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestLess(%a.param: %C, %b.param: %C) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %C = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %C = name_ref b, %b
|
|
// CHECK:STDOUT: %impl.elem0: %.e71 = impl_witness_access constants.%OrderedWith.impl_witness, element0 [concrete = constants.%C.as.OrderedWith.impl.Less]
|
|
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Less.call: init bool = call %bound_method(%a.ref, %b.ref)
|
|
// CHECK:STDOUT: return %C.as.OrderedWith.impl.Less.call
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestLessEqual(%a.param: %C, %b.param: %C) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %C = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %C = name_ref b, %b
|
|
// CHECK:STDOUT: %impl.elem1: %.d4d = impl_witness_access constants.%OrderedWith.impl_witness, element1 [concrete = constants.%C.as.OrderedWith.impl.LessOrEquivalent]
|
|
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem1
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent.call: init bool = call %bound_method(%a.ref, %b.ref)
|
|
// CHECK:STDOUT: return %C.as.OrderedWith.impl.LessOrEquivalent.call
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestGreater(%a.param: %C, %b.param: %C) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %C = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %C = name_ref b, %b
|
|
// CHECK:STDOUT: %impl.elem2: %.f13 = impl_witness_access constants.%OrderedWith.impl_witness, element2 [concrete = constants.%C.as.OrderedWith.impl.Greater]
|
|
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem2
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.Greater.call: init bool = call %bound_method(%a.ref, %b.ref)
|
|
// CHECK:STDOUT: return %C.as.OrderedWith.impl.Greater.call
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestGreaterEqual(%a.param: %C, %b.param: %C) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %C = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %C = name_ref b, %b
|
|
// CHECK:STDOUT: %impl.elem3: %.909 = impl_witness_access constants.%OrderedWith.impl_witness, element3 [concrete = constants.%C.as.OrderedWith.impl.GreaterOrEquivalent]
|
|
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem3
|
|
// CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent.call: init bool = call %bound_method(%a.ref, %b.ref)
|
|
// CHECK:STDOUT: return %C.as.OrderedWith.impl.GreaterOrEquivalent.call
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_no_impl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %pattern_type.9dc: type = pattern_type %D [concrete]
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.9dc = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.9dc = at_binding_pattern a, %a.param_patt [concrete]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.9dc = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.9dc = at_binding_pattern b, %b.param_patt [concrete]
|
|
// CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete]
|
|
// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete]
|
|
// CHECK:STDOUT: %return.patt.c0c: %pattern_type.831 = return_slot_pattern %return.param_patt, bool [concrete]
|
|
// CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [concrete]
|
|
// CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.type.ad8: type = generic_interface_type @OrderedWith [concrete]
|
|
// CHECK:STDOUT: %OrderedWith.generic: %OrderedWith.type.ad8 = struct_value () [concrete]
|
|
// CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [concrete]
|
|
// CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [concrete]
|
|
// CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [concrete]
|
|
// CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: .Bool = %Core.Bool
|
|
// CHECK:STDOUT: .OrderedWith = %Core.OrderedWith
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool]
|
|
// CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.ad8 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .D = %D.decl
|
|
// CHECK:STDOUT: .TestLess = %TestLess.decl
|
|
// CHECK:STDOUT: .TestLessEqual = %TestLessEqual.decl
|
|
// CHECK:STDOUT: .TestGreater = %TestGreater.decl
|
|
// CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
|
|
// CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [concrete = constants.%TestLess] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.9dc = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.9dc = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc6_28.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc6_28.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc6_28.2: Core.Form = init_form %.loc6_28.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %D = value_param call_param0
|
|
// CHECK:STDOUT: %D.ref.loc6_16: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %a: %D = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %D = value_param call_param1
|
|
// CHECK:STDOUT: %D.ref.loc6_22: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %b: %D = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [concrete = constants.%TestLessEqual] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.9dc = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.9dc = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc14_33.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc14_33.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc14_33.2: Core.Form = init_form %.loc14_33.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %D = value_param call_param0
|
|
// CHECK:STDOUT: %D.ref.loc14_21: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %a: %D = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %D = value_param call_param1
|
|
// CHECK:STDOUT: %D.ref.loc14_27: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %b: %D = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [concrete = constants.%TestGreater] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.9dc = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.9dc = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc22_31.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc22_31.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc22_31.2: Core.Form = init_form %.loc22_31.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %D = value_param call_param0
|
|
// CHECK:STDOUT: %D.ref.loc22_19: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %a: %D = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %D = value_param call_param1
|
|
// CHECK:STDOUT: %D.ref.loc22_25: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %b: %D = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [concrete = constants.%TestGreaterEqual] {
|
|
// CHECK:STDOUT: %a.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%a.param_patt]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.9dc = at_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: %b.param_patt: %pattern_type.9dc = value_param_pattern [concrete = constants.%b.param_patt]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.9dc = at_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern %return.param_patt, %.loc30_36.1 [concrete = constants.%return.patt.c0c]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc30_36.1: type = type_literal bool [concrete = bool]
|
|
// CHECK:STDOUT: %.loc30_36.2: Core.Form = init_form %.loc30_36.1 [concrete = constants.%.f34]
|
|
// CHECK:STDOUT: %a.param: %D = value_param call_param0
|
|
// CHECK:STDOUT: %D.ref.loc30_24: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %a: %D = wrapper_binding a, %a.param
|
|
// CHECK:STDOUT: %b.param: %D = value_param call_param1
|
|
// CHECK:STDOUT: %D.ref.loc30_30: type = name_ref D, file.%D.decl [concrete = constants.%D]
|
|
// CHECK:STDOUT: %b: %D = wrapper_binding b, %b.param
|
|
// CHECK:STDOUT: %return.param: ref bool = out_param call_param2
|
|
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @D {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%D
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestLess(%a.param: %D, %b.param: %D) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %D = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %D = name_ref b, %b
|
|
// CHECK:STDOUT: return <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestLessEqual(%a.param: %D, %b.param: %D) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %D = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %D = name_ref b, %b
|
|
// CHECK:STDOUT: return <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestGreater(%a.param: %D, %b.param: %D) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %D = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %D = name_ref b, %b
|
|
// CHECK:STDOUT: return <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestGreaterEqual(%a.param: %D, %b.param: %D) -> out %return.param: bool {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %D = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %D = name_ref b, %b
|
|
// CHECK:STDOUT: return <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|