diff --git a/core/prelude/iterate.carbon b/core/prelude/iterate.carbon index 9f4024674cf9..cbba742d747c 100644 --- a/core/prelude/iterate.carbon +++ b/core/prelude/iterate.carbon @@ -12,7 +12,7 @@ export import library "prelude/operators"; interface Iterate { // TODO: Support iterating ranges of non-copyable values. let ElementType:! Copy & Destroy; - let CursorType:! type; + let CursorType:! Destroy; fn NewCursor[self: Self]() -> CursorType; fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); } @@ -34,6 +34,37 @@ impl forall [T:! Copy & Destroy, N:! IntLiteral()] interface CppRangeForIterate { let Iterator:! type; let Sentinel:! type; - fn Begin[ref self: Self]() -> Iterator; - fn End[ref self: Self]() -> Sentinel; + + // TODO: self must be ref-qualified + fn Begin[self: Self]() -> Iterator; + fn End[self: Self]() -> Sentinel; +} + +impl forall [ + R:! CppRangeForIterate where + .Iterator impls Copy & Destroy & CppUnsafeDeref & Inc & EqWith(.Sentinel) and + .Iterator.(CppUnsafeDeref.Result) impls Copy & Destroy and + .Sentinel impls Copy & Destroy +] + R as Iterate + where + .ElementType = R.Iterator.(CppUnsafeDeref.Result) and + .CursorType = (R.Iterator, R.Sentinel) +{ + alias ElementType = R.Iterator.(CppUnsafeDeref.Result); + + fn NewCursor[self: Self]() -> (R.Iterator, R.Sentinel) { + return (self.Begin(), self.End()); + } + + fn Next[unused self: Self](cursor: (R.Iterator, R.Sentinel)*) -> Optional(ElementType) { + if (cursor->0 != cursor->1) { + returned var result: Optional(ElementType) = + Optional(ElementType).Some(cursor->0.(CppUnsafeDeref.Op)()); + ++cursor->0; + return var; + } else { + return Optional(ElementType).None(); + } + } } diff --git a/toolchain/check/cpp/location.cpp b/toolchain/check/cpp/location.cpp index 14bd6b6a1a6f..2d5c9c5e0a8d 100644 --- a/toolchain/check/cpp/location.cpp +++ b/toolchain/check/cpp/location.cpp @@ -70,6 +70,13 @@ auto GetCppLocation(Context& context, SemIR::LocId loc_id) final_node.clang_source_loc_id()); } + if (!final_node.node_id().has_value()) { + // A non-existent NodeID implies our C++ is compiler-synthesised. Synthetic + // code doesn't have a physical source location to retrieve, so the Clang + // mapping is empty. + return clang::SourceLocation(); + } + // This is a location in Carbon code; get or create a corresponding file in // Clang and build a corresponding location. auto [ir, start_loc] = GetFileInfo(context, final_node.check_ir_id()); diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index 636d6aeb18a6..9b83b9d82739 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -85,12 +85,13 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.e31 [symbolic_self] // CHECK:STDOUT: %Iterate.assoc_type: type = assoc_entity_type @Iterate [concrete] -// CHECK:STDOUT: %assoc1.675: %Iterate.assoc_type = assoc_entity element1, imports.%Core.import_ref.e787 [concrete] +// CHECK:STDOUT: %assoc1.6df: %Iterate.assoc_type = assoc_entity element1, imports.%Core.import_ref.a75 [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] -// CHECK:STDOUT: %impl.elem1.e31: type = impl_witness_access %Iterate.lookup_impl_witness.732, element1 [symbolic_self] +// CHECK:STDOUT: %impl.elem1.1c9: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.732, element1 [symbolic_self] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.c2c: = lookup_impl_witness %Int.2cc5f1.1, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.38c: %Destroy.type = facet_value %Int.2cc5f1.1, (%Destroy.lookup_impl_witness.c2c) [symbolic] // CHECK:STDOUT: %assoc0.181: %Iterate.assoc_type = assoc_entity element0, imports.%Core.import_ref.3a1 [concrete] // CHECK:STDOUT: %impl.elem0.03d: %facet_type.b7c = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.c2c: = lookup_impl_witness %Int.2cc5f1.1, @Destroy [symbolic] // CHECK:STDOUT: %require_complete.692f79.1: = require_complete_type %Int.2cc5f1.1 [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.2f2: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.a64: %Int.as.Copy.impl.Op.type.2f2 = struct_value () [symbolic] @@ -98,9 +99,9 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %Copy.lookup_impl_witness.f90: = lookup_impl_witness %Int.2cc5f1.1, @Copy [symbolic] // CHECK:STDOUT: %.8a3: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %facet_value: %facet_type.b7c = facet_value %Int.2cc5f1.1, (%Destroy.lookup_impl_witness.c2c, %Copy.lookup_impl_witness.f90) [symbolic] -// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where %impl.elem1.e31 = %Int.2cc5f1.1 and %impl.elem0.03d = %facet_value> [symbolic] +// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where %impl.elem1.1c9 = %Destroy.facet.38c and %impl.elem0.03d = %facet_value> [symbolic] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @IntRange.as.Iterate.impl.%Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic] -// CHECK:STDOUT: %require_complete.720: = require_complete_type %Iterate_where.type [symbolic] +// CHECK:STDOUT: %require_complete.a65: = require_complete_type %Iterate_where.type [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor.type: type = fn_type @IntRange.as.Iterate.impl.NewCursor, @IntRange.as.Iterate.impl(%N) [symbolic] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor: %IntRange.as.Iterate.impl.NewCursor.type = struct_value () [symbolic] // CHECK:STDOUT: %ptr.f8f: type = ptr_type %Int.2cc5f1.1 [symbolic] @@ -163,7 +164,6 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %impl.elem0.e3c: %.7cf = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.461: = specific_impl_function %impl.elem0.e3c, @Inc.WithSelf.Op(%Inc.facet) [symbolic] // CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.f95, @Optional.Some(%OptionalStorage.facet.6e7) [symbolic] -// CHECK:STDOUT: %Destroy.facet.38c: %Destroy.type = facet_value %Int.2cc5f1.1, (%Destroy.lookup_impl_witness.c2c) [symbolic] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.833: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.38c) [symbolic] // CHECK:STDOUT: %.b6c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.833, %Destroy.facet.38c [symbolic] // CHECK:STDOUT: %impl.elem0.913: %.b6c = impl_witness_access %Destroy.lookup_impl_witness.c2c, element0 [symbolic] @@ -228,11 +228,11 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Iterate: type = import_ref Core//prelude/iterate, Iterate, loaded [concrete = constants.%Iterate.type] // CHECK:STDOUT: %Core.import_ref.5b6: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0.181] -// CHECK:STDOUT: %Core.import_ref.a1d: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc1.675] +// CHECK:STDOUT: %Core.import_ref.7ba: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc1.6df] // CHECK:STDOUT: %Core.import_ref.3be: @Optional.%Optional.None.type (%Optional.None.type.bf3) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.216)] // CHECK:STDOUT: %Core.import_ref.820: @Optional.%Optional.Some.type (%Optional.Some.type.b88) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Some (constants.%Optional.Some.e32)] -// CHECK:STDOUT: %Core.import_ref.e787: type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = %CursorType] -// CHECK:STDOUT: %CursorType: type = assoc_const_decl @CursorType [concrete] {} +// CHECK:STDOUT: %Core.import_ref.a75: %Destroy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = %CursorType] +// CHECK:STDOUT: %CursorType: %Destroy.type = assoc_const_decl @CursorType [concrete] {} // CHECK:STDOUT: %Core.import_ref.3a1: %facet_type.b7c = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = %ElementType] // CHECK:STDOUT: %ElementType: %facet_type.b7c = assoc_const_decl @ElementType [concrete] {} // CHECK:STDOUT: %Core.import_ref.55f: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.2f2) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.a64)] @@ -297,15 +297,16 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(%N) [symbolic = %IntRange (constants.%IntRange.6d0)] // CHECK:STDOUT: %Int.loc9_54.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc9_54.1 (constants.%Int.2cc5f1.1)] -// CHECK:STDOUT: %.loc9_85.1: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc9_85.1 (constants.%.8a3)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_54.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.c2c)] +// CHECK:STDOUT: %Destroy.facet.loc9_54.1: %Destroy.type = facet_value %Int.loc9_54.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc9_54.1 (constants.%Destroy.facet.38c)] +// CHECK:STDOUT: %.loc9_85.1: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc9_85.1 (constants.%.8a3)] // CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_54.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.f90)] // CHECK:STDOUT: %facet_value.loc9_85.1: %facet_type.b7c = facet_value %Int.loc9_54.1, (%Destroy.lookup_impl_witness, %Copy.lookup_impl_witness) [symbolic = %facet_value.loc9_85.1 (constants.%facet_value)] -// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where constants.%impl.elem1.e31 = %Int.loc9_54.1 and constants.%impl.elem0.03d = %facet_value.loc9_85.1> [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] +// CHECK:STDOUT: %Iterate_where.type: type = facet_type <@Iterate where constants.%impl.elem1.1c9 = %Destroy.facet.loc9_54.1 and constants.%impl.elem0.03d = %facet_value.loc9_85.1> [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] // CHECK:STDOUT: %Iterate.impl_witness.loc9_87.2: = impl_witness %Iterate.impl_witness_table, @IntRange.as.Iterate.impl(%N) [symbolic = %Iterate.impl_witness.loc9_87.2 (constants.%Iterate.impl_witness)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.720)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Iterate_where.type [symbolic = %require_complete (constants.%require_complete.a65)] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor.type: type = fn_type @IntRange.as.Iterate.impl.NewCursor, @IntRange.as.Iterate.impl(%N) [symbolic = %IntRange.as.Iterate.impl.NewCursor.type (constants.%IntRange.as.Iterate.impl.NewCursor.type)] // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor: @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.NewCursor.type (%IntRange.as.Iterate.impl.NewCursor.type) = struct_value () [symbolic = %IntRange.as.Iterate.impl.NewCursor (constants.%IntRange.as.Iterate.impl.NewCursor)] // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next.type: type = fn_type @IntRange.as.Iterate.impl.Next, @IntRange.as.Iterate.impl(%N) [symbolic = %IntRange.as.Iterate.impl.Next.type (constants.%IntRange.as.Iterate.impl.Next.type)] @@ -370,7 +371,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: } // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant.loc9_87.2, %impl_witness_assoc_constant.loc9_87.1, %IntRange.as.Iterate.impl.NewCursor.decl, %IntRange.as.Iterate.impl.Next.decl), @IntRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Iterate.impl_witness.loc9_87.1: = impl_witness %Iterate.impl_witness_table, @IntRange.as.Iterate.impl(constants.%N) [symbolic = %Iterate.impl_witness.loc9_87.2 (constants.%Iterate.impl_witness)] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.1: type = impl_witness_assoc_constant constants.%Int.2cc5f1.1 [symbolic = %Int.loc9_54.1 (constants.%Int.2cc5f1.1)] +// CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.1: %Destroy.type = impl_witness_assoc_constant constants.%Destroy.facet.38c [symbolic = %Destroy.facet.loc9_54.1 (constants.%Destroy.facet.38c)] // CHECK:STDOUT: %impl_witness_assoc_constant.loc9_87.2: %facet_type.b7c = impl_witness_assoc_constant constants.%facet_value [symbolic = %facet_value.loc9_85.1 (constants.%facet_value)] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -434,12 +435,14 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %.Self.ref.loc9_30: %Iterate.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.e31] // CHECK:STDOUT: %.Self.as_type.loc9_30: type = facet_access_type %.Self.ref.loc9_30 [symbolic_self = constants.%.Self.as_type] // CHECK:STDOUT: %.loc9_30: type = converted %.Self.ref.loc9_30, %.Self.as_type.loc9_30 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %CursorType.ref: %Iterate.assoc_type = name_ref CursorType, imports.%Core.import_ref.a1d [concrete = constants.%assoc1.675] -// CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%Iterate.lookup_impl_witness.732, element1 [symbolic_self = constants.%impl.elem1.e31] +// CHECK:STDOUT: %CursorType.ref: %Iterate.assoc_type = name_ref CursorType, imports.%Core.import_ref.7ba [concrete = constants.%assoc1.6df] +// CHECK:STDOUT: %impl.elem1: %Destroy.type = impl_witness_access constants.%Iterate.lookup_impl_witness.732, element1 [symbolic_self = constants.%impl.elem1.1c9] // CHECK:STDOUT: %Core.ref.loc9_44: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc9_48: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc9_53: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] // CHECK:STDOUT: %Int.loc9_54.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc9_54.1 (constants.%Int.2cc5f1.1)] +// CHECK:STDOUT: %Destroy.facet.loc9_54.2: %Destroy.type = facet_value %Int.loc9_54.2, (constants.%Destroy.lookup_impl_witness.c2c) [symbolic = %Destroy.facet.loc9_54.1 (constants.%Destroy.facet.38c)] +// CHECK:STDOUT: %.loc9_54: %Destroy.type = converted %Int.loc9_54.2, %Destroy.facet.loc9_54.2 [symbolic = %Destroy.facet.loc9_54.1 (constants.%Destroy.facet.38c)] // CHECK:STDOUT: %.Self.ref.loc9_60: %Iterate.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.e31] // CHECK:STDOUT: %.Self.as_type.loc9_60: type = facet_access_type %.Self.ref.loc9_60 [symbolic_self = constants.%.Self.as_type] // CHECK:STDOUT: %.loc9_60: type = converted %.Self.ref.loc9_60, %.Self.as_type.loc9_60 [symbolic_self = constants.%.Self.as_type] @@ -453,7 +456,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %.loc9_85.2: %facet_type.b7c = converted %Int.loc9_85, %facet_value.loc9_85.2 [symbolic = %facet_value.loc9_85.1 (constants.%facet_value)] // CHECK:STDOUT: %.loc9_24: type = where_expr [symbolic = %Iterate_where.type (constants.%Iterate_where.type)] { // CHECK:STDOUT: requirement_base_facet_type %Iterate.ref -// CHECK:STDOUT: requirement_rewrite %impl.elem1, %Int.loc9_54.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem1, %.loc9_54 // CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_85.2 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -759,15 +762,16 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: %IntRange => constants.%IntRange.6d0 // CHECK:STDOUT: %Int.loc9_54.1 => constants.%Int.2cc5f1.1 -// CHECK:STDOUT: %.loc9_85.1 => constants.%.8a3 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%Destroy.lookup_impl_witness.c2c +// CHECK:STDOUT: %Destroy.facet.loc9_54.1 => constants.%Destroy.facet.38c +// CHECK:STDOUT: %.loc9_85.1 => constants.%.8a3 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.f90 // CHECK:STDOUT: %facet_value.loc9_85.1 => constants.%facet_value // CHECK:STDOUT: %Iterate_where.type => constants.%Iterate_where.type // CHECK:STDOUT: %Iterate.impl_witness.loc9_87.2 => constants.%Iterate.impl_witness // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.720 +// CHECK:STDOUT: %require_complete => constants.%require_complete.a65 // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor.type => constants.%IntRange.as.Iterate.impl.NewCursor.type // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor => constants.%IntRange.as.Iterate.impl.NewCursor // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next.type => constants.%IntRange.as.Iterate.impl.Next.type diff --git a/toolchain/check/testdata/interop/cpp/range_for.carbon b/toolchain/check/testdata/interop/cpp/range_for.carbon index 3ff935d8de2d..209e96e827dd 100644 --- a/toolchain/check/testdata/interop/cpp/range_for.carbon +++ b/toolchain/check/testdata/interop/cpp/range_for.carbon @@ -42,14 +42,17 @@ public: }; '''; -fn Test[R:! Core.CppRangeForIterate where .Iterator impls Core.Destroy and .Sentinel impls Core.Destroy](var r: R) { +fn Test[R:! Core.Iterate where .ElementType = i32](r: R) { + var sum: i32 = 0; + //@dump-sem-ir-begin - r.Begin(); - r.End(); + for (i: i32 in r) { + sum += i; + } //@dump-sem-ir-end } -fn TestDriver(var m: Cpp.MutableRange, var c: Cpp.ConstRange) { +fn TestDriver(var m: Cpp.MutableRange, c: Cpp.ConstRange) { Test(m); Test(c); } @@ -59,17 +62,19 @@ fn TestDriver(var m: Cpp.MutableRange, var c: Cpp.ConstRange) { library "[[@TEST_NAME]]"; import Cpp inline '''c++ -class MutableRange { - struct ValueType {}; +struct ValueType { + auto operator+=(const ValueType&) -> ValueType&; +}; +class MutableRange { struct Iterator { auto operator*() const -> ValueType&; auto operator++() -> Iterator&; }; struct Sentinel { - friend auto operator==(Sentinel, Iterator) -> bool; - friend auto operator!=(Sentinel, Iterator) -> bool; + friend auto operator==(Iterator, Sentinel) -> bool; + friend auto operator!=(Iterator, Sentinel) -> bool; }; public: auto begin() -> Iterator; @@ -77,16 +82,14 @@ public: }; class ConstRange { - struct ValueType {}; - struct Iterator { auto operator*() const -> ValueType; auto operator++() -> Iterator&; }; struct Sentinel { - friend auto operator==(Sentinel, Iterator) -> bool; - friend auto operator!=(Sentinel, Iterator) -> bool; + friend auto operator==(Iterator, Sentinel) -> bool; + friend auto operator!=(Iterator, Sentinel) -> bool; }; public: auto begin() const -> Iterator; @@ -94,14 +97,17 @@ public: }; '''; -fn Test[R:! Core.CppRangeForIterate where .Iterator impls Core.Destroy and .Sentinel impls Core.Destroy](var r: R) { +fn Test[R:! Core.Iterate where .ElementType = Cpp.ValueType](var r: R) { + var sum: Cpp.ValueType = Cpp.ValueType.ValueType(); + //@dump-sem-ir-begin - r.Begin(); - r.End(); + for (i: Cpp.ValueType in r) { + sum += i; + } //@dump-sem-ir-end } -fn TestDriver(var m: Cpp.MutableRange, var c: Cpp.ConstRange) { +fn TestDriver(var m: Cpp.MutableRange, c: Cpp.ConstRange) { Test(m); Test(c); } @@ -112,21 +118,9 @@ library "[[@TEST_NAME]]"; import Cpp inline '''c++ namespace N { -class MutableRange { - struct Iterator { - auto operator*() const -> int&; - auto operator++() -> Iterator&; - friend auto operator==(Iterator, Iterator) -> bool; - friend auto operator!=(Iterator, Iterator) -> bool; - }; -public: - friend auto begin(MutableRange&) -> Iterator; - friend auto end(MutableRange&) -> Iterator; -}; - class ConstRange { struct Iterator { - auto operator*() const -> const int&; + auto operator*() const -> const double&; auto operator++() -> Iterator&; friend auto operator==(Iterator, Iterator) -> bool; friend auto operator!=(Iterator, Iterator) -> bool; @@ -138,26 +132,140 @@ public: } // namespace N '''; -fn Test[R:! Core.CppRangeForIterate where .Iterator impls Core.Destroy and .Sentinel impls Core.Destroy](var r: R) { +fn Test[R:! Core.Iterate where .ElementType = f64](r: R) { + var sum: f64 = 0.0; + //@dump-sem-ir-begin - r.Begin(); - r.End(); + for (i: f64 in r) { + sum += i; + } //@dump-sem-ir-end } -fn TestDriver(var m: Cpp.N.MutableRange, var c: Cpp.N.ConstRange) { - Test(m); +fn TestDriver(c: Cpp.N.ConstRange) { Test(c); } +// --- fail_todo_adl_returns_same_types_mutable.carbon + +// TODO: merge with adl_returns_same_types.carbon when passing. + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +namespace N { +class MutableRange { + struct Iterator { + auto operator*() const -> double&; + auto operator++() -> Iterator&; + friend auto operator==(Iterator, Iterator) -> bool; + friend auto operator!=(Iterator, Iterator) -> bool; + }; +public: + friend auto begin(MutableRange&) -> Iterator; + friend auto end(MutableRange&) -> Iterator; +}; +} // namespace N +'''; + +fn Test[R:! Core.Iterate where .ElementType = f64](r: R) { + var sum: f64 = 0.0; + + //@dump-sem-ir-begin + for (i: f64 in r) { + sum += i; + } + //@dump-sem-ir-end +} + +fn TestDriver(var m: Cpp.N.MutableRange) { + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+32]]:3: error: facet type `Core.CppRangeForIterate where .(Core.CppRangeForIterate.Iterator) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator) impls Core.Copy and .(Core.CppRangeForIterate.Iterator) impls Core.CppUnsafeDeref and .(Core.CppRangeForIterate.Iterator) impls Core.EqWith(.(Core.CppRangeForIterate.Sentinel)) and .(Core.CppRangeForIterate.Iterator) impls Core.Inc and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Copy and .(Core.CppRangeForIterate.Sentinel) impls Core.Destroy and .(Core.CppRangeForIterate.Sentinel) impls Core.Copy` can not be identified [ImplLookupInUnidentifiedFacetType] + // CHECK:STDERR: Test(m); + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:12: note: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-23]]:34: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: friend auto begin(MutableRange&) -> Iterator; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-23]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = f64](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+16]]:3: error: facet type `Core.CppRangeForIterate where .(Core.CppRangeForIterate.Iterator) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator) impls Core.Copy and .(Core.CppRangeForIterate.Iterator) impls Core.CppUnsafeDeref and .(Core.CppRangeForIterate.Iterator) impls Core.EqWith(.(Core.CppRangeForIterate.Sentinel)) and .(Core.CppRangeForIterate.Iterator) impls Core.Inc and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Copy and .(Core.CppRangeForIterate.Sentinel) impls Core.Destroy and .(Core.CppRangeForIterate.Sentinel) impls Core.Copy` can not be identified [ImplLookupInUnidentifiedFacetType] + // CHECK:STDERR: Test(m); + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:10: note: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fn End[self: Self]() -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-38]]:32: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: friend auto end(MutableRange&) -> Iterator; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn End[self: Self]() -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE-39]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = f64](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + Test(m); +} + // --- adl_returns_different_types.carbon library "[[@TEST_NAME]]"; import Cpp inline '''c++ namespace N { +struct ValueType { + auto operator+=(const ValueType& other) -> ValueType&; +}; + +class ConstRange { + struct Iterator { + auto operator*() const -> ValueType; + auto operator++() -> Iterator&; + }; + + struct Sentinel { + friend auto operator==(Iterator, Sentinel) -> bool; + friend auto operator!=(Iterator, Sentinel) -> bool; + }; +public: + friend auto begin(const ConstRange&) -> Iterator; + friend auto end(const ConstRange&) -> Sentinel; +}; +} // namespace N +'''; + +fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + var sum: Cpp.N.ValueType = Cpp.N.ValueType.ValueType(); + + //@dump-sem-ir-begin + for (i: Cpp.N.ValueType in r) { + sum += i; + } + //@dump-sem-ir-end +} + +fn TestDriver(c: Cpp.N.ConstRange) { + Test(c); +} + +// --- fail_todo_adl_returns_different_types_mutable.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline '''c++ +namespace N { +struct ValueType { + auto operator+=(const ValueType& other) -> ValueType&; +}; + class MutableRange { - struct ValueType {}; struct Iterator { auto operator*() const -> ValueType&; @@ -172,44 +280,78 @@ public: friend auto begin(MutableRange&) -> Iterator; friend auto end(MutableRange&) -> Sentinel; }; - -class ConstRange { - struct ValueType {}; - - struct Iterator { - auto operator*() const -> ValueType; - auto operator++() -> Iterator&; - }; - - struct Sentinel { - friend auto operator==(Sentinel, Iterator) -> bool; - friend auto operator!=(Sentinel, Iterator) -> bool; - }; -public: - friend auto begin(const ConstRange&) -> Iterator; - friend auto end(const ConstRange&) -> Sentinel; -}; -} // namespace N +} '''; -fn Test[R:! Core.CppRangeForIterate where .Iterator impls Core.Destroy and .Sentinel impls Core.Destroy](var r: R) { +fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + var sum: Cpp.N.ValueType = Cpp.N.ValueType.ValueType(); + //@dump-sem-ir-begin - r.Begin(); - r.End(); + for (i: Cpp.N.ValueType in r) { + sum += i; + } //@dump-sem-ir-end } -fn TestDriver(var m: Cpp.N.MutableRange, var c: Cpp.N.ConstRange) { +fn TestDriver(var m: Cpp.N.MutableRange) { + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+46]]:3: error: facet type `Core.CppRangeForIterate where .(Core.CppRangeForIterate.Iterator) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator) impls Core.Copy and .(Core.CppRangeForIterate.Iterator) impls Core.CppUnsafeDeref and .(Core.CppRangeForIterate.Iterator) impls Core.EqWith(.(Core.CppRangeForIterate.Sentinel)) and .(Core.CppRangeForIterate.Iterator) impls Core.Inc and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Copy and .(Core.CppRangeForIterate.Sentinel) impls Core.Destroy and .(Core.CppRangeForIterate.Sentinel) impls Core.Copy` can not be identified [ImplLookupInUnidentifiedFacetType] + // CHECK:STDERR: Test(m); + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:12: note: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-23]]:34: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: friend auto begin(MutableRange&) -> Iterator; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-23]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+30]]:3: error: facet type `Core.CppRangeForIterate where .(Core.CppRangeForIterate.Iterator) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator) impls Core.Copy and .(Core.CppRangeForIterate.Iterator) impls Core.CppUnsafeDeref and .(Core.CppRangeForIterate.Iterator) impls Core.EqWith(.(Core.CppRangeForIterate.Sentinel)) and .(Core.CppRangeForIterate.Iterator) impls Core.Inc and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Copy and .(Core.CppRangeForIterate.Sentinel) impls Core.Destroy and .(Core.CppRangeForIterate.Sentinel) impls Core.Copy` can not be identified [ImplLookupInUnidentifiedFacetType] + // CHECK:STDERR: Test(m); + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:10: note: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fn End[self: Self]() -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-38]]:32: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: friend auto end(MutableRange&) -> Sentinel; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn End[self: Self]() -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-39]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+14]]:3: error: semantics TODO: `Rewriting operator== using operator== is not supported` [SemanticsTodo] + // CHECK:STDERR: Test(m); + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-46]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.N.MutableRange` into type implementing `Core.Iterate where .(Core.Iterate.ElementType) = Cpp.N.ValueType as Core.Destroy & Core.Copy` [ConversionFailureTypeToFacet] + // CHECK:STDERR: Test(m); + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE-53]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: Test(m); - Test(c); } -// --- adl_overloads.carbon +// --- fail_todo_adl_overloads.carbon import Cpp inline '''c++ namespace N { +struct ValueType { + auto operator+=(const ValueType&) -> ValueType&; +}; + class MutableAndConstRange { - struct ValueType {}; struct Iterator { auto operator*() const -> ValueType&; @@ -236,14 +378,49 @@ class MutableAndConstRange { } '''; -fn Test[R:! Core.CppRangeForIterate where .Iterator impls Core.Destroy and .Sentinel impls Core.Destroy](var r: R) { +fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + var sum: Cpp.N.ValueType = Cpp.N.ValueType.ValueType(); + //@dump-sem-ir-begin - r.Begin(); - r.End(); + for (i: Cpp.N.ValueType in r) { + sum += i; + } //@dump-sem-ir-end } fn TestDriver(var mc: Cpp.N.MutableAndConstRange) { + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+32]]:3: error: facet type `Core.CppRangeForIterate where .(Core.CppRangeForIterate.Iterator) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator) impls Core.Copy and .(Core.CppRangeForIterate.Iterator) impls Core.CppUnsafeDeref and .(Core.CppRangeForIterate.Iterator) impls Core.EqWith(.(Core.CppRangeForIterate.Sentinel)) and .(Core.CppRangeForIterate.Iterator) impls Core.Inc and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Copy and .(Core.CppRangeForIterate.Sentinel) impls Core.Destroy and .(Core.CppRangeForIterate.Sentinel) impls Core.Copy` can not be identified [ImplLookupInUnidentifiedFacetType] + // CHECK:STDERR: Test(mc); + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:12: note: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-26]]:44: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: friend auto begin(MutableAndConstRange&) -> Iterator; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:39:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn Begin[self: Self]() -> Iterator; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-23]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+16]]:3: error: facet type `Core.CppRangeForIterate where .(Core.CppRangeForIterate.Iterator) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator) impls Core.Copy and .(Core.CppRangeForIterate.Iterator) impls Core.CppUnsafeDeref and .(Core.CppRangeForIterate.Iterator) impls Core.EqWith(.(Core.CppRangeForIterate.Sentinel)) and .(Core.CppRangeForIterate.Iterator) impls Core.Inc and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Destroy and .(Core.CppRangeForIterate.Iterator).(Core.CppUnsafeDeref.Result) impls Core.Copy and .(Core.CppRangeForIterate.Sentinel) impls Core.Destroy and .(Core.CppRangeForIterate.Sentinel) impls Core.Copy` can not be identified [ImplLookupInUnidentifiedFacetType] + // CHECK:STDERR: Test(mc); + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:10: note: value expression passed to reference parameter [ValueForRefParam] + // CHECK:STDERR: fn End[self: Self]() -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-41]]:42: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: friend auto end(MutableAndConstRange&) -> Iterator; + // CHECK:STDERR: ^ + // CHECK:STDERR: {{.*}}/prelude/iterate.carbon:40:3: note: while building thunk to match the signature of this function [ThunkSignature] + // CHECK:STDERR: fn End[self: Self]() -> Sentinel; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE-39]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.Iterate where .ElementType = Cpp.N.ValueType](r: R) { + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: Test(mc); } @@ -311,12 +488,9 @@ struct EndFunctionDeleted { }; '''; -// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+4]]:38: warning: binding `r` unused [UnusedBinding] -// CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -fn Test[R:! Core.CppRangeForIterate](r: R) { -} +// We deliberately use `Core.CppRangeForIterate` here, since we want to confirm +// that types don't implement this interface. +fn Test[R:! Core.CppRangeForIterate](unused r: R) {} fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, var no_begin_method: Cpp.NoBeginMethod, @@ -335,129 +509,129 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoBeginEnd` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(no_begin_end); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-20]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-19]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(no_begin_end); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoBeginMethod` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(no_begin_method); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-29]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-28]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(no_begin_method); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoEndMethod` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(no_end_method); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-38]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-37]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(no_end_method); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoBeginADL` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(no_begin_adl); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-47]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-46]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(no_begin_adl); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoEndADL` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(no_end_adl); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-56]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-55]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(no_end_adl); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.BeginMethodEndADL` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(begin_method_end_adl); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-65]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-64]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(begin_method_end_adl); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.BeginADLEndMethod` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(begin_adl_end_method); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-74]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-73]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(begin_adl_end_method); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.BeginFieldEndMethod` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(begin_field_end_method); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-83]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-82]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(begin_field_end_method); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.BeginMethodEndField` into type implementing `Core.CppRangeForIterate` [ConversionFailureTypeToFacet] // CHECK:STDERR: Test(begin_method_end_field); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-92]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-91]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(begin_method_end_field); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+10]]:28: error: attempt to use a deleted function [CppInteropParseError] - // CHECK:STDERR: 176 | Test(begin_method_deleted); + // CHECK:STDERR: 173 | Test(begin_method_deleted); // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-125]]:8: note: 'begin' has been explicitly marked deleted here [CppInteropParseNote] + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-122]]:8: note: 'begin' has been explicitly marked deleted here [CppInteropParseNote] // CHECK:STDERR: 44 | auto begin() = delete; // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-104]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-103]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(begin_method_deleted); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+10]]:26: error: attempt to use a deleted function [CppInteropParseError] - // CHECK:STDERR: 188 | Test(end_method_deleted); + // CHECK:STDERR: 185 | Test(end_method_deleted); // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-131]]:8: note: 'end' has been explicitly marked deleted here [CppInteropParseNote] + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-128]]:8: note: 'end' has been explicitly marked deleted here [CppInteropParseNote] // CHECK:STDERR: 50 | auto end() = delete; // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-116]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-115]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(end_method_deleted); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+10]]:30: error: call to deleted function 'begin' [CppInteropParseError] - // CHECK:STDERR: 200 | Test(begin_function_deleted); + // CHECK:STDERR: 197 | Test(begin_function_deleted); // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-139]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote] + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-136]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote] // CHECK:STDERR: 54 | friend auto begin(const BeginFunctionDeleted&) = delete; // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-128]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-127]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(begin_function_deleted); // CHECK:STDERR: fail_never_valid.carbon:[[@LINE+10]]:28: error: call to deleted function 'end' [CppInteropParseError] - // CHECK:STDERR: 212 | Test(end_function_deleted); + // CHECK:STDERR: 209 | Test(end_function_deleted); // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-145]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote] + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-142]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote] // CHECK:STDERR: 60 | friend auto end(const EndFunctionDeleted&) = delete; // CHECK:STDERR: | ^ - // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-140]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] - // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](r: R) { - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fail_never_valid.carbon:[[@LINE-139]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere] + // CHECK:STDERR: fn Test[R:! Core.CppRangeForIterate](unused r: R) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Test(end_function_deleted); } @@ -465,292 +639,554 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: --- methods_return_same_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] +// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %facet_type.b7c: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %T.4e7: %OptionalStorage.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Optional.Get.type.d22: type = fn_type @Optional.Get, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.Get.6fc: %Optional.Get.type.d22 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.498: type = fn_type @Optional.HasValue, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.bf8: %Optional.HasValue.type.498 = struct_value () [symbolic] +// CHECK:STDOUT: %T.cb0: %facet_type.b7c = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.f8b: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.type.46f: type = fn_type @T.as_type.as.OptionalStorage.impl.Get, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.8c2: %T.as_type.as.OptionalStorage.impl.Get.type.46f = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.type.0ae: type = fn_type @T.as_type.as.OptionalStorage.impl.Has, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.e0f: %T.as_type.as.OptionalStorage.impl.Has.type.0ae = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.type.87a: type = fn_type @T.as_type.as.OptionalStorage.impl.Some, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.898: %T.as_type.as.OptionalStorage.impl.Some.type.87a = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.type.ceb: type = fn_type @T.as_type.as.OptionalStorage.impl.None, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.9dd: %T.as_type.as.OptionalStorage.impl.None.type.ceb = struct_value () [symbolic] +// CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.03d: %facet_type.b7c = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %N.fe9: Core.IntLiteral = symbolic_binding N, 0 [symbolic] +// CHECK:STDOUT: %Int.2cc5f1.1: type = class_type @Int, @Int(%N.fe9) [symbolic] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.104: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.2: type = fn_type @Destroy.Op.loc30_47.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.2: %Destroy.Op.type.790b3b.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.2: = custom_witness (%Destroy.Op.2dd605.2), @Destroy [concrete] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.2f2: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N.fe9) [symbolic] +// CHECK:STDOUT: %Int.as.Copy.impl.Op.a64: %Int.as.Copy.impl.Op.type.2f2 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.1a4: = impl_witness imports.%Copy.impl_witness_table.0ac, @Int.as.Copy.impl(%int_32) [concrete] +// CHECK:STDOUT: %facet_value.6cc: %facet_type.b7c = facet_value %i32, (%custom_witness.e20f1f.2, %Copy.impl_witness.1a4) [concrete] +// CHECK:STDOUT: %Iterate_where.type.6aa: type = facet_type <@Iterate where %impl.elem0.03d = %facet_value.6cc> [concrete] +// CHECK:STDOUT: %R.5de: %Iterate_where.type.6aa = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %R.as_type.549: type = facet_access_type %R.5de [symbolic] +// CHECK:STDOUT: %pattern_type.8bb: type = pattern_type %R.as_type.549 [symbolic] +// CHECK:STDOUT: %ImplicitAs.type.360: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] +// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Int.2cc5f1.2: type = class_type @Int, @Int(%To) [symbolic] +// CHECK:STDOUT: %facet_type.049: type = facet_type <@IntFitsIn, @IntFitsIn(%Int.2cc5f1.2) & @AnyInt> [symbolic] +// CHECK:STDOUT: %From.094: %facet_type.049 = symbolic_binding From, 1 [symbolic] +// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.type.5e2: type = fn_type @From.as_type.as.ImplicitAs.impl.Convert, @From.as_type.as.ImplicitAs.impl(%To, %From.094) [symbolic] +// CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.58d: %From.as_type.as.ImplicitAs.impl.Convert.type.5e2 = struct_value () [symbolic] // CHECK:STDOUT: %CppRangeForIterate.type: type = facet_type <@CppRangeForIterate> [concrete] -// CHECK:STDOUT: %Self.6c6: %CppRangeForIterate.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.056be7.1: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.a331a3.1: %CppRangeForIterate.WithSelf.End.type.056be7.1 = struct_value () [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.753895.1: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.2b31f7.1: %CppRangeForIterate.WithSelf.Begin.type.753895.1 = struct_value () [symbolic] // CHECK:STDOUT: %.Self.10b: %CppRangeForIterate.type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate.assoc_type: type = assoc_entity_type @CppRangeForIterate [concrete] // CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.5bf: = lookup_impl_witness %.Self.10b, @CppRangeForIterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.d47: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element0 [symbolic_self] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.bce: = lookup_impl_witness %impl.elem0.d47, @CppUnsafeDeref [symbolic_self] +// CHECK:STDOUT: %impl.elem0.c87: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.bce, element0 [symbolic_self] // CHECK:STDOUT: %impl.elem1.846: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element1 [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem1.846 impls @Destroy> [concrete] -// CHECK:STDOUT: %R: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] -// CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.26c6ea.2: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %assoc2: %CppRangeForIterate.assoc_type = assoc_entity element2, imports.%Core.import_ref.213 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R, @CppRangeForIterate [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.facet.0d2: %CppRangeForIterate.type = facet_value %R.as_type, (%CppRangeForIterate.lookup_impl_witness.edd1fe.2) [symbolic] -// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem0.d47 impls @Copy and %impl.elem0.d47 impls @CppUnsafeDeref and %impl.elem0.d47 impls @EqWith, @EqWith(%impl.elem1.846) and %impl.elem0.d47 impls @Inc and %impl.elem0.c87 impls @Destroy and %impl.elem0.c87 impls @Copy and %impl.elem1.846 impls @Destroy and %impl.elem1.846 impls @Copy> [concrete] +// CHECK:STDOUT: %R.6c6: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R.6c6, @CppRangeForIterate [symbolic] // CHECK:STDOUT: %impl.elem1.bdcd2d.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element1 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.57e: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.04d: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %.b85: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.57e, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem2: %.b85 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c0f: = specific_impl_function %impl.elem2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %assoc3: %CppRangeForIterate.assoc_type = assoc_entity element3, imports.%Core.import_ref.730 [concrete] -// CHECK:STDOUT: %.b40: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.04d, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem3: %.b40 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.d6a: = specific_impl_function %impl.elem3, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.a8f: = lookup_impl_witness %impl.elem1.bdcd2d.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.543: %Destroy.type = facet_value %impl.elem1.bdcd2d.2, (%Destroy.lookup_impl_witness.a8f) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.366: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %.b83: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.366, %Destroy.facet.543 [symbolic] -// CHECK:STDOUT: %impl.elem0.acf: %.b83 = impl_witness_access %Destroy.lookup_impl_witness.a8f, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.add: = specific_impl_function %impl.elem0.acf, @Destroy.WithSelf.Op(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.089: = lookup_impl_witness %impl.elem0.d5966e.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.5e8: %Destroy.type = facet_value %impl.elem0.d5966e.2, (%Destroy.lookup_impl_witness.089) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.7cb: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.5e8) [symbolic] -// CHECK:STDOUT: %.a68: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.7cb, %Destroy.facet.5e8 [symbolic] -// CHECK:STDOUT: %impl.elem0.f59: %.a68 = impl_witness_access %Destroy.lookup_impl_witness.089, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.f06: = specific_impl_function %impl.elem0.f59, @Destroy.WithSelf.Op(%Destroy.facet.5e8) [symbolic] +// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.384: type = tuple_type (%impl.elem0.d5966e.2, %impl.elem1.bdcd2d.2) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.0ba: = lookup_impl_witness %tuple.type.384, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.2fe: %Destroy.type = facet_value %tuple.type.384, (%Destroy.lookup_impl_witness.0ba) [symbolic] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.ca4: = lookup_impl_witness %impl.elem0.d5966e.2, @CppUnsafeDeref [symbolic] +// CHECK:STDOUT: %impl.elem0.b10: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.ca4, element0 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.3d8: = lookup_impl_witness %impl.elem0.b10, @Destroy [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.bff: = lookup_impl_witness %impl.elem0.b10, @Copy [symbolic] +// CHECK:STDOUT: %facet_value.a30: %facet_type.b7c = facet_value %impl.elem0.b10, (%Destroy.lookup_impl_witness.3d8, %Copy.lookup_impl_witness.bff) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.5b5: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.cd2: %R.as_type.as.Iterate.impl.Next.type.5b5 = struct_value () [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.9b6: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.b29: %R.as_type.as.Iterate.impl.NewCursor.type.9b6 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.ccf: = lookup_impl_witness %R.5de, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.6f6: %Iterate.type = facet_value %R.as_type.549, (%Iterate.lookup_impl_witness.ccf) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.4ee: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.6f6) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.652: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.6f6) [symbolic] +// CHECK:STDOUT: %.75c: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.4ee, %Iterate.facet.6f6 [symbolic] +// CHECK:STDOUT: %impl.elem2.d4c: %.75c = impl_witness_access %Iterate.lookup_impl_witness.ccf, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.ad9: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.ccf, element1 [symbolic] +// CHECK:STDOUT: %as_type.cf9: type = facet_access_type %impl.elem1.ad9 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.314: = specific_impl_function %impl.elem2.d4c, @Iterate.WithSelf.NewCursor(%Iterate.facet.6f6) [symbolic] +// CHECK:STDOUT: %ptr.233: type = ptr_type %as_type.cf9 [symbolic] +// CHECK:STDOUT: %.58a: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.652, %Iterate.facet.6f6 [symbolic] +// CHECK:STDOUT: %impl.elem3.25e: %.58a = impl_witness_access %Iterate.lookup_impl_witness.ccf, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.388: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.6cc) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.80d: = impl_witness imports.%OptionalStorage.impl_witness_table.6f7, @T.as_type.as.OptionalStorage.impl(%facet_value.6cc) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.26b: %OptionalStorage.type = facet_value %i32, (%OptionalStorage.impl_witness.80d) [concrete] +// CHECK:STDOUT: %Optional.af5: type = class_type @Optional, @Optional(%OptionalStorage.facet.26b) [concrete] +// CHECK:STDOUT: %specific_impl_fn.85b: = specific_impl_function %impl.elem3.25e, @Iterate.WithSelf.Next(%Iterate.facet.6f6) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.4a8: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.26b) [concrete] +// CHECK:STDOUT: %Optional.HasValue.3cd: %Optional.HasValue.type.4a8 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.f91: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.26b) [concrete] +// CHECK:STDOUT: %Optional.Get.4e5: %Optional.Get.type.f91 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.95dcf3.2: %Destroy.type = facet_value %i32, (%custom_witness.e20f1f.2) [concrete] +// CHECK:STDOUT: %MaybeUnformed.30b: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.95dcf3.2) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.f8d: type = struct_type {.value: %MaybeUnformed.30b, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.3cd, @Optional.HasValue(%OptionalStorage.facet.26b) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.4e5, @Optional.Get(%OptionalStorage.facet.26b) [concrete] +// CHECK:STDOUT: %AddAssignWith.type.e37: type = facet_type <@AddAssignWith, @AddAssignWith(%i32)> [concrete] +// CHECK:STDOUT: %ImplicitAs.type.594be1.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.2cc5f1.1)> [symbolic] +// CHECK:STDOUT: %U.3d0: %ImplicitAs.type.594be1.2 = symbolic_binding U, 1 [symbolic] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.type.484532.1: type = fn_type @Int.as.AddAssignWith.impl.Op.1, @Int.as.AddAssignWith.impl(%N.fe9, %U.3d0) [symbolic] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.eec262.1: %Int.as.AddAssignWith.impl.Op.type.484532.1 = struct_value () [symbolic] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.type.484532.2: type = fn_type @Int.as.AddAssignWith.impl.Op.2, @Int.as.AddAssignWith.impl(%N.fe9, %U.3d0) [symbolic] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.eec262.2: %Int.as.AddAssignWith.impl.Op.type.484532.2 = struct_value () [symbolic] +// CHECK:STDOUT: %facet_type.e6c: type = facet_type <@IntFitsIn, @IntFitsIn(%i32) & @AnyInt> [concrete] +// CHECK:STDOUT: %custom_witness.218: = custom_witness (), @IntFitsIn, @IntFitsIn(%i32) [concrete] +// CHECK:STDOUT: %Int.as.AnyInt.impl.AsInt.type.5c3: type = fn_type @Int.as.AnyInt.impl.AsInt, @Int.as.AnyInt.impl(%N.fe9) [symbolic] +// CHECK:STDOUT: %Int.as.AnyInt.impl.AsInt.164: %Int.as.AnyInt.impl.AsInt.type.5c3 = struct_value () [symbolic] +// CHECK:STDOUT: %AnyInt.impl_witness.a35: = impl_witness imports.%AnyInt.impl_witness_table, @Int.as.AnyInt.impl(%int_32) [concrete] +// CHECK:STDOUT: %facet_value.1bd: %facet_type.e6c = facet_value %i32, (%custom_witness.218, %AnyInt.impl_witness.a35) [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.eb2: = impl_witness imports.%ImplicitAs.impl_witness_table.f15, @From.as_type.as.ImplicitAs.impl(%int_32, %facet_value.1bd) [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.9ea: %ImplicitAs.type.360 = facet_value %i32, (%ImplicitAs.impl_witness.eb2) [concrete] +// CHECK:STDOUT: %AddAssignWith.impl_witness.a8e: = impl_witness imports.%AddAssignWith.impl_witness_table, @Int.as.AddAssignWith.impl(%int_32, %ImplicitAs.facet.9ea) [concrete] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.type.b09202.1: type = fn_type @Int.as.AddAssignWith.impl.Op.2, @Int.as.AddAssignWith.impl(%int_32, %ImplicitAs.facet.9ea) [concrete] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.bbd220.1: %Int.as.AddAssignWith.impl.Op.type.b09202.1 = struct_value () [concrete] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.type.b09202.2: type = fn_type @Int.as.AddAssignWith.impl.Op.1, @Int.as.AddAssignWith.impl(%int_32, %ImplicitAs.facet.9ea) [concrete] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.bbd220.2: %Int.as.AddAssignWith.impl.Op.type.b09202.2 = struct_value () [concrete] +// CHECK:STDOUT: %AddAssignWith.facet.c0a: %AddAssignWith.type.e37 = facet_value %i32, (%AddAssignWith.impl_witness.a8e) [concrete] +// CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.94b: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%i32, %AddAssignWith.facet.c0a) [concrete] +// CHECK:STDOUT: %.35b: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.94b, %AddAssignWith.facet.c0a [concrete] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.f3f3f7.1: = specific_function %Int.as.AddAssignWith.impl.Op.bbd220.2, @Int.as.AddAssignWith.impl.Op.1(%int_32, %ImplicitAs.facet.9ea) [concrete] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.f3f3f7.2: = specific_function %Int.as.AddAssignWith.impl.Op.bbd220.1, @Int.as.AddAssignWith.impl.Op.2(%int_32, %ImplicitAs.facet.9ea) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.8: type = fn_type @Destroy.Op.loc34_19.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.8: %Destroy.Op.type.790b3b.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.730: = lookup_impl_witness %impl.elem1.ad9, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.183: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.ad9) [symbolic] +// CHECK:STDOUT: %.179: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.183, %impl.elem1.ad9 [symbolic] +// CHECK:STDOUT: %impl.elem0.636: %.179 = impl_witness_access %Destroy.lookup_impl_witness.730, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.56c: = specific_impl_function %impl.elem0.636, @Destroy.WithSelf.Op(%impl.elem1.ad9) [symbolic] // CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] // CHECK:STDOUT: %pattern_type.b76: type = pattern_type %MutableRange [concrete] // CHECK:STDOUT: %ConstRange: type = class_type @ConstRange [concrete] // CHECK:STDOUT: %pattern_type.631: type = pattern_type %ConstRange [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %Iterator.826: type = class_type @Iterator.1 [concrete] // CHECK:STDOUT: %MutableRange.Begin.type: type = fn_type @MutableRange.Begin [concrete] // CHECK:STDOUT: %MutableRange.Begin: %MutableRange.Begin.type = struct_value () [concrete] // CHECK:STDOUT: %MutableRange.End.type: type = fn_type @MutableRange.End [concrete] // CHECK:STDOUT: %MutableRange.End: %MutableRange.End.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.544: = custom_witness (%Iterator.826, %Iterator.826, %MutableRange.Begin, %MutableRange.End), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.486: %CppRangeForIterate.type = facet_value %MutableRange, (%custom_witness.544) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.134: type = fn_type @Iterator.Op.1 [concrete] -// CHECK:STDOUT: %Iterator.Op.f05: %Iterator.Op.type.134 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ef9: = custom_witness (%Iterator.Op.f05), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.848: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.544, %custom_witness.ef9) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.1: type = fn_type @Iterator.Op.1 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.1: %Iterator.Op.type.134d4f.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b4c: = custom_witness (%i32, %Iterator.Op.f056ae.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.2: type = fn_type @Iterator.Op.2 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.2: %Iterator.Op.type.134d4f.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.ef9: = custom_witness (%Iterator.Op.f056ae.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.3: type = fn_type @Iterator.Op.3 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.3: %Iterator.Op.type.134d4f.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.3a5: = custom_witness (%Iterator.Op.f056ae.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type.eace26.1: type = fn_type @Equal.1 [concrete] +// CHECK:STDOUT: %Equal.8c4faf.1: %Equal.type.eace26.1 = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type.ca4b73.1: type = fn_type @NotEqual.1 [concrete] +// CHECK:STDOUT: %NotEqual.6eaf3e.1: %NotEqual.type.ca4b73.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.baa: = custom_witness (%Equal.8c4faf.1, %NotEqual.6eaf3e.1), @EqWith, @EqWith(%Iterator.826) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.4: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.4: %Iterator.Op.type.134d4f.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f9b: = custom_witness (%Iterator.Op.f056ae.4), @Inc [concrete] +// CHECK:STDOUT: %facet_value.31b: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.e20f1f.2, %Copy.impl_witness.1a4, %custom_witness.544, %custom_witness.ef9, %custom_witness.3a5, %custom_witness.b4c, %custom_witness.baa, %custom_witness.f9b) [concrete] +// CHECK:STDOUT: %tuple.type.17d: type = tuple_type (%Iterator.826, %Iterator.826) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.9: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.9: %Destroy.Op.type.790b3b.9 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.9: = custom_witness (%Destroy.Op.2dd605.9), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.0ec: %Destroy.type = facet_value %tuple.type.17d, (%custom_witness.e20f1f.9) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.a27: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.31b) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.872: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.31b) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.b35: %R.as_type.as.Iterate.impl.NewCursor.type.872 = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.4d0: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.31b) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.dbe: %R.as_type.as.Iterate.impl.Next.type.4d0 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.989: %Iterate.type = facet_value %MutableRange, (%Iterate.impl_witness.a27) [concrete] +// CHECK:STDOUT: %facet_value.b9f: %Iterate_where.type.6aa = facet_value %MutableRange, (%Iterate.impl_witness.a27) [concrete] // CHECK:STDOUT: %Iterator.4f0: type = class_type @Iterator.2 [concrete] // CHECK:STDOUT: %ConstRange.Begin.type: type = fn_type @ConstRange.Begin [concrete] // CHECK:STDOUT: %ConstRange.Begin: %ConstRange.Begin.type = struct_value () [concrete] // CHECK:STDOUT: %ConstRange.End.type: type = fn_type @ConstRange.End [concrete] // CHECK:STDOUT: %ConstRange.End: %ConstRange.End.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.83f: = custom_witness (%Iterator.4f0, %Iterator.4f0, %ConstRange.Begin, %ConstRange.End), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.d14: %CppRangeForIterate.type = facet_value %ConstRange, (%custom_witness.83f) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.9f2: type = fn_type @Iterator.Op.2 [concrete] -// CHECK:STDOUT: %Iterator.Op.7b7: %Iterator.Op.type.9f2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df0: = custom_witness (%Iterator.Op.7b7), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.d23: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.83f, %custom_witness.df0) [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.aea: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.486) [concrete] -// CHECK:STDOUT: %.5be: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.aea, %CppRangeForIterate.facet.486 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.1c4: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.486) [concrete] -// CHECK:STDOUT: %.e19: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.1c4, %CppRangeForIterate.facet.486 [concrete] -// CHECK:STDOUT: %Destroy.facet.f6b: %Destroy.type = facet_value %Iterator.826, (%custom_witness.ef9) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.a45: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.f6b) [concrete] -// CHECK:STDOUT: %.ee6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.a45, %Destroy.facet.f6b [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.4f8: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.d14) [concrete] -// CHECK:STDOUT: %.3b9: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.4f8, %CppRangeForIterate.facet.d14 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.d4a: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.d14) [concrete] -// CHECK:STDOUT: %.364: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.d4a, %CppRangeForIterate.facet.d14 [concrete] -// CHECK:STDOUT: %Destroy.facet.2fa: %Destroy.type = facet_value %Iterator.4f0, (%custom_witness.df0) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.993: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.2fa) [concrete] -// CHECK:STDOUT: %.61a: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.993, %Destroy.facet.2fa [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.1: type = fn_type @Iterator.Op.5 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.1: %Iterator.Op.type.9f2350.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.852: = custom_witness (%i32, %Iterator.Op.7b7347.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.2: type = fn_type @Iterator.Op.6 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.2: %Iterator.Op.type.9f2350.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df0: = custom_witness (%Iterator.Op.7b7347.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.3: type = fn_type @Iterator.Op.7 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.3: %Iterator.Op.type.9f2350.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f14: = custom_witness (%Iterator.Op.7b7347.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type.eace26.2: type = fn_type @Equal.2 [concrete] +// CHECK:STDOUT: %Equal.8c4faf.2: %Equal.type.eace26.2 = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type.ca4b73.2: type = fn_type @NotEqual.2 [concrete] +// CHECK:STDOUT: %NotEqual.6eaf3e.2: %NotEqual.type.ca4b73.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f7c: = custom_witness (%Equal.8c4faf.2, %NotEqual.6eaf3e.2), @EqWith, @EqWith(%Iterator.4f0) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.4: type = fn_type @Iterator.Op.8 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.4: %Iterator.Op.type.9f2350.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.c18: = custom_witness (%Iterator.Op.7b7347.4), @Inc [concrete] +// CHECK:STDOUT: %facet_value.c7f: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.e20f1f.2, %Copy.impl_witness.1a4, %custom_witness.83f, %custom_witness.df0, %custom_witness.f14, %custom_witness.852, %custom_witness.f7c, %custom_witness.c18) [concrete] +// CHECK:STDOUT: %tuple.type.d1a: type = tuple_type (%Iterator.4f0, %Iterator.4f0) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.10: type = fn_type @Destroy.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.10: %Destroy.Op.type.790b3b.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.10: = custom_witness (%Destroy.Op.2dd605.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.72a: %Destroy.type = facet_value %tuple.type.d1a, (%custom_witness.e20f1f.10) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.7a3: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.c7f) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.8bf: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.c7f) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.130: %R.as_type.as.Iterate.impl.NewCursor.type.8bf = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.77d: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.c7f) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.fb6: %R.as_type.as.Iterate.impl.Next.type.77d = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.bdf: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.7a3) [concrete] +// CHECK:STDOUT: %facet_value.bbe: %Iterate_where.type.6aa = facet_value %ConstRange, (%Iterate.impl_witness.7a3) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.5d1: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.989) [concrete] +// CHECK:STDOUT: %.34e: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.5d1, %Iterate.facet.989 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn.827: = specific_function %R.as_type.as.Iterate.impl.NewCursor.b35, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.31b) [concrete] +// CHECK:STDOUT: %complete_type.3ec: = complete_type_witness %tuple.type.17d [concrete] +// CHECK:STDOUT: %ptr.f42: type = ptr_type %tuple.type.17d [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.68f: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.989) [concrete] +// CHECK:STDOUT: %.42b: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.68f, %Iterate.facet.989 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn.712: = specific_function %R.as_type.as.Iterate.impl.Next.dbe, @R.as_type.as.Iterate.impl.Next(%facet_value.31b) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.511: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.0ec) [concrete] +// CHECK:STDOUT: %.824: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.511, %Destroy.facet.0ec [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.bf8: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.bdf) [concrete] +// CHECK:STDOUT: %.3d0: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.bf8, %Iterate.facet.bdf [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn.625: = specific_function %R.as_type.as.Iterate.impl.NewCursor.130, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.c7f) [concrete] +// CHECK:STDOUT: %complete_type.f2c: = complete_type_witness %tuple.type.d1a [concrete] +// CHECK:STDOUT: %ptr.11b: type = ptr_type %tuple.type.d1a [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.3bc: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.bdf) [concrete] +// CHECK:STDOUT: %.da0: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.3bc, %Iterate.facet.bdf [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn.272: = specific_function %R.as_type.as.Iterate.impl.Next.fb6, @R.as_type.as.Iterate.impl.Next(%facet_value.c7f) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.fa3: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.72a) [concrete] +// CHECK:STDOUT: %.b6b: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.fa3, %Destroy.facet.72a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.735: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] -// CHECK:STDOUT: %Core.import_ref.572: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc3] -// CHECK:STDOUT: %Core.import_ref.213: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin.type (%CppRangeForIterate.WithSelf.Begin.type.753895.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin (constants.%CppRangeForIterate.WithSelf.Begin.2b31f7.1)] -// CHECK:STDOUT: %Core.import_ref.730: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End.type (%CppRangeForIterate.WithSelf.End.type.056be7.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End (constants.%CppRangeForIterate.WithSelf.End.a331a3.1)] +// CHECK:STDOUT: %Core.import_ref.0b9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.498) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.bf8)] +// CHECK:STDOUT: %Core.import_ref.61f: @Optional.%Optional.Get.type (%Optional.Get.type.d22) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.6fc)] +// CHECK:STDOUT: %Core.import_ref.2b5: type = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%DefaultOptionalStorage (constants.%DefaultOptionalStorage.f8b)] +// CHECK:STDOUT: %Core.import_ref.b0a: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None.type (%T.as_type.as.OptionalStorage.impl.None.type.ceb) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None (constants.%T.as_type.as.OptionalStorage.impl.None.9dd)] +// CHECK:STDOUT: %Core.import_ref.3fc: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some.type (%T.as_type.as.OptionalStorage.impl.Some.type.87a) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some (constants.%T.as_type.as.OptionalStorage.impl.Some.898)] +// CHECK:STDOUT: %Core.import_ref.986: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has.type (%T.as_type.as.OptionalStorage.impl.Has.type.0ae) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has (constants.%T.as_type.as.OptionalStorage.impl.Has.e0f)] +// CHECK:STDOUT: %Core.import_ref.557: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get.type (%T.as_type.as.OptionalStorage.impl.Get.type.46f) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get (constants.%T.as_type.as.OptionalStorage.impl.Get.8c2)] +// CHECK:STDOUT: %Core.import_ref.999 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %OptionalStorage.impl_witness_table.6f7 = impl_witness_table (%Core.import_ref.2b5, %Core.import_ref.b0a, %Core.import_ref.3fc, %Core.import_ref.986, %Core.import_ref.557, %Core.import_ref.999), @T.as_type.as.OptionalStorage.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.55f: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.2f2) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.a64)] +// CHECK:STDOUT: %Copy.impl_witness_table.0ac = impl_witness_table (%Core.import_ref.55f), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.3b9: @From.as_type.as.ImplicitAs.impl.%From.as_type.as.ImplicitAs.impl.Convert.type (%From.as_type.as.ImplicitAs.impl.Convert.type.5e2) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @From.as_type.as.ImplicitAs.impl.%From.as_type.as.ImplicitAs.impl.Convert (constants.%From.as_type.as.ImplicitAs.impl.Convert.58d)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.f15 = impl_witness_table (%Core.import_ref.3b9), @From.as_type.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.89a: %facet_type.b7c = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%facet_value (constants.%facet_value.a30)] +// CHECK:STDOUT: %Core.import_ref.9ea: %Destroy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%Destroy.facet (constants.%Destroy.facet.2fe)] +// CHECK:STDOUT: %Core.import_ref.a6c: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor.type (%R.as_type.as.Iterate.impl.NewCursor.type.9b6) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor (constants.%R.as_type.as.Iterate.impl.NewCursor.b29)] +// CHECK:STDOUT: %Core.import_ref.a02: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next.type (%R.as_type.as.Iterate.impl.Next.type.5b5) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next (constants.%R.as_type.as.Iterate.impl.Next.cd2)] +// CHECK:STDOUT: %Iterate.impl_witness_table.9f0 = impl_witness_table (%Core.import_ref.89a, %Core.import_ref.9ea, %Core.import_ref.a6c, %Core.import_ref.a02), @R.as_type.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.328: @Int.as.AddAssignWith.impl.%Int.as.AddAssignWith.impl.Op.type.2 (%Int.as.AddAssignWith.impl.Op.type.484532.1) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.AddAssignWith.impl.%Int.as.AddAssignWith.impl.Op.2 (constants.%Int.as.AddAssignWith.impl.Op.eec262.1)] +// CHECK:STDOUT: %AddAssignWith.impl_witness_table = impl_witness_table (%Core.import_ref.328), @Int.as.AddAssignWith.impl [concrete] +// CHECK:STDOUT: %Core.Op.d27: @Int.as.AddAssignWith.impl.%Int.as.AddAssignWith.impl.Op.type.1 (%Int.as.AddAssignWith.impl.Op.type.484532.2) = import_ref Core//prelude/types/int, Op, loaded [symbolic = @Int.as.AddAssignWith.impl.%Int.as.AddAssignWith.impl.Op.1 (constants.%Int.as.AddAssignWith.impl.Op.eec262.2)] +// CHECK:STDOUT: %Core.import_ref.47b: Core.IntLiteral = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.AnyInt.impl.%N (constants.%N.fe9)] +// CHECK:STDOUT: %Core.import_ref.d13: @Int.as.AnyInt.impl.%Int.as.AnyInt.impl.AsInt.type (%Int.as.AnyInt.impl.AsInt.type.5c3) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.AnyInt.impl.%Int.as.AnyInt.impl.AsInt (constants.%Int.as.AnyInt.impl.AsInt.164)] +// CHECK:STDOUT: %AnyInt.impl_witness_table = impl_witness_table (%Core.import_ref.47b, %Core.import_ref.d13), @Int.as.AnyInt.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Test(%R.loc30_10.2: %CppRangeForIterate_where.type) { +// CHECK:STDOUT: generic fn @Test(%R.loc30_10.2: %Iterate_where.type.6aa) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness: = lookup_impl_witness %R.loc30_10.1, @CppRangeForIterate [symbolic = %CppRangeForIterate.lookup_impl_witness (constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2)] -// CHECK:STDOUT: %CppRangeForIterate.facet: %CppRangeForIterate.type = facet_value %R.as_type.loc30_113.1, (%CppRangeForIterate.lookup_impl_witness) [symbolic = %CppRangeForIterate.facet (constants.%CppRangeForIterate.facet.0d2)] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.Begin.type (constants.%CppRangeForIterate.WithSelf.Begin.type.57e)] -// CHECK:STDOUT: %.loc32_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type, %CppRangeForIterate.facet [symbolic = %.loc32_4 (constants.%.b85)] -// CHECK:STDOUT: %impl.elem2.loc32_4.2: @Test.%.loc32_4 (%.b85) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc32_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %specific_impl_fn.loc32_4.2: = specific_impl_function %impl.elem2.loc32_4.2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc32_4.2 (constants.%specific_impl_fn.c0f)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc30_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.ccf)] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc30_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.6f6)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.4ee)] +// CHECK:STDOUT: %.loc34_19.12: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc34_19.12 (constants.%.75c)] +// CHECK:STDOUT: %impl.elem2.loc34_19.2: @Test.%.loc34_19.12 (%.75c) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.d4c)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.4: = specific_impl_function %impl.elem2.loc34_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.314)] // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.End.type (constants.%CppRangeForIterate.WithSelf.End.type.04d)] -// CHECK:STDOUT: %.loc33_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type, %CppRangeForIterate.facet [symbolic = %.loc33_4 (constants.%.b40)] -// CHECK:STDOUT: %impl.elem3.loc33_4.2: @Test.%.loc33_4 (%.b40) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc33_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %specific_impl_fn.loc33_4.2: = specific_impl_function %impl.elem3.loc33_4.2, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc33_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc33: = lookup_impl_witness %impl.elem1.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc33 (constants.%Destroy.lookup_impl_witness.a8f)] -// CHECK:STDOUT: %Destroy.facet.loc33: %Destroy.type = facet_value %impl.elem1.1, (%Destroy.lookup_impl_witness.loc33) [symbolic = %Destroy.facet.loc33 (constants.%Destroy.facet.543)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc33: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc33) [symbolic = %Destroy.WithSelf.Op.type.loc33 (constants.%Destroy.WithSelf.Op.type.366)] -// CHECK:STDOUT: %.loc33_9.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc33, %Destroy.facet.loc33 [symbolic = %.loc33_9.3 (constants.%.b83)] -// CHECK:STDOUT: %impl.elem0.loc33_9.2: @Test.%.loc33_9.3 (%.b83) = impl_witness_access %Destroy.lookup_impl_witness.loc33, element0 [symbolic = %impl.elem0.loc33_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %specific_impl_fn.loc33_9.2: = specific_impl_function %impl.elem0.loc33_9.2, @Destroy.WithSelf.Op(%Destroy.facet.loc33) [symbolic = %specific_impl_fn.loc33_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc32: = lookup_impl_witness %impl.elem0.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc32 (constants.%Destroy.lookup_impl_witness.089)] -// CHECK:STDOUT: %Destroy.facet.loc32: %Destroy.type = facet_value %impl.elem0.1, (%Destroy.lookup_impl_witness.loc32) [symbolic = %Destroy.facet.loc32 (constants.%Destroy.facet.5e8)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc32: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc32) [symbolic = %Destroy.WithSelf.Op.type.loc32 (constants.%Destroy.WithSelf.Op.type.7cb)] -// CHECK:STDOUT: %.loc32_11.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc32, %Destroy.facet.loc32 [symbolic = %.loc32_11.3 (constants.%.a68)] -// CHECK:STDOUT: %impl.elem0.loc32_11.2: @Test.%.loc32_11.3 (%.a68) = impl_witness_access %Destroy.lookup_impl_witness.loc32, element0 [symbolic = %impl.elem0.loc32_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %specific_impl_fn.loc32_11.2: = specific_impl_function %impl.elem0.loc32_11.2, @Destroy.WithSelf.Op(%Destroy.facet.loc32) [symbolic = %specific_impl_fn.loc32_11.2 (constants.%specific_impl_fn.f06)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.233)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.652)] +// CHECK:STDOUT: %.loc34_19.13: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc34_19.13 (constants.%.58a)] +// CHECK:STDOUT: %impl.elem3.loc34_19.2: @Test.%.loc34_19.13 (%.58a) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.25e)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.5: = specific_impl_function %impl.elem3.loc34_19.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.85b)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.183)] +// CHECK:STDOUT: %.loc34_19.14: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc34_19.14 (constants.%.179)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.730)] +// CHECK:STDOUT: %impl.elem0.loc34_19.2: @Test.%.loc34_19.14 (%.179) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.636)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6: = specific_impl_function %impl.elem0.loc34_19.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.56c)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%r.param: ref @Test.%R.as_type.loc30_113.1 (%R.as_type)) { +// CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc30_55.1 (%R.as_type.549)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %r.ref.loc32: ref @Test.%R.as_type.loc30_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %Begin.ref: %CppRangeForIterate.assoc_type = name_ref Begin, imports.%Core.import_ref.735 [concrete = constants.%assoc2] -// CHECK:STDOUT: %impl.elem2.loc32_4.1: @Test.%.loc32_4 (%.b85) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic = %impl.elem2.loc32_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %bound_method.loc32_4: = bound_method %r.ref.loc32, %impl.elem2.loc32_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc32_4.1: = specific_impl_function %impl.elem2.loc32_4.1, @CppRangeForIterate.WithSelf.Begin(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc32_4.2 (constants.%specific_impl_fn.c0f)] -// CHECK:STDOUT: %bound_method.loc32_11.1: = bound_method %r.ref.loc32, %specific_impl_fn.loc32_4.1 -// CHECK:STDOUT: %.loc32_11.1: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.call: init @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) to %.loc32_11.1 = call %bound_method.loc32_11.1(%r.ref.loc32) -// CHECK:STDOUT: %.loc32_11.2: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary %.loc32_11.1, %CppRangeForIterate.WithSelf.Begin.call -// CHECK:STDOUT: %r.ref.loc33: ref @Test.%R.as_type.loc30_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %End.ref: %CppRangeForIterate.assoc_type = name_ref End, imports.%Core.import_ref.572 [concrete = constants.%assoc3] -// CHECK:STDOUT: %impl.elem3.loc33_4.1: @Test.%.loc33_4 (%.b40) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic = %impl.elem3.loc33_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %bound_method.loc33_4: = bound_method %r.ref.loc33, %impl.elem3.loc33_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc33_4.1: = specific_impl_function %impl.elem3.loc33_4.1, @CppRangeForIterate.WithSelf.End(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc33_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: %bound_method.loc33_9.1: = bound_method %r.ref.loc33, %specific_impl_fn.loc33_4.1 -// CHECK:STDOUT: %.loc33_9.1: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.call: init @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) to %.loc33_9.1 = call %bound_method.loc33_9.1(%r.ref.loc33) -// CHECK:STDOUT: %.loc33_9.2: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary %.loc33_9.1, %CppRangeForIterate.WithSelf.End.call -// CHECK:STDOUT: %impl.elem0.loc33_9.1: @Test.%.loc33_9.3 (%.b83) = impl_witness_access constants.%Destroy.lookup_impl_witness.a8f, element0 [symbolic = %impl.elem0.loc33_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %bound_method.loc33_9.2: = bound_method %.loc33_9.2, %impl.elem0.loc33_9.1 -// CHECK:STDOUT: %specific_impl_fn.loc33_9.1: = specific_impl_function %impl.elem0.loc33_9.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.543) [symbolic = %specific_impl_fn.loc33_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %bound_method.loc33_9.3: = bound_method %.loc33_9.2, %specific_impl_fn.loc33_9.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc33: init %empty_tuple.type = call %bound_method.loc33_9.3(%.loc33_9.2) -// CHECK:STDOUT: %impl.elem0.loc32_11.1: @Test.%.loc32_11.3 (%.a68) = impl_witness_access constants.%Destroy.lookup_impl_witness.089, element0 [symbolic = %impl.elem0.loc32_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %bound_method.loc32_11.2: = bound_method %.loc32_11.2, %impl.elem0.loc32_11.1 -// CHECK:STDOUT: %specific_impl_fn.loc32_11.1: = specific_impl_function %impl.elem0.loc32_11.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.5e8) [symbolic = %specific_impl_fn.loc32_11.2 (constants.%specific_impl_fn.f06)] -// CHECK:STDOUT: %bound_method.loc32_11.3: = bound_method %.loc32_11.2, %specific_impl_fn.loc32_11.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc32: init %empty_tuple.type = call %bound_method.loc32_11.3(%.loc32_11.2) +// CHECK:STDOUT: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.104 = value_binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc30_55.1 (%R.as_type.549) = name_ref r, %r +// CHECK:STDOUT: %impl.elem2.loc34_19.1: @Test.%.loc34_19.12 (%.75c) = impl_witness_access constants.%Iterate.lookup_impl_witness.ccf, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.d4c)] +// CHECK:STDOUT: %bound_method.loc34_19.1: = bound_method %r.ref, %impl.elem2.loc34_19.1 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.1: = specific_impl_function %impl.elem2.loc34_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.6f6) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.314)] +// CHECK:STDOUT: %bound_method.loc34_19.2: = bound_method %r.ref, %specific_impl_fn.loc34_19.1 +// CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.cf9) = var invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @Test.%as_type (%as_type.cf9) to %var = call %bound_method.loc34_19.2(%r.ref) +// CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.next: +// CHECK:STDOUT: %addr: @Test.%ptr (%ptr.233) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc34_19.1: @Test.%.loc34_19.13 (%.58a) = impl_witness_access constants.%Iterate.lookup_impl_witness.ccf, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.25e)] +// CHECK:STDOUT: %bound_method.loc34_19.3: = bound_method %r.ref, %impl.elem3.loc34_19.1 +// CHECK:STDOUT: %.loc34_19.1: %Destroy.type = converted constants.%as_type.cf9, constants.%impl.elem1.ad9 [symbolic = %impl.elem1 (constants.%impl.elem1.ad9)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.2: = specific_impl_function %impl.elem3.loc34_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.6f6) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.85b)] +// CHECK:STDOUT: %bound_method.loc34_19.4: = bound_method %r.ref, %specific_impl_fn.loc34_19.2 +// CHECK:STDOUT: %.loc34_19.2: ref %Optional.af5 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.af5 to %.loc34_19.2 = call %bound_method.loc34_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc34_19.3: ref %Optional.af5 = temporary %.loc34_19.2, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc34_19.4: %Optional.HasValue.type.4a8 = specific_constant imports.%Core.import_ref.0b9, @Optional(constants.%OptionalStorage.facet.26b) [concrete = constants.%Optional.HasValue.3cd] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.4a8 = name_ref HasValue, %.loc34_19.4 [concrete = constants.%Optional.HasValue.3cd] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc34_19.3, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.26b) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc34_19.5: = bound_method %.loc34_19.3, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc34_19.5: %Optional.af5 = acquire_value %.loc34_19.3 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc34_19.5(%.loc34_19.5) +// CHECK:STDOUT: %.loc34_19.6: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc34_19.7: bool = converted %Optional.HasValue.call, %.loc34_19.6 +// CHECK:STDOUT: if %.loc34_19.7 br !for.body else br !for.done +// CHECK:STDOUT: +// CHECK:STDOUT: !for.body: +// CHECK:STDOUT: %.loc34_19.8: %Optional.Get.type.f91 = specific_constant imports.%Core.import_ref.61f, @Optional(constants.%OptionalStorage.facet.26b) [concrete = constants.%Optional.Get.4e5] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.f91 = name_ref Get, %.loc34_19.8 [concrete = constants.%Optional.Get.4e5] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc34_19.3, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.26b) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc34_19.6: = bound_method %.loc34_19.3, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc34_19.9: %Optional.af5 = acquire_value %.loc34_19.3 +// CHECK:STDOUT: %Optional.Get.call: init %i32 = call %bound_method.loc34_19.6(%.loc34_19.9) +// CHECK:STDOUT: %i32.loc34: type = type_literal constants.%i32 [concrete = constants.%i32] +// CHECK:STDOUT: %.loc34_19.10: %i32 = value_of_initializer %Optional.Get.call +// CHECK:STDOUT: %.loc34_19.11: %i32 = converted %Optional.Get.call, %.loc34_19.10 +// CHECK:STDOUT: %i: %i32 = value_binding i, %.loc34_19.11 +// CHECK:STDOUT: %sum.ref: ref %i32 = name_ref sum, %sum +// CHECK:STDOUT: %i.ref: %i32 = name_ref i, %i +// CHECK:STDOUT: %impl.elem0.loc35: %.35b = impl_witness_access constants.%AddAssignWith.impl_witness.a8e, element0 [concrete = constants.%Int.as.AddAssignWith.impl.Op.bbd220.2] +// CHECK:STDOUT: %bound_method.loc35_9.1: = bound_method %sum.ref, %impl.elem0.loc35 +// CHECK:STDOUT: %specific_fn.loc35: = specific_function %impl.elem0.loc35, @Int.as.AddAssignWith.impl.Op.1(constants.%int_32, constants.%ImplicitAs.facet.9ea) [concrete = constants.%Int.as.AddAssignWith.impl.Op.specific_fn.f3f3f7.1] +// CHECK:STDOUT: %bound_method.loc35_9.2: = bound_method %sum.ref, %specific_fn.loc35 +// CHECK:STDOUT: %.loc35: %Int.as.AddAssignWith.impl.Op.type.b09202.1 = specific_constant imports.%Core.Op.d27, @Int.as.AddAssignWith.impl(constants.%int_32, constants.%ImplicitAs.facet.9ea) [concrete = constants.%Int.as.AddAssignWith.impl.Op.bbd220.1] +// CHECK:STDOUT: %Op.ref: %Int.as.AddAssignWith.impl.Op.type.b09202.1 = name_ref Op, %.loc35 [concrete = constants.%Int.as.AddAssignWith.impl.Op.bbd220.1] +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.bound: = bound_method %sum.ref, %Op.ref +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Op.ref, @Int.as.AddAssignWith.impl.Op.2(constants.%int_32, constants.%ImplicitAs.facet.9ea) [concrete = constants.%Int.as.AddAssignWith.impl.Op.specific_fn.f3f3f7.2] +// CHECK:STDOUT: %bound_method.loc35_9.3: = bound_method %sum.ref, %Int.as.AddAssignWith.impl.Op.specific_fn +// CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc35_9.3(%sum.ref, %i.ref) +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.done: +// CHECK:STDOUT: %Destroy.Op.bound.loc34: = bound_method %.loc34_19.3, constants.%Destroy.Op.2dd605.8 +// CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_19.3) +// CHECK:STDOUT: %impl.elem0.loc34_19.1: @Test.%.loc34_19.14 (%.179) = impl_witness_access constants.%Destroy.lookup_impl_witness.730, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.636)] +// CHECK:STDOUT: %bound_method.loc34_19.7: = bound_method %var, %impl.elem0.loc34_19.1 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.3: = specific_impl_function %impl.elem0.loc34_19.1, @Destroy.WithSelf.Op(constants.%impl.elem1.ad9) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.56c)] +// CHECK:STDOUT: %bound_method.loc34_19.8: = bound_method %var, %specific_impl_fn.loc34_19.3 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc34_19.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%R) { -// CHECK:STDOUT: %R.loc30_10.1 => constants.%R -// CHECK:STDOUT: %R.as_type.loc30_113.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.26c6ea.2 +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.1(%self.param: ref %MaybeUnformed.30b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.848) { -// CHECK:STDOUT: %R.loc30_10.1 => constants.%facet_value.848 -// CHECK:STDOUT: %R.as_type.loc30_113.1 => constants.%MutableRange +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.2(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.3(%self.param: ref %struct_type.value.has_value.f8d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.4(%self.param: ref %DefaultOptionalStorage.388) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc34_19.5(%self.param: ref %Optional.af5) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%R.5de) { +// CHECK:STDOUT: %R.loc30_10.1 => constants.%R.5de +// CHECK:STDOUT: %R.as_type.loc30_55.1 => constants.%R.as_type.549 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.8bb +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%facet_value.b9f) { +// CHECK:STDOUT: %R.loc30_10.1 => constants.%facet_value.b9f +// CHECK:STDOUT: %R.as_type.loc30_55.1 => constants.%MutableRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b76 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.544 -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.486 -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.aea -// CHECK:STDOUT: %.loc32_4 => constants.%.5be -// CHECK:STDOUT: %impl.elem2.loc32_4.2 => constants.%MutableRange.Begin -// CHECK:STDOUT: %specific_impl_fn.loc32_4.2 => constants.%MutableRange.Begin -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.826 -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.1c4 -// CHECK:STDOUT: %.loc33_4 => constants.%.e19 -// CHECK:STDOUT: %impl.elem3.loc33_4.2 => constants.%MutableRange.End -// CHECK:STDOUT: %specific_impl_fn.loc33_4.2 => constants.%MutableRange.End -// CHECK:STDOUT: %impl.elem1.1 => constants.%Iterator.826 -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc33 => constants.%custom_witness.ef9 -// CHECK:STDOUT: %Destroy.facet.loc33 => constants.%Destroy.facet.f6b -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc33 => constants.%Destroy.WithSelf.Op.type.a45 -// CHECK:STDOUT: %.loc33_9.3 => constants.%.ee6 -// CHECK:STDOUT: %impl.elem0.loc33_9.2 => constants.%Iterator.Op.f05 -// CHECK:STDOUT: %specific_impl_fn.loc33_9.2 => constants.%Iterator.Op.f05 -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc32 => constants.%custom_witness.ef9 -// CHECK:STDOUT: %Destroy.facet.loc32 => constants.%Destroy.facet.f6b -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc32 => constants.%Destroy.WithSelf.Op.type.a45 -// CHECK:STDOUT: %.loc32_11.3 => constants.%.ee6 -// CHECK:STDOUT: %impl.elem0.loc32_11.2 => constants.%Iterator.Op.f05 -// CHECK:STDOUT: %specific_impl_fn.loc32_11.2 => constants.%Iterator.Op.f05 +// CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.a27 +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.989 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.5d1 +// CHECK:STDOUT: %.loc34_19.12 => constants.%.34e +// CHECK:STDOUT: %impl.elem2.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.b35 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.827 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.0ec +// CHECK:STDOUT: %as_type => constants.%tuple.type.17d +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.3ec +// CHECK:STDOUT: %ptr => constants.%ptr.f42 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.68f +// CHECK:STDOUT: %.loc34_19.13 => constants.%.42b +// CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.Next.dbe +// CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.712 +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.511 +// CHECK:STDOUT: %.loc34_19.14 => constants.%.824 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.9 +// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.2dd605.9 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.2dd605.9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.d23) { -// CHECK:STDOUT: %R.loc30_10.1 => constants.%facet_value.d23 -// CHECK:STDOUT: %R.as_type.loc30_113.1 => constants.%ConstRange +// CHECK:STDOUT: specific @Test(constants.%facet_value.bbe) { +// CHECK:STDOUT: %R.loc30_10.1 => constants.%facet_value.bbe +// CHECK:STDOUT: %R.as_type.loc30_55.1 => constants.%ConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.631 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.83f -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.d14 -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.4f8 -// CHECK:STDOUT: %.loc32_4 => constants.%.3b9 -// CHECK:STDOUT: %impl.elem2.loc32_4.2 => constants.%ConstRange.Begin -// CHECK:STDOUT: %specific_impl_fn.loc32_4.2 => constants.%ConstRange.Begin -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.4f0 -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.d4a -// CHECK:STDOUT: %.loc33_4 => constants.%.364 -// CHECK:STDOUT: %impl.elem3.loc33_4.2 => constants.%ConstRange.End -// CHECK:STDOUT: %specific_impl_fn.loc33_4.2 => constants.%ConstRange.End -// CHECK:STDOUT: %impl.elem1.1 => constants.%Iterator.4f0 -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc33 => constants.%custom_witness.df0 -// CHECK:STDOUT: %Destroy.facet.loc33 => constants.%Destroy.facet.2fa -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc33 => constants.%Destroy.WithSelf.Op.type.993 -// CHECK:STDOUT: %.loc33_9.3 => constants.%.61a -// CHECK:STDOUT: %impl.elem0.loc33_9.2 => constants.%Iterator.Op.7b7 -// CHECK:STDOUT: %specific_impl_fn.loc33_9.2 => constants.%Iterator.Op.7b7 -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc32 => constants.%custom_witness.df0 -// CHECK:STDOUT: %Destroy.facet.loc32 => constants.%Destroy.facet.2fa -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc32 => constants.%Destroy.WithSelf.Op.type.993 -// CHECK:STDOUT: %.loc32_11.3 => constants.%.61a -// CHECK:STDOUT: %impl.elem0.loc32_11.2 => constants.%Iterator.Op.7b7 -// CHECK:STDOUT: %specific_impl_fn.loc32_11.2 => constants.%Iterator.Op.7b7 +// CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.7a3 +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.bdf +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.bf8 +// CHECK:STDOUT: %.loc34_19.12 => constants.%.3d0 +// CHECK:STDOUT: %impl.elem2.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.130 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.625 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.72a +// CHECK:STDOUT: %as_type => constants.%tuple.type.d1a +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.f2c +// CHECK:STDOUT: %ptr => constants.%ptr.11b +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.3bc +// CHECK:STDOUT: %.loc34_19.13 => constants.%.da0 +// CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%R.as_type.as.Iterate.impl.Next.fb6 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.272 +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.fa3 +// CHECK:STDOUT: %.loc34_19.14 => constants.%.b6b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.10 +// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.Op.2dd605.10 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.Op.2dd605.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- methods_return_different_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] +// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %T.4e7: %OptionalStorage.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Optional.Get.type.d22: type = fn_type @Optional.Get, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.Get.6fc: %Optional.Get.type.d22 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.498: type = fn_type @Optional.HasValue, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.bf8: %Optional.HasValue.type.498 = struct_value () [symbolic] +// CHECK:STDOUT: %T.cb0: %facet_type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.f8b: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.type.46f: type = fn_type @T.as_type.as.OptionalStorage.impl.Get, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.8c2: %T.as_type.as.OptionalStorage.impl.Get.type.46f = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.type.0ae: type = fn_type @T.as_type.as.OptionalStorage.impl.Has, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.e0f: %T.as_type.as.OptionalStorage.impl.Has.type.0ae = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.type.87a: type = fn_type @T.as_type.as.OptionalStorage.impl.Some, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.898: %T.as_type.as.OptionalStorage.impl.Some.type.87a = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.type.ceb: type = fn_type @T.as_type.as.OptionalStorage.impl.None, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.9dd: %T.as_type.as.OptionalStorage.impl.None.type.ceb = struct_value () [symbolic] +// CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.03d: %facet_type = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] +// CHECK:STDOUT: %ValueType: type = class_type @ValueType [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.bef: type = pattern_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor.type: type = fn_type @ValueType.cpp_destructor [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor: %ValueType.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %ValueType.Op.type.43d658.1: type = fn_type @ValueType.Op.1 [concrete] +// CHECK:STDOUT: %ValueType.Op.cc70d5.1: %ValueType.Op.type.43d658.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.a98c63.1: = custom_witness (%ValueType.Op.cc70d5.1), @Destroy [concrete] +// CHECK:STDOUT: %const.3fd: type = const_type %ValueType [concrete] +// CHECK:STDOUT: %ptr.e0a: type = ptr_type %const.3fd [concrete] +// CHECK:STDOUT: %ptr.6db: type = ptr_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.Op.type.43d658.2: type = fn_type @ValueType.Op.2 [concrete] +// CHECK:STDOUT: %ValueType.Op.cc70d5.2: %ValueType.Op.type.43d658.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b0507b.1: = custom_witness (%ValueType.Op.cc70d5.2), @Copy [concrete] +// CHECK:STDOUT: %facet_value.ea2: %facet_type = facet_value %ValueType, (%custom_witness.a98c63.1, %custom_witness.b0507b.1) [concrete] +// CHECK:STDOUT: %Iterate_where.type.630: type = facet_type <@Iterate where %impl.elem0.03d = %facet_value.ea2> [concrete] +// CHECK:STDOUT: %R.2da: %Iterate_where.type.630 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %R.as_type.339: type = facet_access_type %R.2da [symbolic] +// CHECK:STDOUT: %pattern_type.df0: type = pattern_type %R.as_type.339 [symbolic] // CHECK:STDOUT: %CppRangeForIterate.type: type = facet_type <@CppRangeForIterate> [concrete] -// CHECK:STDOUT: %Self.6c6: %CppRangeForIterate.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.056be7.1: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.a331a3.1: %CppRangeForIterate.WithSelf.End.type.056be7.1 = struct_value () [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.753895.1: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.2b31f7.1: %CppRangeForIterate.WithSelf.Begin.type.753895.1 = struct_value () [symbolic] // CHECK:STDOUT: %.Self.10b: %CppRangeForIterate.type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate.assoc_type: type = assoc_entity_type @CppRangeForIterate [concrete] // CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.5bf: = lookup_impl_witness %.Self.10b, @CppRangeForIterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.d47: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element0 [symbolic_self] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.bce: = lookup_impl_witness %impl.elem0.d47, @CppUnsafeDeref [symbolic_self] +// CHECK:STDOUT: %impl.elem0.c87: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.bce, element0 [symbolic_self] // CHECK:STDOUT: %impl.elem1.846: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element1 [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem1.846 impls @Destroy> [concrete] -// CHECK:STDOUT: %R: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] -// CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.26c6ea.2: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %assoc2: %CppRangeForIterate.assoc_type = assoc_entity element2, imports.%Core.import_ref.213 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R, @CppRangeForIterate [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.facet.0d2: %CppRangeForIterate.type = facet_value %R.as_type, (%CppRangeForIterate.lookup_impl_witness.edd1fe.2) [symbolic] -// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem0.d47 impls @Copy and %impl.elem0.d47 impls @CppUnsafeDeref and %impl.elem0.d47 impls @EqWith, @EqWith(%impl.elem1.846) and %impl.elem0.d47 impls @Inc and %impl.elem0.c87 impls @Destroy and %impl.elem0.c87 impls @Copy and %impl.elem1.846 impls @Destroy and %impl.elem1.846 impls @Copy> [concrete] +// CHECK:STDOUT: %R.6c6: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R.6c6, @CppRangeForIterate [symbolic] // CHECK:STDOUT: %impl.elem1.bdcd2d.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element1 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.57e: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.04d: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %.b85: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.57e, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem2: %.b85 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c0f: = specific_impl_function %impl.elem2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %assoc3: %CppRangeForIterate.assoc_type = assoc_entity element3, imports.%Core.import_ref.730 [concrete] -// CHECK:STDOUT: %.b40: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.04d, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem3: %.b40 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.d6a: = specific_impl_function %impl.elem3, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.a8f: = lookup_impl_witness %impl.elem1.bdcd2d.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.543: %Destroy.type = facet_value %impl.elem1.bdcd2d.2, (%Destroy.lookup_impl_witness.a8f) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.366: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %.b83: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.366, %Destroy.facet.543 [symbolic] -// CHECK:STDOUT: %impl.elem0.acf: %.b83 = impl_witness_access %Destroy.lookup_impl_witness.a8f, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.add: = specific_impl_function %impl.elem0.acf, @Destroy.WithSelf.Op(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.089: = lookup_impl_witness %impl.elem0.d5966e.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.5e8: %Destroy.type = facet_value %impl.elem0.d5966e.2, (%Destroy.lookup_impl_witness.089) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.7cb: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.5e8) [symbolic] -// CHECK:STDOUT: %.a68: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.7cb, %Destroy.facet.5e8 [symbolic] -// CHECK:STDOUT: %impl.elem0.f59: %.a68 = impl_witness_access %Destroy.lookup_impl_witness.089, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.f06: = specific_impl_function %impl.elem0.f59, @Destroy.WithSelf.Op(%Destroy.facet.5e8) [symbolic] +// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.384: type = tuple_type (%impl.elem0.d5966e.2, %impl.elem1.bdcd2d.2) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.0ba: = lookup_impl_witness %tuple.type.384, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.2fe: %Destroy.type = facet_value %tuple.type.384, (%Destroy.lookup_impl_witness.0ba) [symbolic] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.ca4: = lookup_impl_witness %impl.elem0.d5966e.2, @CppUnsafeDeref [symbolic] +// CHECK:STDOUT: %impl.elem0.b10: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.ca4, element0 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.3d8: = lookup_impl_witness %impl.elem0.b10, @Destroy [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.bff: = lookup_impl_witness %impl.elem0.b10, @Copy [symbolic] +// CHECK:STDOUT: %facet_value.a30: %facet_type = facet_value %impl.elem0.b10, (%Destroy.lookup_impl_witness.3d8, %Copy.lookup_impl_witness.bff) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.5b5: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.cd2: %R.as_type.as.Iterate.impl.Next.type.5b5 = struct_value () [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.9b6: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.b29: %R.as_type.as.Iterate.impl.NewCursor.type.9b6 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.695: = lookup_impl_witness %R.2da, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.8c4: %Iterate.type = facet_value %R.as_type.339, (%Iterate.lookup_impl_witness.695) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.210: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.8c4) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.ad2: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.8c4) [symbolic] +// CHECK:STDOUT: %.9b8: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.210, %Iterate.facet.8c4 [symbolic] +// CHECK:STDOUT: %impl.elem2.377: %.9b8 = impl_witness_access %Iterate.lookup_impl_witness.695, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.bdd: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.695, element1 [symbolic] +// CHECK:STDOUT: %as_type.254: type = facet_access_type %impl.elem1.bdd [symbolic] +// CHECK:STDOUT: %specific_impl_fn.ed7: = specific_impl_function %impl.elem2.377, @Iterate.WithSelf.NewCursor(%Iterate.facet.8c4) [symbolic] +// CHECK:STDOUT: %ptr.864: type = ptr_type %as_type.254 [symbolic] +// CHECK:STDOUT: %.a74: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.ad2, %Iterate.facet.8c4 [symbolic] +// CHECK:STDOUT: %impl.elem3.5d8: %.a74 = impl_witness_access %Iterate.lookup_impl_witness.695, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.448: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.ea2) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.444: = impl_witness imports.%OptionalStorage.impl_witness_table.6f7, @T.as_type.as.OptionalStorage.impl(%facet_value.ea2) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.7c3: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.444) [concrete] +// CHECK:STDOUT: %Optional.4fe: type = class_type @Optional, @Optional(%OptionalStorage.facet.7c3) [concrete] +// CHECK:STDOUT: %specific_impl_fn.327: = specific_impl_function %impl.elem3.5d8, @Iterate.WithSelf.Next(%Iterate.facet.8c4) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.fdd: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.7c3) [concrete] +// CHECK:STDOUT: %Optional.HasValue.fe2: %Optional.HasValue.type.fdd = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.43b: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.7c3) [concrete] +// CHECK:STDOUT: %Optional.Get.4c3: %Optional.Get.type.43b = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.3cd: %Destroy.type = facet_value %ValueType, (%custom_witness.a98c63.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.5ea: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.3cd) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.40c: type = struct_type {.value: %MaybeUnformed.5ea, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.fe2, @Optional.HasValue(%OptionalStorage.facet.7c3) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.4c3, @Optional.Get(%OptionalStorage.facet.7c3) [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator.type: type = fn_type @ValueType.cpp_operator [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.6: type = fn_type @Destroy.Op.loc44_29.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.6: %Destroy.Op.type.790b3b.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.185: = lookup_impl_witness %impl.elem1.bdd, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.a36: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.bdd) [symbolic] +// CHECK:STDOUT: %.490: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.a36, %impl.elem1.bdd [symbolic] +// CHECK:STDOUT: %impl.elem0.d3e: %.490 = impl_witness_access %Destroy.lookup_impl_witness.185, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.e07: = specific_impl_function %impl.elem0.d3e, @Destroy.WithSelf.Op(%impl.elem1.bdd) [symbolic] // CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] // CHECK:STDOUT: %pattern_type.b76: type = pattern_type %MutableRange [concrete] // CHECK:STDOUT: %ConstRange: type = class_type @ConstRange [concrete] // CHECK:STDOUT: %pattern_type.631: type = pattern_type %ConstRange [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %Iterator.826: type = class_type @Iterator.1 [concrete] // CHECK:STDOUT: %Sentinel.6eb: type = class_type @Sentinel.1 [concrete] // CHECK:STDOUT: %MutableRange.Begin.type: type = fn_type @MutableRange.Begin [concrete] @@ -758,14 +1194,42 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %MutableRange.End.type: type = fn_type @MutableRange.End [concrete] // CHECK:STDOUT: %MutableRange.End: %MutableRange.End.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.292: = custom_witness (%Iterator.826, %Sentinel.6eb, %MutableRange.Begin, %MutableRange.End), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.de2: %CppRangeForIterate.type = facet_value %MutableRange, (%custom_witness.292) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.134: type = fn_type @Iterator.Op.1 [concrete] -// CHECK:STDOUT: %Iterator.Op.f05: %Iterator.Op.type.134 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ef99ee.1: = custom_witness (%Iterator.Op.f05), @Destroy [concrete] -// CHECK:STDOUT: %Sentinel.Op.type.134: type = fn_type @Sentinel.Op.1 [concrete] -// CHECK:STDOUT: %Sentinel.Op.f05: %Sentinel.Op.type.134 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ef99ee.2: = custom_witness (%Sentinel.Op.f05), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.99a: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.292, %custom_witness.ef99ee.1, %custom_witness.ef99ee.2) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.1: type = fn_type @Iterator.Op.1 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.1: %Iterator.Op.type.134d4f.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.675: = custom_witness (%ValueType, %Iterator.Op.f056ae.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.2: type = fn_type @Iterator.Op.2 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.2: %Iterator.Op.type.134d4f.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.ef99ee.1: = custom_witness (%Iterator.Op.f056ae.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.3: type = fn_type @Iterator.Op.3 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.3: %Iterator.Op.type.134d4f.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.3a5b7b.1: = custom_witness (%Iterator.Op.f056ae.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type.eace26.1: type = fn_type @Equal.1 [concrete] +// CHECK:STDOUT: %Equal.8c4faf.1: %Equal.type.eace26.1 = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type.ca4b73.1: type = fn_type @NotEqual.1 [concrete] +// CHECK:STDOUT: %NotEqual.6eaf3e.1: %NotEqual.type.ca4b73.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e77: = custom_witness (%Equal.8c4faf.1, %NotEqual.6eaf3e.1), @EqWith, @EqWith(%Sentinel.6eb) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.134d4f.4: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.f056ae.4: %Iterator.Op.type.134d4f.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f9b: = custom_witness (%Iterator.Op.f056ae.4), @Inc [concrete] +// CHECK:STDOUT: %Sentinel.Op.type.134d4f.1: type = fn_type @Sentinel.Op.1 [concrete] +// CHECK:STDOUT: %Sentinel.Op.f056ae.1: %Sentinel.Op.type.134d4f.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.ef99ee.2: = custom_witness (%Sentinel.Op.f056ae.1), @Destroy [concrete] +// CHECK:STDOUT: %Sentinel.Op.type.134d4f.2: type = fn_type @Sentinel.Op.2 [concrete] +// CHECK:STDOUT: %Sentinel.Op.f056ae.2: %Sentinel.Op.type.134d4f.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.3a5b7b.2: = custom_witness (%Sentinel.Op.f056ae.2), @Copy [concrete] +// CHECK:STDOUT: %facet_value.4eb: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.a98c63.1, %custom_witness.b0507b.1, %custom_witness.292, %custom_witness.ef99ee.1, %custom_witness.3a5b7b.1, %custom_witness.675, %custom_witness.e77, %custom_witness.f9b, %custom_witness.ef99ee.2, %custom_witness.3a5b7b.2) [concrete] +// CHECK:STDOUT: %tuple.type.c00: type = tuple_type (%Iterator.826, %Sentinel.6eb) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.7: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.7: %Destroy.Op.type.790b3b.7 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.7: = custom_witness (%Destroy.Op.2dd605.7), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.0cd: %Destroy.type = facet_value %tuple.type.c00, (%custom_witness.e20f1f.7) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.5a3: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.4eb) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.1df: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.4eb) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.dcd: %R.as_type.as.Iterate.impl.NewCursor.type.1df = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.390: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.4eb) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.2f5: %R.as_type.as.Iterate.impl.Next.type.390 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.269: %Iterate.type = facet_value %MutableRange, (%Iterate.impl_witness.5a3) [concrete] +// CHECK:STDOUT: %facet_value.035: %Iterate_where.type.630 = facet_value %MutableRange, (%Iterate.impl_witness.5a3) [concrete] // CHECK:STDOUT: %Iterator.4f0: type = class_type @Iterator.2 [concrete] // CHECK:STDOUT: %Sentinel.45e: type = class_type @Sentinel.2 [concrete] // CHECK:STDOUT: %ConstRange.Begin.type: type = fn_type @ConstRange.Begin [concrete] @@ -773,850 +1237,1924 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %ConstRange.End.type: type = fn_type @ConstRange.End [concrete] // CHECK:STDOUT: %ConstRange.End: %ConstRange.End.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.8cb: = custom_witness (%Iterator.4f0, %Sentinel.45e, %ConstRange.Begin, %ConstRange.End), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.ef1: %CppRangeForIterate.type = facet_value %ConstRange, (%custom_witness.8cb) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.9f2: type = fn_type @Iterator.Op.2 [concrete] -// CHECK:STDOUT: %Iterator.Op.7b7: %Iterator.Op.type.9f2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df0c4f.1: = custom_witness (%Iterator.Op.7b7), @Destroy [concrete] -// CHECK:STDOUT: %Sentinel.Op.type.9f2: type = fn_type @Sentinel.Op.2 [concrete] -// CHECK:STDOUT: %Sentinel.Op.7b7: %Sentinel.Op.type.9f2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df0c4f.2: = custom_witness (%Sentinel.Op.7b7), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.b4b: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.8cb, %custom_witness.df0c4f.1, %custom_witness.df0c4f.2) [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.82a: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.de2) [concrete] -// CHECK:STDOUT: %.26f: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.82a, %CppRangeForIterate.facet.de2 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.9fe: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.de2) [concrete] -// CHECK:STDOUT: %.6d3: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.9fe, %CppRangeForIterate.facet.de2 [concrete] -// CHECK:STDOUT: %Destroy.facet.959: %Destroy.type = facet_value %Sentinel.6eb, (%custom_witness.ef99ee.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.6d7: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.959) [concrete] -// CHECK:STDOUT: %.3e7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.6d7, %Destroy.facet.959 [concrete] -// CHECK:STDOUT: %Destroy.facet.f6b: %Destroy.type = facet_value %Iterator.826, (%custom_witness.ef99ee.1) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.a45: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.f6b) [concrete] -// CHECK:STDOUT: %.ee6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.a45, %Destroy.facet.f6b [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.317: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.ef1) [concrete] -// CHECK:STDOUT: %.3f6: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.317, %CppRangeForIterate.facet.ef1 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.120: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.ef1) [concrete] -// CHECK:STDOUT: %.cd4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.120, %CppRangeForIterate.facet.ef1 [concrete] -// CHECK:STDOUT: %Destroy.facet.d9f: %Destroy.type = facet_value %Sentinel.45e, (%custom_witness.df0c4f.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.39d: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.d9f) [concrete] -// CHECK:STDOUT: %.f49: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.39d, %Destroy.facet.d9f [concrete] -// CHECK:STDOUT: %Destroy.facet.2fa: %Destroy.type = facet_value %Iterator.4f0, (%custom_witness.df0c4f.1) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.993: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.2fa) [concrete] -// CHECK:STDOUT: %.61a: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.993, %Destroy.facet.2fa [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.1: type = fn_type @Iterator.Op.5 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.1: %Iterator.Op.type.9f2350.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.762: = custom_witness (%ValueType, %Iterator.Op.7b7347.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.2: type = fn_type @Iterator.Op.6 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.2: %Iterator.Op.type.9f2350.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df0c4f.1: = custom_witness (%Iterator.Op.7b7347.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.3: type = fn_type @Iterator.Op.7 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.3: %Iterator.Op.type.9f2350.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f14c15.1: = custom_witness (%Iterator.Op.7b7347.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type.eace26.2: type = fn_type @Equal.2 [concrete] +// CHECK:STDOUT: %Equal.8c4faf.2: %Equal.type.eace26.2 = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type.ca4b73.2: type = fn_type @NotEqual.2 [concrete] +// CHECK:STDOUT: %NotEqual.6eaf3e.2: %NotEqual.type.ca4b73.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.d24: = custom_witness (%Equal.8c4faf.2, %NotEqual.6eaf3e.2), @EqWith, @EqWith(%Sentinel.45e) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.9f2350.4: type = fn_type @Iterator.Op.8 [concrete] +// CHECK:STDOUT: %Iterator.Op.7b7347.4: %Iterator.Op.type.9f2350.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.c18: = custom_witness (%Iterator.Op.7b7347.4), @Inc [concrete] +// CHECK:STDOUT: %Sentinel.Op.type.9f2350.1: type = fn_type @Sentinel.Op.3 [concrete] +// CHECK:STDOUT: %Sentinel.Op.7b7347.1: %Sentinel.Op.type.9f2350.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df0c4f.2: = custom_witness (%Sentinel.Op.7b7347.1), @Destroy [concrete] +// CHECK:STDOUT: %Sentinel.Op.type.9f2350.2: type = fn_type @Sentinel.Op.4 [concrete] +// CHECK:STDOUT: %Sentinel.Op.7b7347.2: %Sentinel.Op.type.9f2350.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f14c15.2: = custom_witness (%Sentinel.Op.7b7347.2), @Copy [concrete] +// CHECK:STDOUT: %facet_value.089: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.a98c63.1, %custom_witness.b0507b.1, %custom_witness.8cb, %custom_witness.df0c4f.1, %custom_witness.f14c15.1, %custom_witness.762, %custom_witness.d24, %custom_witness.c18, %custom_witness.df0c4f.2, %custom_witness.f14c15.2) [concrete] +// CHECK:STDOUT: %tuple.type.6b1: type = tuple_type (%Iterator.4f0, %Sentinel.45e) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.8: type = fn_type @Destroy.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.8: %Destroy.Op.type.790b3b.8 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.8: = custom_witness (%Destroy.Op.2dd605.8), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.018: %Destroy.type = facet_value %tuple.type.6b1, (%custom_witness.e20f1f.8) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.c99: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.089) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.d53: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.089) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.017: %R.as_type.as.Iterate.impl.NewCursor.type.d53 = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.4b3: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.089) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.c8f: %R.as_type.as.Iterate.impl.Next.type.4b3 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.780: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.c99) [concrete] +// CHECK:STDOUT: %facet_value.2f3: %Iterate_where.type.630 = facet_value %ConstRange, (%Iterate.impl_witness.c99) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.635: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.269) [concrete] +// CHECK:STDOUT: %.3fa: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.635, %Iterate.facet.269 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn.55e: = specific_function %R.as_type.as.Iterate.impl.NewCursor.dcd, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.4eb) [concrete] +// CHECK:STDOUT: %complete_type.dee: = complete_type_witness %tuple.type.c00 [concrete] +// CHECK:STDOUT: %ptr.993: type = ptr_type %tuple.type.c00 [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.ba6: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.269) [concrete] +// CHECK:STDOUT: %.dcc: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.ba6, %Iterate.facet.269 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn.370: = specific_function %R.as_type.as.Iterate.impl.Next.2f5, @R.as_type.as.Iterate.impl.Next(%facet_value.4eb) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.6fd: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.0cd) [concrete] +// CHECK:STDOUT: %.ad7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.6fd, %Destroy.facet.0cd [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.b98: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.780) [concrete] +// CHECK:STDOUT: %.25f: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.b98, %Iterate.facet.780 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn.26d: = specific_function %R.as_type.as.Iterate.impl.NewCursor.017, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.089) [concrete] +// CHECK:STDOUT: %complete_type.74d: = complete_type_witness %tuple.type.6b1 [concrete] +// CHECK:STDOUT: %ptr.f19: type = ptr_type %tuple.type.6b1 [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.8d9: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.780) [concrete] +// CHECK:STDOUT: %.99c: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.8d9, %Iterate.facet.780 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn.ffd: = specific_function %R.as_type.as.Iterate.impl.Next.c8f, @R.as_type.as.Iterate.impl.Next(%facet_value.089) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.fe4: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.018) [concrete] +// CHECK:STDOUT: %.57d: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.fe4, %Destroy.facet.018 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.735: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] -// CHECK:STDOUT: %Core.import_ref.572: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc3] -// CHECK:STDOUT: %Core.import_ref.213: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin.type (%CppRangeForIterate.WithSelf.Begin.type.753895.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin (constants.%CppRangeForIterate.WithSelf.Begin.2b31f7.1)] -// CHECK:STDOUT: %Core.import_ref.730: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End.type (%CppRangeForIterate.WithSelf.End.type.056be7.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End (constants.%CppRangeForIterate.WithSelf.End.a331a3.1)] +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .ValueType = %ValueType.decl +// CHECK:STDOUT: .MutableRange = %MutableRange.decl +// CHECK:STDOUT: .ConstRange = %ConstRange.decl +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.0b9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.498) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.bf8)] +// CHECK:STDOUT: %Core.import_ref.61f: @Optional.%Optional.Get.type (%Optional.Get.type.d22) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.6fc)] +// CHECK:STDOUT: %Core.import_ref.2b5: type = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%DefaultOptionalStorage (constants.%DefaultOptionalStorage.f8b)] +// CHECK:STDOUT: %Core.import_ref.b0a: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None.type (%T.as_type.as.OptionalStorage.impl.None.type.ceb) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None (constants.%T.as_type.as.OptionalStorage.impl.None.9dd)] +// CHECK:STDOUT: %Core.import_ref.3fc: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some.type (%T.as_type.as.OptionalStorage.impl.Some.type.87a) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some (constants.%T.as_type.as.OptionalStorage.impl.Some.898)] +// CHECK:STDOUT: %Core.import_ref.986: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has.type (%T.as_type.as.OptionalStorage.impl.Has.type.0ae) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has (constants.%T.as_type.as.OptionalStorage.impl.Has.e0f)] +// CHECK:STDOUT: %Core.import_ref.557: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get.type (%T.as_type.as.OptionalStorage.impl.Get.type.46f) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get (constants.%T.as_type.as.OptionalStorage.impl.Get.8c2)] +// CHECK:STDOUT: %Core.import_ref.999 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %OptionalStorage.impl_witness_table.6f7 = impl_witness_table (%Core.import_ref.2b5, %Core.import_ref.b0a, %Core.import_ref.3fc, %Core.import_ref.986, %Core.import_ref.557, %Core.import_ref.999), @T.as_type.as.OptionalStorage.impl [concrete] +// CHECK:STDOUT: %ValueType.decl: type = class_decl @ValueType [concrete = constants.%ValueType] {} {} +// CHECK:STDOUT: %ValueType.cpp_destructor.decl: %ValueType.cpp_destructor.type = fn_decl @ValueType.cpp_destructor [concrete = constants.%ValueType.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.89a: %facet_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%facet_value (constants.%facet_value.a30)] +// CHECK:STDOUT: %Core.import_ref.9ea: %Destroy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%Destroy.facet (constants.%Destroy.facet.2fe)] +// CHECK:STDOUT: %Core.import_ref.a6c: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor.type (%R.as_type.as.Iterate.impl.NewCursor.type.9b6) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor (constants.%R.as_type.as.Iterate.impl.NewCursor.b29)] +// CHECK:STDOUT: %Core.import_ref.a02: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next.type (%R.as_type.as.Iterate.impl.Next.type.5b5) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next (constants.%R.as_type.as.Iterate.impl.Next.cd2)] +// CHECK:STDOUT: %Iterate.impl_witness_table.9f0 = impl_witness_table (%Core.import_ref.89a, %Core.import_ref.9ea, %Core.import_ref.a6c, %Core.import_ref.a02), @R.as_type.as.Iterate.impl [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator.decl: %ValueType.cpp_operator.type = fn_decl @ValueType.cpp_operator [concrete = constants.%ValueType.cpp_operator] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %MutableRange.decl: type = class_decl @MutableRange [concrete = constants.%MutableRange] {} {} +// CHECK:STDOUT: %ConstRange.decl: type = class_decl @ConstRange [concrete = constants.%ConstRange] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Test(%R.loc40_10.2: %CppRangeForIterate_where.type) { +// CHECK:STDOUT: generic fn @Test(%R.loc40_10.2: %Iterate_where.type.630) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness: = lookup_impl_witness %R.loc40_10.1, @CppRangeForIterate [symbolic = %CppRangeForIterate.lookup_impl_witness (constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2)] -// CHECK:STDOUT: %CppRangeForIterate.facet: %CppRangeForIterate.type = facet_value %R.as_type.loc40_113.1, (%CppRangeForIterate.lookup_impl_witness) [symbolic = %CppRangeForIterate.facet (constants.%CppRangeForIterate.facet.0d2)] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.Begin.type (constants.%CppRangeForIterate.WithSelf.Begin.type.57e)] -// CHECK:STDOUT: %.loc42_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type, %CppRangeForIterate.facet [symbolic = %.loc42_4 (constants.%.b85)] -// CHECK:STDOUT: %impl.elem2.loc42_4.2: @Test.%.loc42_4 (%.b85) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc42_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %specific_impl_fn.loc42_4.2: = specific_impl_function %impl.elem2.loc42_4.2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc42_4.2 (constants.%specific_impl_fn.c0f)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc40_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.695)] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc40_69.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.8c4)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.210)] +// CHECK:STDOUT: %.loc44_29.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc44_29.13 (constants.%.9b8)] +// CHECK:STDOUT: %impl.elem2.loc44_29.2: @Test.%.loc44_29.13 (%.9b8) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_29.2 (constants.%impl.elem2.377)] +// CHECK:STDOUT: %specific_impl_fn.loc44_29.4: = specific_impl_function %impl.elem2.loc44_29.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc44_29.4 (constants.%specific_impl_fn.ed7)] // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.End.type (constants.%CppRangeForIterate.WithSelf.End.type.04d)] -// CHECK:STDOUT: %.loc43_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type, %CppRangeForIterate.facet [symbolic = %.loc43_4 (constants.%.b40)] -// CHECK:STDOUT: %impl.elem3.loc43_4.2: @Test.%.loc43_4 (%.b40) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc43_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %specific_impl_fn.loc43_4.2: = specific_impl_function %impl.elem3.loc43_4.2, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc43_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc43: = lookup_impl_witness %impl.elem1.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc43 (constants.%Destroy.lookup_impl_witness.a8f)] -// CHECK:STDOUT: %Destroy.facet.loc43: %Destroy.type = facet_value %impl.elem1.1, (%Destroy.lookup_impl_witness.loc43) [symbolic = %Destroy.facet.loc43 (constants.%Destroy.facet.543)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc43: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc43) [symbolic = %Destroy.WithSelf.Op.type.loc43 (constants.%Destroy.WithSelf.Op.type.366)] -// CHECK:STDOUT: %.loc43_9.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc43, %Destroy.facet.loc43 [symbolic = %.loc43_9.3 (constants.%.b83)] -// CHECK:STDOUT: %impl.elem0.loc43_9.2: @Test.%.loc43_9.3 (%.b83) = impl_witness_access %Destroy.lookup_impl_witness.loc43, element0 [symbolic = %impl.elem0.loc43_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %specific_impl_fn.loc43_9.2: = specific_impl_function %impl.elem0.loc43_9.2, @Destroy.WithSelf.Op(%Destroy.facet.loc43) [symbolic = %specific_impl_fn.loc43_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc42: = lookup_impl_witness %impl.elem0.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc42 (constants.%Destroy.lookup_impl_witness.089)] -// CHECK:STDOUT: %Destroy.facet.loc42: %Destroy.type = facet_value %impl.elem0.1, (%Destroy.lookup_impl_witness.loc42) [symbolic = %Destroy.facet.loc42 (constants.%Destroy.facet.5e8)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc42: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc42) [symbolic = %Destroy.WithSelf.Op.type.loc42 (constants.%Destroy.WithSelf.Op.type.7cb)] -// CHECK:STDOUT: %.loc42_11.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc42, %Destroy.facet.loc42 [symbolic = %.loc42_11.3 (constants.%.a68)] -// CHECK:STDOUT: %impl.elem0.loc42_11.2: @Test.%.loc42_11.3 (%.a68) = impl_witness_access %Destroy.lookup_impl_witness.loc42, element0 [symbolic = %impl.elem0.loc42_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %specific_impl_fn.loc42_11.2: = specific_impl_function %impl.elem0.loc42_11.2, @Destroy.WithSelf.Op(%Destroy.facet.loc42) [symbolic = %specific_impl_fn.loc42_11.2 (constants.%specific_impl_fn.f06)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.864)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.ad2)] +// CHECK:STDOUT: %.loc44_29.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc44_29.14 (constants.%.a74)] +// CHECK:STDOUT: %impl.elem3.loc44_29.2: @Test.%.loc44_29.14 (%.a74) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc44_29.2 (constants.%impl.elem3.5d8)] +// CHECK:STDOUT: %specific_impl_fn.loc44_29.5: = specific_impl_function %impl.elem3.loc44_29.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc44_29.5 (constants.%specific_impl_fn.327)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.a36)] +// CHECK:STDOUT: %.loc44_29.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc44_29.15 (constants.%.490)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.185)] +// CHECK:STDOUT: %impl.elem0.loc44_29.2: @Test.%.loc44_29.15 (%.490) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc44_29.2 (constants.%impl.elem0.d3e)] +// CHECK:STDOUT: %specific_impl_fn.loc44_29.6: = specific_impl_function %impl.elem0.loc44_29.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc44_29.6 (constants.%specific_impl_fn.e07)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%r.param: ref @Test.%R.as_type.loc40_113.1 (%R.as_type)) { +// CHECK:STDOUT: fn(%r.param: ref @Test.%R.as_type.loc40_69.1 (%R.as_type.339)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %r.ref.loc42: ref @Test.%R.as_type.loc40_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %Begin.ref: %CppRangeForIterate.assoc_type = name_ref Begin, imports.%Core.import_ref.735 [concrete = constants.%assoc2] -// CHECK:STDOUT: %impl.elem2.loc42_4.1: @Test.%.loc42_4 (%.b85) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic = %impl.elem2.loc42_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %bound_method.loc42_4: = bound_method %r.ref.loc42, %impl.elem2.loc42_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc42_4.1: = specific_impl_function %impl.elem2.loc42_4.1, @CppRangeForIterate.WithSelf.Begin(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc42_4.2 (constants.%specific_impl_fn.c0f)] -// CHECK:STDOUT: %bound_method.loc42_11.1: = bound_method %r.ref.loc42, %specific_impl_fn.loc42_4.1 -// CHECK:STDOUT: %.loc42_11.1: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.call: init @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) to %.loc42_11.1 = call %bound_method.loc42_11.1(%r.ref.loc42) -// CHECK:STDOUT: %.loc42_11.2: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary %.loc42_11.1, %CppRangeForIterate.WithSelf.Begin.call -// CHECK:STDOUT: %r.ref.loc43: ref @Test.%R.as_type.loc40_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %End.ref: %CppRangeForIterate.assoc_type = name_ref End, imports.%Core.import_ref.572 [concrete = constants.%assoc3] -// CHECK:STDOUT: %impl.elem3.loc43_4.1: @Test.%.loc43_4 (%.b40) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic = %impl.elem3.loc43_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %bound_method.loc43_4: = bound_method %r.ref.loc43, %impl.elem3.loc43_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc43_4.1: = specific_impl_function %impl.elem3.loc43_4.1, @CppRangeForIterate.WithSelf.End(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc43_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: %bound_method.loc43_9.1: = bound_method %r.ref.loc43, %specific_impl_fn.loc43_4.1 -// CHECK:STDOUT: %.loc43_9.1: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.call: init @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) to %.loc43_9.1 = call %bound_method.loc43_9.1(%r.ref.loc43) -// CHECK:STDOUT: %.loc43_9.2: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary %.loc43_9.1, %CppRangeForIterate.WithSelf.End.call -// CHECK:STDOUT: %impl.elem0.loc43_9.1: @Test.%.loc43_9.3 (%.b83) = impl_witness_access constants.%Destroy.lookup_impl_witness.a8f, element0 [symbolic = %impl.elem0.loc43_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %bound_method.loc43_9.2: = bound_method %.loc43_9.2, %impl.elem0.loc43_9.1 -// CHECK:STDOUT: %specific_impl_fn.loc43_9.1: = specific_impl_function %impl.elem0.loc43_9.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.543) [symbolic = %specific_impl_fn.loc43_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %bound_method.loc43_9.3: = bound_method %.loc43_9.2, %specific_impl_fn.loc43_9.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc43: init %empty_tuple.type = call %bound_method.loc43_9.3(%.loc43_9.2) -// CHECK:STDOUT: %impl.elem0.loc42_11.1: @Test.%.loc42_11.3 (%.a68) = impl_witness_access constants.%Destroy.lookup_impl_witness.089, element0 [symbolic = %impl.elem0.loc42_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %bound_method.loc42_11.2: = bound_method %.loc42_11.2, %impl.elem0.loc42_11.1 -// CHECK:STDOUT: %specific_impl_fn.loc42_11.1: = specific_impl_function %impl.elem0.loc42_11.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.5e8) [symbolic = %specific_impl_fn.loc42_11.2 (constants.%specific_impl_fn.f06)] -// CHECK:STDOUT: %bound_method.loc42_11.3: = bound_method %.loc42_11.2, %specific_impl_fn.loc42_11.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc42: init %empty_tuple.type = call %bound_method.loc42_11.3(%.loc42_11.2) +// CHECK:STDOUT: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.bef = value_binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %r.ref: ref @Test.%R.as_type.loc40_69.1 (%R.as_type.339) = name_ref r, %r +// CHECK:STDOUT: %impl.elem2.loc44_29.1: @Test.%.loc44_29.13 (%.9b8) = impl_witness_access constants.%Iterate.lookup_impl_witness.695, element2 [symbolic = %impl.elem2.loc44_29.2 (constants.%impl.elem2.377)] +// CHECK:STDOUT: %bound_method.loc44_29.1: = bound_method %r.ref, %impl.elem2.loc44_29.1 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.1: = specific_impl_function %impl.elem2.loc44_29.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.8c4) [symbolic = %specific_impl_fn.loc44_29.4 (constants.%specific_impl_fn.ed7)] +// CHECK:STDOUT: %bound_method.loc44_29.2: = bound_method %r.ref, %specific_impl_fn.loc44_29.1 +// CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.254) = var invalid +// CHECK:STDOUT: %.loc44_28.1: @Test.%R.as_type.loc40_69.1 (%R.as_type.339) = acquire_value %r.ref +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @Test.%as_type (%as_type.254) to %var = call %bound_method.loc44_29.2(%.loc44_28.1) +// CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.next: +// CHECK:STDOUT: %addr.loc44: @Test.%ptr (%ptr.864) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc44_29.1: @Test.%.loc44_29.14 (%.a74) = impl_witness_access constants.%Iterate.lookup_impl_witness.695, element3 [symbolic = %impl.elem3.loc44_29.2 (constants.%impl.elem3.5d8)] +// CHECK:STDOUT: %bound_method.loc44_29.3: = bound_method %r.ref, %impl.elem3.loc44_29.1 +// CHECK:STDOUT: %.loc44_29.1: %Destroy.type = converted constants.%as_type.254, constants.%impl.elem1.bdd [symbolic = %impl.elem1 (constants.%impl.elem1.bdd)] +// CHECK:STDOUT: %specific_impl_fn.loc44_29.2: = specific_impl_function %impl.elem3.loc44_29.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.8c4) [symbolic = %specific_impl_fn.loc44_29.5 (constants.%specific_impl_fn.327)] +// CHECK:STDOUT: %bound_method.loc44_29.4: = bound_method %r.ref, %specific_impl_fn.loc44_29.2 +// CHECK:STDOUT: %.loc44_29.2: ref %Optional.4fe = temporary_storage +// CHECK:STDOUT: %.loc44_28.2: @Test.%R.as_type.loc40_69.1 (%R.as_type.339) = acquire_value %r.ref +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.4fe to %.loc44_29.2 = call %bound_method.loc44_29.4(%.loc44_28.2, %addr.loc44) +// CHECK:STDOUT: %.loc44_29.3: ref %Optional.4fe = temporary %.loc44_29.2, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc44_29.4: %Optional.HasValue.type.fdd = specific_constant imports.%Core.import_ref.0b9, @Optional(constants.%OptionalStorage.facet.7c3) [concrete = constants.%Optional.HasValue.fe2] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.fdd = name_ref HasValue, %.loc44_29.4 [concrete = constants.%Optional.HasValue.fe2] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc44_29.3, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.7c3) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc44_29.5: = bound_method %.loc44_29.3, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc44_29.5: %Optional.4fe = acquire_value %.loc44_29.3 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc44_29.5(%.loc44_29.5) +// CHECK:STDOUT: %.loc44_29.6: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc44_29.7: bool = converted %Optional.HasValue.call, %.loc44_29.6 +// CHECK:STDOUT: if %.loc44_29.7 br !for.body else br !for.done +// CHECK:STDOUT: +// CHECK:STDOUT: !for.body: +// CHECK:STDOUT: %.loc44_29.8: %Optional.Get.type.43b = specific_constant imports.%Core.import_ref.61f, @Optional(constants.%OptionalStorage.facet.7c3) [concrete = constants.%Optional.Get.4c3] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.43b = name_ref Get, %.loc44_29.8 [concrete = constants.%Optional.Get.4c3] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc44_29.3, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.7c3) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc44_29.6: = bound_method %.loc44_29.3, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc44_29.9: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc44_29.10: %Optional.4fe = acquire_value %.loc44_29.3 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc44_29.9 = call %bound_method.loc44_29.6(%.loc44_29.10) +// CHECK:STDOUT: %.loc44_14: type = splice_block %ValueType.ref.loc44 [concrete = constants.%ValueType] { +// CHECK:STDOUT: %Cpp.ref.loc44: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ValueType.ref.loc44: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc44_29.11: ref %ValueType = temporary %.loc44_29.9, %Optional.Get.call +// CHECK:STDOUT: %.loc44_29.12: %ValueType = acquire_value %.loc44_29.11 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc44_29.12 +// CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum +// CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i +// CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl +// CHECK:STDOUT: %.loc45_12: ref %ValueType = value_as_ref %i.ref +// CHECK:STDOUT: %addr.loc45: %ptr.6db = addr_of %.loc45_12 +// CHECK:STDOUT: %.loc45_9.1: %ptr.e0a = as_compatible %addr.loc45 +// CHECK:STDOUT: %.loc45_9.2: %ptr.e0a = converted %addr.loc45, %.loc45_9.1 +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc45_9.2) +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.done: +// CHECK:STDOUT: %ValueType.Op.bound.loc44: = bound_method %.loc44_29.11, constants.%ValueType.Op.cc70d5.1 +// CHECK:STDOUT: %Op.ref.loc44: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc44: = bound_method %.loc44_29.11, %Op.ref.loc44 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc44: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc44(%.loc44_29.11) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc44_29.3, constants.%Destroy.Op.2dd605.6 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc44_29.3) +// CHECK:STDOUT: %impl.elem0.loc44_29.1: @Test.%.loc44_29.15 (%.490) = impl_witness_access constants.%Destroy.lookup_impl_witness.185, element0 [symbolic = %impl.elem0.loc44_29.2 (constants.%impl.elem0.d3e)] +// CHECK:STDOUT: %bound_method.loc44_29.7: = bound_method %var, %impl.elem0.loc44_29.1 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.3: = specific_impl_function %impl.elem0.loc44_29.1, @Destroy.WithSelf.Op(constants.%impl.elem1.bdd) [symbolic = %specific_impl_fn.loc44_29.6 (constants.%specific_impl_fn.e07)] +// CHECK:STDOUT: %bound_method.loc44_29.8: = bound_method %var, %specific_impl_fn.loc44_29.3 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc44_29.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%R) { -// CHECK:STDOUT: %R.loc40_10.1 => constants.%R -// CHECK:STDOUT: %R.as_type.loc40_113.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.26c6ea.2 +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.1(%self.param: ref %MaybeUnformed.5ea) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.99a) { -// CHECK:STDOUT: %R.loc40_10.1 => constants.%facet_value.99a -// CHECK:STDOUT: %R.as_type.loc40_113.1 => constants.%MutableRange +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.2(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.3(%self.param: ref %struct_type.value.has_value.40c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.4(%self.param: ref %DefaultOptionalStorage.448) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc44_29.5(%self.param: ref %Optional.4fe) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%R.2da) { +// CHECK:STDOUT: %R.loc40_10.1 => constants.%R.2da +// CHECK:STDOUT: %R.as_type.loc40_69.1 => constants.%R.as_type.339 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.df0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%facet_value.035) { +// CHECK:STDOUT: %R.loc40_10.1 => constants.%facet_value.035 +// CHECK:STDOUT: %R.as_type.loc40_69.1 => constants.%MutableRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.b76 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.292 -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.de2 -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.82a -// CHECK:STDOUT: %.loc42_4 => constants.%.26f -// CHECK:STDOUT: %impl.elem2.loc42_4.2 => constants.%MutableRange.Begin -// CHECK:STDOUT: %specific_impl_fn.loc42_4.2 => constants.%MutableRange.Begin -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.826 -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.9fe -// CHECK:STDOUT: %.loc43_4 => constants.%.6d3 -// CHECK:STDOUT: %impl.elem3.loc43_4.2 => constants.%MutableRange.End -// CHECK:STDOUT: %specific_impl_fn.loc43_4.2 => constants.%MutableRange.End -// CHECK:STDOUT: %impl.elem1.1 => constants.%Sentinel.6eb -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc43 => constants.%custom_witness.ef99ee.2 -// CHECK:STDOUT: %Destroy.facet.loc43 => constants.%Destroy.facet.959 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc43 => constants.%Destroy.WithSelf.Op.type.6d7 -// CHECK:STDOUT: %.loc43_9.3 => constants.%.3e7 -// CHECK:STDOUT: %impl.elem0.loc43_9.2 => constants.%Sentinel.Op.f05 -// CHECK:STDOUT: %specific_impl_fn.loc43_9.2 => constants.%Sentinel.Op.f05 -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc42 => constants.%custom_witness.ef99ee.1 -// CHECK:STDOUT: %Destroy.facet.loc42 => constants.%Destroy.facet.f6b -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc42 => constants.%Destroy.WithSelf.Op.type.a45 -// CHECK:STDOUT: %.loc42_11.3 => constants.%.ee6 -// CHECK:STDOUT: %impl.elem0.loc42_11.2 => constants.%Iterator.Op.f05 -// CHECK:STDOUT: %specific_impl_fn.loc42_11.2 => constants.%Iterator.Op.f05 +// CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.5a3 +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.269 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.635 +// CHECK:STDOUT: %.loc44_29.13 => constants.%.3fa +// CHECK:STDOUT: %impl.elem2.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.dcd +// CHECK:STDOUT: %specific_impl_fn.loc44_29.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.55e +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.0cd +// CHECK:STDOUT: %as_type => constants.%tuple.type.c00 +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.dee +// CHECK:STDOUT: %ptr => constants.%ptr.993 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.ba6 +// CHECK:STDOUT: %.loc44_29.14 => constants.%.dcc +// CHECK:STDOUT: %impl.elem3.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.Next.2f5 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.370 +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.6fd +// CHECK:STDOUT: %.loc44_29.15 => constants.%.ad7 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.7 +// CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.2dd605.7 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.2dd605.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.b4b) { -// CHECK:STDOUT: %R.loc40_10.1 => constants.%facet_value.b4b -// CHECK:STDOUT: %R.as_type.loc40_113.1 => constants.%ConstRange +// CHECK:STDOUT: specific @Test(constants.%facet_value.2f3) { +// CHECK:STDOUT: %R.loc40_10.1 => constants.%facet_value.2f3 +// CHECK:STDOUT: %R.as_type.loc40_69.1 => constants.%ConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.631 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.8cb -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.ef1 -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.317 -// CHECK:STDOUT: %.loc42_4 => constants.%.3f6 -// CHECK:STDOUT: %impl.elem2.loc42_4.2 => constants.%ConstRange.Begin -// CHECK:STDOUT: %specific_impl_fn.loc42_4.2 => constants.%ConstRange.Begin -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.4f0 -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.120 -// CHECK:STDOUT: %.loc43_4 => constants.%.cd4 -// CHECK:STDOUT: %impl.elem3.loc43_4.2 => constants.%ConstRange.End -// CHECK:STDOUT: %specific_impl_fn.loc43_4.2 => constants.%ConstRange.End -// CHECK:STDOUT: %impl.elem1.1 => constants.%Sentinel.45e -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc43 => constants.%custom_witness.df0c4f.2 -// CHECK:STDOUT: %Destroy.facet.loc43 => constants.%Destroy.facet.d9f -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc43 => constants.%Destroy.WithSelf.Op.type.39d -// CHECK:STDOUT: %.loc43_9.3 => constants.%.f49 -// CHECK:STDOUT: %impl.elem0.loc43_9.2 => constants.%Sentinel.Op.7b7 -// CHECK:STDOUT: %specific_impl_fn.loc43_9.2 => constants.%Sentinel.Op.7b7 -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc42 => constants.%custom_witness.df0c4f.1 -// CHECK:STDOUT: %Destroy.facet.loc42 => constants.%Destroy.facet.2fa -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc42 => constants.%Destroy.WithSelf.Op.type.993 -// CHECK:STDOUT: %.loc42_11.3 => constants.%.61a -// CHECK:STDOUT: %impl.elem0.loc42_11.2 => constants.%Iterator.Op.7b7 -// CHECK:STDOUT: %specific_impl_fn.loc42_11.2 => constants.%Iterator.Op.7b7 +// CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.c99 +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.780 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.b98 +// CHECK:STDOUT: %.loc44_29.13 => constants.%.25f +// CHECK:STDOUT: %impl.elem2.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.017 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn.26d +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.018 +// CHECK:STDOUT: %as_type => constants.%tuple.type.6b1 +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.74d +// CHECK:STDOUT: %ptr => constants.%ptr.f19 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.8d9 +// CHECK:STDOUT: %.loc44_29.14 => constants.%.99c +// CHECK:STDOUT: %impl.elem3.loc44_29.2 => constants.%R.as_type.as.Iterate.impl.Next.c8f +// CHECK:STDOUT: %specific_impl_fn.loc44_29.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn.ffd +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.fe4 +// CHECK:STDOUT: %.loc44_29.15 => constants.%.57d +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.8 +// CHECK:STDOUT: %impl.elem0.loc44_29.2 => constants.%Destroy.Op.2dd605.8 +// CHECK:STDOUT: %specific_impl_fn.loc44_29.6 => constants.%Destroy.Op.2dd605.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adl_return_same_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] +// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %T.4e7: %OptionalStorage.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Optional.Get.type.d22: type = fn_type @Optional.Get, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.Get.6fc: %Optional.Get.type.d22 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.498: type = fn_type @Optional.HasValue, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.bf8: %Optional.HasValue.type.498 = struct_value () [symbolic] +// CHECK:STDOUT: %T.cb0: %facet_type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.f8b: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.type.46f: type = fn_type @T.as_type.as.OptionalStorage.impl.Get, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.8c2: %T.as_type.as.OptionalStorage.impl.Get.type.46f = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.type.0ae: type = fn_type @T.as_type.as.OptionalStorage.impl.Has, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.e0f: %T.as_type.as.OptionalStorage.impl.Has.type.0ae = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.type.87a: type = fn_type @T.as_type.as.OptionalStorage.impl.Some, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.898: %T.as_type.as.OptionalStorage.impl.Some.type.87a = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.type.ceb: type = fn_type @T.as_type.as.OptionalStorage.impl.None, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.9dd: %T.as_type.as.OptionalStorage.impl.None.type.ceb = struct_value () [symbolic] +// CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.03d: %facet_type = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %N.fe9: Core.IntLiteral = symbolic_binding N, 0 [symbolic] +// CHECK:STDOUT: %f64.b55: type = class_type @Float, @Float(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.f3c: type = pattern_type %f64.b55 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.2: type = fn_type @Destroy.Op.loc20_47.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.2: %Destroy.Op.type.790b3b.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.2: = custom_witness (%Destroy.Op.2dd605.2), @Destroy [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.125: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N.fe9) [symbolic] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.bfc: %Float.as.Copy.impl.Op.type.125 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.811: = impl_witness imports.%Copy.impl_witness_table.384, @Float.as.Copy.impl(%int_64) [concrete] +// CHECK:STDOUT: %facet_value.b35: %facet_type = facet_value %f64.b55, (%custom_witness.e20f1f.2, %Copy.impl_witness.811) [concrete] +// CHECK:STDOUT: %Iterate_where.type.fd5: type = facet_type <@Iterate where %impl.elem0.03d = %facet_value.b35> [concrete] +// CHECK:STDOUT: %R.706: %Iterate_where.type.fd5 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %R.as_type.8de: type = facet_access_type %R.706 [symbolic] +// CHECK:STDOUT: %pattern_type.4d6: type = pattern_type %R.as_type.8de [symbolic] // CHECK:STDOUT: %CppRangeForIterate.type: type = facet_type <@CppRangeForIterate> [concrete] -// CHECK:STDOUT: %Self.6c6: %CppRangeForIterate.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.056be7.1: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.a331a3.1: %CppRangeForIterate.WithSelf.End.type.056be7.1 = struct_value () [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.753895.1: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.2b31f7.1: %CppRangeForIterate.WithSelf.Begin.type.753895.1 = struct_value () [symbolic] // CHECK:STDOUT: %.Self.10b: %CppRangeForIterate.type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate.assoc_type: type = assoc_entity_type @CppRangeForIterate [concrete] // CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.5bf: = lookup_impl_witness %.Self.10b, @CppRangeForIterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.d47: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element0 [symbolic_self] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.bce: = lookup_impl_witness %impl.elem0.d47, @CppUnsafeDeref [symbolic_self] +// CHECK:STDOUT: %impl.elem0.c87: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.bce, element0 [symbolic_self] // CHECK:STDOUT: %impl.elem1.846: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element1 [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem1.846 impls @Destroy> [concrete] -// CHECK:STDOUT: %R: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] -// CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.26c6ea.2: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %assoc2: %CppRangeForIterate.assoc_type = assoc_entity element2, imports.%Core.import_ref.213 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R, @CppRangeForIterate [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.facet.0d2: %CppRangeForIterate.type = facet_value %R.as_type, (%CppRangeForIterate.lookup_impl_witness.edd1fe.2) [symbolic] -// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem0.d47 impls @Copy and %impl.elem0.d47 impls @CppUnsafeDeref and %impl.elem0.d47 impls @EqWith, @EqWith(%impl.elem1.846) and %impl.elem0.d47 impls @Inc and %impl.elem0.c87 impls @Destroy and %impl.elem0.c87 impls @Copy and %impl.elem1.846 impls @Destroy and %impl.elem1.846 impls @Copy> [concrete] +// CHECK:STDOUT: %R.6c6: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R.6c6, @CppRangeForIterate [symbolic] // CHECK:STDOUT: %impl.elem1.bdcd2d.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element1 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.57e: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.04d: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %.b85: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.57e, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem2: %.b85 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c0f: = specific_impl_function %impl.elem2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %assoc3: %CppRangeForIterate.assoc_type = assoc_entity element3, imports.%Core.import_ref.730 [concrete] -// CHECK:STDOUT: %.b40: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.04d, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem3: %.b40 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.d6a: = specific_impl_function %impl.elem3, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.a8f: = lookup_impl_witness %impl.elem1.bdcd2d.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.543: %Destroy.type = facet_value %impl.elem1.bdcd2d.2, (%Destroy.lookup_impl_witness.a8f) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.366: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %.b83: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.366, %Destroy.facet.543 [symbolic] -// CHECK:STDOUT: %impl.elem0.acf: %.b83 = impl_witness_access %Destroy.lookup_impl_witness.a8f, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.add: = specific_impl_function %impl.elem0.acf, @Destroy.WithSelf.Op(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.089: = lookup_impl_witness %impl.elem0.d5966e.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.5e8: %Destroy.type = facet_value %impl.elem0.d5966e.2, (%Destroy.lookup_impl_witness.089) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.7cb: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.5e8) [symbolic] -// CHECK:STDOUT: %.a68: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.7cb, %Destroy.facet.5e8 [symbolic] -// CHECK:STDOUT: %impl.elem0.f59: %.a68 = impl_witness_access %Destroy.lookup_impl_witness.089, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.f06: = specific_impl_function %impl.elem0.f59, @Destroy.WithSelf.Op(%Destroy.facet.5e8) [symbolic] -// CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] -// CHECK:STDOUT: %pattern_type.80f: type = pattern_type %MutableRange [concrete] +// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.384: type = tuple_type (%impl.elem0.d5966e.2, %impl.elem1.bdcd2d.2) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.0ba: = lookup_impl_witness %tuple.type.384, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.2fe: %Destroy.type = facet_value %tuple.type.384, (%Destroy.lookup_impl_witness.0ba) [symbolic] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.ca4: = lookup_impl_witness %impl.elem0.d5966e.2, @CppUnsafeDeref [symbolic] +// CHECK:STDOUT: %impl.elem0.b10: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.ca4, element0 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.3d8: = lookup_impl_witness %impl.elem0.b10, @Destroy [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.bff: = lookup_impl_witness %impl.elem0.b10, @Copy [symbolic] +// CHECK:STDOUT: %facet_value.a30: %facet_type = facet_value %impl.elem0.b10, (%Destroy.lookup_impl_witness.3d8, %Copy.lookup_impl_witness.bff) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.5b5: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.cd2: %R.as_type.as.Iterate.impl.Next.type.5b5 = struct_value () [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.9b6: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.b29: %R.as_type.as.Iterate.impl.NewCursor.type.9b6 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.97c: = lookup_impl_witness %R.706, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.564: %Iterate.type = facet_value %R.as_type.8de, (%Iterate.lookup_impl_witness.97c) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.95b: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.31d: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %.937: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.95b, %Iterate.facet.564 [symbolic] +// CHECK:STDOUT: %impl.elem2.fdc: %.937 = impl_witness_access %Iterate.lookup_impl_witness.97c, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.46d: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.97c, element1 [symbolic] +// CHECK:STDOUT: %as_type.e0d: type = facet_access_type %impl.elem1.46d [symbolic] +// CHECK:STDOUT: %specific_impl_fn.a2c: = specific_impl_function %impl.elem2.fdc, @Iterate.WithSelf.NewCursor(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %ptr.678: type = ptr_type %as_type.e0d [symbolic] +// CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.31d, %Iterate.facet.564 [symbolic] +// CHECK:STDOUT: %impl.elem3.5cd: %.b70 = impl_witness_access %Iterate.lookup_impl_witness.97c, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.d02: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.b35) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.4b5: = impl_witness imports.%OptionalStorage.impl_witness_table.6f7, @T.as_type.as.OptionalStorage.impl(%facet_value.b35) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.fd4: %OptionalStorage.type = facet_value %f64.b55, (%OptionalStorage.impl_witness.4b5) [concrete] +// CHECK:STDOUT: %Optional.249: type = class_type @Optional, @Optional(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %specific_impl_fn.e20: = specific_impl_function %impl.elem3.5cd, @Iterate.WithSelf.Next(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.e04: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %Optional.HasValue.69e: %Optional.HasValue.type.e04 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.941: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %Optional.Get.8ce: %Optional.Get.type.941 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.169: %Destroy.type = facet_value %f64.b55, (%custom_witness.e20f1f.2) [concrete] +// CHECK:STDOUT: %MaybeUnformed.bf7: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.169) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.ec9: type = struct_type {.value: %MaybeUnformed.bf7, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.69e, @Optional.HasValue(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.8ce, @Optional.Get(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %AddAssignWith.type.f8a: type = facet_type <@AddAssignWith, @AddAssignWith(%f64.b55)> [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.type.4cd: type = fn_type @Float.as.AddAssignWith.impl.Op, @Float.as.AddAssignWith.impl(%N.fe9) [symbolic] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.ec5: %Float.as.AddAssignWith.impl.Op.type.4cd = struct_value () [symbolic] +// CHECK:STDOUT: %AddAssignWith.impl_witness.4c6: = impl_witness imports.%AddAssignWith.impl_witness_table, @Float.as.AddAssignWith.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.type.db3: type = fn_type @Float.as.AddAssignWith.impl.Op, @Float.as.AddAssignWith.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.ba4: %Float.as.AddAssignWith.impl.Op.type.db3 = struct_value () [concrete] +// CHECK:STDOUT: %AddAssignWith.facet: %AddAssignWith.type.f8a = facet_value %f64.b55, (%AddAssignWith.impl_witness.4c6) [concrete] +// CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.aab: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%f64.b55, %AddAssignWith.facet) [concrete] +// CHECK:STDOUT: %.8cc: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.aab, %AddAssignWith.facet [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Float.as.AddAssignWith.impl.Op.ba4, @Float.as.AddAssignWith.impl.Op(%int_64) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.8: type = fn_type @Destroy.Op.loc24_19.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.8: %Destroy.Op.type.790b3b.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.56d: = lookup_impl_witness %impl.elem1.46d, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.19e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.46d) [symbolic] +// CHECK:STDOUT: %.fb1: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.19e, %impl.elem1.46d [symbolic] +// CHECK:STDOUT: %impl.elem0.648: %.fb1 = impl_witness_access %Destroy.lookup_impl_witness.56d, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.05c: = specific_impl_function %impl.elem0.648, @Destroy.WithSelf.Op(%impl.elem1.46d) [symbolic] // CHECK:STDOUT: %ConstRange: type = class_type @ConstRange [concrete] // CHECK:STDOUT: %pattern_type.88d: type = pattern_type %ConstRange [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Iterator.b8c: type = class_type @Iterator.1 [concrete] -// CHECK:STDOUT: %Begin.type.793876.1: type = fn_type @Begin.1 [concrete] -// CHECK:STDOUT: %Begin.1544bb.1: %Begin.type.793876.1 = struct_value () [concrete] -// CHECK:STDOUT: %End.type.16398b.1: type = fn_type @End.1 [concrete] -// CHECK:STDOUT: %End.be76e1.1: %End.type.16398b.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.25d: = custom_witness (%Iterator.b8c, %Iterator.b8c, %Begin.1544bb.1, %End.be76e1.1), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.5b0: %CppRangeForIterate.type = facet_value %MutableRange, (%custom_witness.25d) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.910: type = fn_type @Iterator.Op.1 [concrete] -// CHECK:STDOUT: %Iterator.Op.cbb: %Iterator.Op.type.910 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.fe6: = custom_witness (%Iterator.Op.cbb), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.589: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.25d, %custom_witness.fe6) [concrete] -// CHECK:STDOUT: %Iterator.080: type = class_type @Iterator.2 [concrete] -// CHECK:STDOUT: %Begin.type.793876.2: type = fn_type @Begin.2 [concrete] -// CHECK:STDOUT: %Begin.1544bb.2: %Begin.type.793876.2 = struct_value () [concrete] -// CHECK:STDOUT: %End.type.16398b.2: type = fn_type @End.2 [concrete] -// CHECK:STDOUT: %End.be76e1.2: %End.type.16398b.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.4c3: = custom_witness (%Iterator.080, %Iterator.080, %Begin.1544bb.2, %End.be76e1.2), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.379: %CppRangeForIterate.type = facet_value %ConstRange, (%custom_witness.4c3) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.587: type = fn_type @Iterator.Op.2 [concrete] -// CHECK:STDOUT: %Iterator.Op.dc6: %Iterator.Op.type.587 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.166: = custom_witness (%Iterator.Op.dc6), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.105: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.4c3, %custom_witness.166) [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.901: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.5b0) [concrete] -// CHECK:STDOUT: %.8fa: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.901, %CppRangeForIterate.facet.5b0 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.3a5: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.5b0) [concrete] -// CHECK:STDOUT: %.374: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.3a5, %CppRangeForIterate.facet.5b0 [concrete] -// CHECK:STDOUT: %Destroy.facet.6ae: %Destroy.type = facet_value %Iterator.b8c, (%custom_witness.fe6) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.018: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.6ae) [concrete] -// CHECK:STDOUT: %.e53: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.018, %Destroy.facet.6ae [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.b5c: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.379) [concrete] -// CHECK:STDOUT: %.093: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.b5c, %CppRangeForIterate.facet.379 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.735: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.379) [concrete] -// CHECK:STDOUT: %.e31: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.735, %CppRangeForIterate.facet.379 [concrete] -// CHECK:STDOUT: %Destroy.facet.488: %Destroy.type = facet_value %Iterator.080, (%custom_witness.166) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.488: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.488) [concrete] -// CHECK:STDOUT: %.8da: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.488, %Destroy.facet.488 [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Iterator: type = class_type @Iterator.1 [concrete] +// CHECK:STDOUT: %Begin.type: type = fn_type @Begin [concrete] +// CHECK:STDOUT: %Begin: %Begin.type = struct_value () [concrete] +// CHECK:STDOUT: %End.type: type = fn_type @End [concrete] +// CHECK:STDOUT: %End: %End.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.4c3: = custom_witness (%Iterator, %Iterator, %Begin, %End), @CppRangeForIterate [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.1: type = fn_type @Iterator.Op.1 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.1: %Iterator.Op.type.587642.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e59: = custom_witness (%f64.b55, %Iterator.Op.dc644c.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.2: type = fn_type @Iterator.Op.2 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.2: %Iterator.Op.type.587642.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.166: = custom_witness (%Iterator.Op.dc644c.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.3: type = fn_type @Iterator.Op.3 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.3: %Iterator.Op.type.587642.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b36: = custom_witness (%Iterator.Op.dc644c.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] +// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] +// CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.832: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Iterator) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.4: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.4: %Iterator.Op.type.587642.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8ca: = custom_witness (%Iterator.Op.dc644c.4), @Inc [concrete] +// CHECK:STDOUT: %facet_value.17b: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.e20f1f.2, %Copy.impl_witness.811, %custom_witness.4c3, %custom_witness.166, %custom_witness.b36, %custom_witness.e59, %custom_witness.832, %custom_witness.8ca) [concrete] +// CHECK:STDOUT: %tuple.type.d7d: type = tuple_type (%Iterator, %Iterator) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.9: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.9: %Destroy.Op.type.790b3b.9 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.9: = custom_witness (%Destroy.Op.2dd605.9), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.57a: %Destroy.type = facet_value %tuple.type.d7d, (%custom_witness.e20f1f.9) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.d7d: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.17b) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.26a: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.17b) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.51f: %R.as_type.as.Iterate.impl.NewCursor.type.26a = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.d6c: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.17b) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.753: %R.as_type.as.Iterate.impl.Next.type.d6c = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.946: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.d7d) [concrete] +// CHECK:STDOUT: %facet_value.7f4: %Iterate_where.type.fd5 = facet_value %ConstRange, (%Iterate.impl_witness.d7d) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.aba: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.946) [concrete] +// CHECK:STDOUT: %.35d: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.aba, %Iterate.facet.946 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %R.as_type.as.Iterate.impl.NewCursor.51f, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.17b) [concrete] +// CHECK:STDOUT: %complete_type.a15: = complete_type_witness %tuple.type.d7d [concrete] +// CHECK:STDOUT: %ptr.365: type = ptr_type %tuple.type.d7d [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.eee: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.946) [concrete] +// CHECK:STDOUT: %.828: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.eee, %Iterate.facet.946 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %R.as_type.as.Iterate.impl.Next.753, @R.as_type.as.Iterate.impl.Next(%facet_value.17b) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.286: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.57a) [concrete] +// CHECK:STDOUT: %.2ef: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.286, %Destroy.facet.57a [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.735: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] -// CHECK:STDOUT: %Core.import_ref.572: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc3] -// CHECK:STDOUT: %Core.import_ref.213: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin.type (%CppRangeForIterate.WithSelf.Begin.type.753895.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin (constants.%CppRangeForIterate.WithSelf.Begin.2b31f7.1)] -// CHECK:STDOUT: %Core.import_ref.730: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End.type (%CppRangeForIterate.WithSelf.End.type.056be7.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End (constants.%CppRangeForIterate.WithSelf.End.a331a3.1)] +// CHECK:STDOUT: %Core.import_ref.0b9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.498) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.bf8)] +// CHECK:STDOUT: %Core.import_ref.61f: @Optional.%Optional.Get.type (%Optional.Get.type.d22) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.6fc)] +// CHECK:STDOUT: %Core.import_ref.2b5: type = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%DefaultOptionalStorage (constants.%DefaultOptionalStorage.f8b)] +// CHECK:STDOUT: %Core.import_ref.b0a: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None.type (%T.as_type.as.OptionalStorage.impl.None.type.ceb) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None (constants.%T.as_type.as.OptionalStorage.impl.None.9dd)] +// CHECK:STDOUT: %Core.import_ref.3fc: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some.type (%T.as_type.as.OptionalStorage.impl.Some.type.87a) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some (constants.%T.as_type.as.OptionalStorage.impl.Some.898)] +// CHECK:STDOUT: %Core.import_ref.986: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has.type (%T.as_type.as.OptionalStorage.impl.Has.type.0ae) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has (constants.%T.as_type.as.OptionalStorage.impl.Has.e0f)] +// CHECK:STDOUT: %Core.import_ref.557: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get.type (%T.as_type.as.OptionalStorage.impl.Get.type.46f) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get (constants.%T.as_type.as.OptionalStorage.impl.Get.8c2)] +// CHECK:STDOUT: %Core.import_ref.999 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %OptionalStorage.impl_witness_table.6f7 = impl_witness_table (%Core.import_ref.2b5, %Core.import_ref.b0a, %Core.import_ref.3fc, %Core.import_ref.986, %Core.import_ref.557, %Core.import_ref.999), @T.as_type.as.OptionalStorage.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.461: @Float.as.Copy.impl.%Float.as.Copy.impl.Op.type (%Float.as.Copy.impl.Op.type.125) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Float.as.Copy.impl.%Float.as.Copy.impl.Op (constants.%Float.as.Copy.impl.Op.bfc)] +// CHECK:STDOUT: %Copy.impl_witness_table.384 = impl_witness_table (%Core.import_ref.461), @Float.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.89a: %facet_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%facet_value (constants.%facet_value.a30)] +// CHECK:STDOUT: %Core.import_ref.9ea: %Destroy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%Destroy.facet (constants.%Destroy.facet.2fe)] +// CHECK:STDOUT: %Core.import_ref.a6c: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor.type (%R.as_type.as.Iterate.impl.NewCursor.type.9b6) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor (constants.%R.as_type.as.Iterate.impl.NewCursor.b29)] +// CHECK:STDOUT: %Core.import_ref.a02: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next.type (%R.as_type.as.Iterate.impl.Next.type.5b5) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next (constants.%R.as_type.as.Iterate.impl.Next.cd2)] +// CHECK:STDOUT: %Iterate.impl_witness_table.9f0 = impl_witness_table (%Core.import_ref.89a, %Core.import_ref.9ea, %Core.import_ref.a6c, %Core.import_ref.a02), @R.as_type.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.c81: @Float.as.AddAssignWith.impl.%Float.as.AddAssignWith.impl.Op.type (%Float.as.AddAssignWith.impl.Op.type.4cd) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Float.as.AddAssignWith.impl.%Float.as.AddAssignWith.impl.Op (constants.%Float.as.AddAssignWith.impl.Op.ec5)] +// CHECK:STDOUT: %AddAssignWith.impl_witness_table = impl_witness_table (%Core.import_ref.c81), @Float.as.AddAssignWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Test(%R.loc32_10.2: %CppRangeForIterate_where.type) { +// CHECK:STDOUT: generic fn @Test(%R.loc20_10.2: %Iterate_where.type.fd5) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness: = lookup_impl_witness %R.loc32_10.1, @CppRangeForIterate [symbolic = %CppRangeForIterate.lookup_impl_witness (constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2)] -// CHECK:STDOUT: %CppRangeForIterate.facet: %CppRangeForIterate.type = facet_value %R.as_type.loc32_113.1, (%CppRangeForIterate.lookup_impl_witness) [symbolic = %CppRangeForIterate.facet (constants.%CppRangeForIterate.facet.0d2)] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.Begin.type (constants.%CppRangeForIterate.WithSelf.Begin.type.57e)] -// CHECK:STDOUT: %.loc34_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type, %CppRangeForIterate.facet [symbolic = %.loc34_4 (constants.%.b85)] -// CHECK:STDOUT: %impl.elem2.loc34_4.2: @Test.%.loc34_4 (%.b85) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %specific_impl_fn.loc34_4.2: = specific_impl_function %impl.elem2.loc34_4.2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.c0f)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc20_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.97c)] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc20_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.564)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.95b)] +// CHECK:STDOUT: %.loc24_19.12: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc24_19.12 (constants.%.937)] +// CHECK:STDOUT: %impl.elem2.loc24_19.2: @Test.%.loc24_19.12 (%.937) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.fdc)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.4: = specific_impl_function %impl.elem2.loc24_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.a2c)] // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.End.type (constants.%CppRangeForIterate.WithSelf.End.type.04d)] -// CHECK:STDOUT: %.loc35_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type, %CppRangeForIterate.facet [symbolic = %.loc35_4 (constants.%.b40)] -// CHECK:STDOUT: %impl.elem3.loc35_4.2: @Test.%.loc35_4 (%.b40) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc35_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %specific_impl_fn.loc35_4.2: = specific_impl_function %impl.elem3.loc35_4.2, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc35_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc35: = lookup_impl_witness %impl.elem1.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc35 (constants.%Destroy.lookup_impl_witness.a8f)] -// CHECK:STDOUT: %Destroy.facet.loc35: %Destroy.type = facet_value %impl.elem1.1, (%Destroy.lookup_impl_witness.loc35) [symbolic = %Destroy.facet.loc35 (constants.%Destroy.facet.543)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc35: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc35) [symbolic = %Destroy.WithSelf.Op.type.loc35 (constants.%Destroy.WithSelf.Op.type.366)] -// CHECK:STDOUT: %.loc35_9.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc35, %Destroy.facet.loc35 [symbolic = %.loc35_9.3 (constants.%.b83)] -// CHECK:STDOUT: %impl.elem0.loc35_9.2: @Test.%.loc35_9.3 (%.b83) = impl_witness_access %Destroy.lookup_impl_witness.loc35, element0 [symbolic = %impl.elem0.loc35_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %specific_impl_fn.loc35_9.2: = specific_impl_function %impl.elem0.loc35_9.2, @Destroy.WithSelf.Op(%Destroy.facet.loc35) [symbolic = %specific_impl_fn.loc35_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc34: = lookup_impl_witness %impl.elem0.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc34 (constants.%Destroy.lookup_impl_witness.089)] -// CHECK:STDOUT: %Destroy.facet.loc34: %Destroy.type = facet_value %impl.elem0.1, (%Destroy.lookup_impl_witness.loc34) [symbolic = %Destroy.facet.loc34 (constants.%Destroy.facet.5e8)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc34: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc34) [symbolic = %Destroy.WithSelf.Op.type.loc34 (constants.%Destroy.WithSelf.Op.type.7cb)] -// CHECK:STDOUT: %.loc34_11.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc34, %Destroy.facet.loc34 [symbolic = %.loc34_11.3 (constants.%.a68)] -// CHECK:STDOUT: %impl.elem0.loc34_11.2: @Test.%.loc34_11.3 (%.a68) = impl_witness_access %Destroy.lookup_impl_witness.loc34, element0 [symbolic = %impl.elem0.loc34_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %specific_impl_fn.loc34_11.2: = specific_impl_function %impl.elem0.loc34_11.2, @Destroy.WithSelf.Op(%Destroy.facet.loc34) [symbolic = %specific_impl_fn.loc34_11.2 (constants.%specific_impl_fn.f06)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.678)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.31d)] +// CHECK:STDOUT: %.loc24_19.13: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc24_19.13 (constants.%.b70)] +// CHECK:STDOUT: %impl.elem3.loc24_19.2: @Test.%.loc24_19.13 (%.b70) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.5cd)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.5: = specific_impl_function %impl.elem3.loc24_19.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.e20)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.19e)] +// CHECK:STDOUT: %.loc24_19.14: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc24_19.14 (constants.%.fb1)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.56d)] +// CHECK:STDOUT: %impl.elem0.loc24_19.2: @Test.%.loc24_19.14 (%.fb1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.648)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.6: = specific_impl_function %impl.elem0.loc24_19.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.05c)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%r.param: ref @Test.%R.as_type.loc32_113.1 (%R.as_type)) { +// CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc20_55.1 (%R.as_type.8de)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %r.ref.loc34: ref @Test.%R.as_type.loc32_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %Begin.ref: %CppRangeForIterate.assoc_type = name_ref Begin, imports.%Core.import_ref.735 [concrete = constants.%assoc2] -// CHECK:STDOUT: %impl.elem2.loc34_4.1: @Test.%.loc34_4 (%.b85) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic = %impl.elem2.loc34_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %bound_method.loc34_4: = bound_method %r.ref.loc34, %impl.elem2.loc34_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc34_4.1: = specific_impl_function %impl.elem2.loc34_4.1, @CppRangeForIterate.WithSelf.Begin(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.c0f)] -// CHECK:STDOUT: %bound_method.loc34_11.1: = bound_method %r.ref.loc34, %specific_impl_fn.loc34_4.1 -// CHECK:STDOUT: %.loc34_11.1: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.call: init @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) to %.loc34_11.1 = call %bound_method.loc34_11.1(%r.ref.loc34) -// CHECK:STDOUT: %.loc34_11.2: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary %.loc34_11.1, %CppRangeForIterate.WithSelf.Begin.call -// CHECK:STDOUT: %r.ref.loc35: ref @Test.%R.as_type.loc32_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %End.ref: %CppRangeForIterate.assoc_type = name_ref End, imports.%Core.import_ref.572 [concrete = constants.%assoc3] -// CHECK:STDOUT: %impl.elem3.loc35_4.1: @Test.%.loc35_4 (%.b40) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic = %impl.elem3.loc35_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %bound_method.loc35_4: = bound_method %r.ref.loc35, %impl.elem3.loc35_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc35_4.1: = specific_impl_function %impl.elem3.loc35_4.1, @CppRangeForIterate.WithSelf.End(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc35_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: %bound_method.loc35_9.1: = bound_method %r.ref.loc35, %specific_impl_fn.loc35_4.1 -// CHECK:STDOUT: %.loc35_9.1: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.call: init @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) to %.loc35_9.1 = call %bound_method.loc35_9.1(%r.ref.loc35) -// CHECK:STDOUT: %.loc35_9.2: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary %.loc35_9.1, %CppRangeForIterate.WithSelf.End.call -// CHECK:STDOUT: %impl.elem0.loc35_9.1: @Test.%.loc35_9.3 (%.b83) = impl_witness_access constants.%Destroy.lookup_impl_witness.a8f, element0 [symbolic = %impl.elem0.loc35_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %bound_method.loc35_9.2: = bound_method %.loc35_9.2, %impl.elem0.loc35_9.1 -// CHECK:STDOUT: %specific_impl_fn.loc35_9.1: = specific_impl_function %impl.elem0.loc35_9.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.543) [symbolic = %specific_impl_fn.loc35_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %bound_method.loc35_9.3: = bound_method %.loc35_9.2, %specific_impl_fn.loc35_9.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc35: init %empty_tuple.type = call %bound_method.loc35_9.3(%.loc35_9.2) -// CHECK:STDOUT: %impl.elem0.loc34_11.1: @Test.%.loc34_11.3 (%.a68) = impl_witness_access constants.%Destroy.lookup_impl_witness.089, element0 [symbolic = %impl.elem0.loc34_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %bound_method.loc34_11.2: = bound_method %.loc34_11.2, %impl.elem0.loc34_11.1 -// CHECK:STDOUT: %specific_impl_fn.loc34_11.1: = specific_impl_function %impl.elem0.loc34_11.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.5e8) [symbolic = %specific_impl_fn.loc34_11.2 (constants.%specific_impl_fn.f06)] -// CHECK:STDOUT: %bound_method.loc34_11.3: = bound_method %.loc34_11.2, %specific_impl_fn.loc34_11.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34: init %empty_tuple.type = call %bound_method.loc34_11.3(%.loc34_11.2) +// CHECK:STDOUT: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.f3c = value_binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc20_55.1 (%R.as_type.8de) = name_ref r, %r +// CHECK:STDOUT: %impl.elem2.loc24_19.1: @Test.%.loc24_19.12 (%.937) = impl_witness_access constants.%Iterate.lookup_impl_witness.97c, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.fdc)] +// CHECK:STDOUT: %bound_method.loc24_19.1: = bound_method %r.ref, %impl.elem2.loc24_19.1 +// CHECK:STDOUT: %specific_impl_fn.loc24_19.1: = specific_impl_function %impl.elem2.loc24_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.564) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.a2c)] +// CHECK:STDOUT: %bound_method.loc24_19.2: = bound_method %r.ref, %specific_impl_fn.loc24_19.1 +// CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.e0d) = var invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @Test.%as_type (%as_type.e0d) to %var = call %bound_method.loc24_19.2(%r.ref) +// CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.next: +// CHECK:STDOUT: %addr: @Test.%ptr (%ptr.678) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc24_19.1: @Test.%.loc24_19.13 (%.b70) = impl_witness_access constants.%Iterate.lookup_impl_witness.97c, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.5cd)] +// CHECK:STDOUT: %bound_method.loc24_19.3: = bound_method %r.ref, %impl.elem3.loc24_19.1 +// CHECK:STDOUT: %.loc24_19.1: %Destroy.type = converted constants.%as_type.e0d, constants.%impl.elem1.46d [symbolic = %impl.elem1 (constants.%impl.elem1.46d)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.2: = specific_impl_function %impl.elem3.loc24_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.564) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.e20)] +// CHECK:STDOUT: %bound_method.loc24_19.4: = bound_method %r.ref, %specific_impl_fn.loc24_19.2 +// CHECK:STDOUT: %.loc24_19.2: ref %Optional.249 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.249 to %.loc24_19.2 = call %bound_method.loc24_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc24_19.3: ref %Optional.249 = temporary %.loc24_19.2, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc24_19.4: %Optional.HasValue.type.e04 = specific_constant imports.%Core.import_ref.0b9, @Optional(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.HasValue.69e] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.e04 = name_ref HasValue, %.loc24_19.4 [concrete = constants.%Optional.HasValue.69e] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc24_19.3, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_19.5: = bound_method %.loc24_19.3, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc24_19.5: %Optional.249 = acquire_value %.loc24_19.3 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc24_19.5(%.loc24_19.5) +// CHECK:STDOUT: %.loc24_19.6: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc24_19.7: bool = converted %Optional.HasValue.call, %.loc24_19.6 +// CHECK:STDOUT: if %.loc24_19.7 br !for.body else br !for.done +// CHECK:STDOUT: +// CHECK:STDOUT: !for.body: +// CHECK:STDOUT: %.loc24_19.8: %Optional.Get.type.941 = specific_constant imports.%Core.import_ref.61f, @Optional(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.Get.8ce] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.941 = name_ref Get, %.loc24_19.8 [concrete = constants.%Optional.Get.8ce] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc24_19.3, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc24_19.6: = bound_method %.loc24_19.3, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc24_19.9: %Optional.249 = acquire_value %.loc24_19.3 +// CHECK:STDOUT: %Optional.Get.call: init %f64.b55 = call %bound_method.loc24_19.6(%.loc24_19.9) +// CHECK:STDOUT: %f64.loc24: type = type_literal constants.%f64.b55 [concrete = constants.%f64.b55] +// CHECK:STDOUT: %.loc24_19.10: %f64.b55 = value_of_initializer %Optional.Get.call +// CHECK:STDOUT: %.loc24_19.11: %f64.b55 = converted %Optional.Get.call, %.loc24_19.10 +// CHECK:STDOUT: %i: %f64.b55 = value_binding i, %.loc24_19.11 +// CHECK:STDOUT: %sum.ref: ref %f64.b55 = name_ref sum, %sum +// CHECK:STDOUT: %i.ref: %f64.b55 = name_ref i, %i +// CHECK:STDOUT: %impl.elem0.loc25: %.8cc = impl_witness_access constants.%AddAssignWith.impl_witness.4c6, element0 [concrete = constants.%Float.as.AddAssignWith.impl.Op.ba4] +// CHECK:STDOUT: %bound_method.loc25_9.1: = bound_method %sum.ref, %impl.elem0.loc25 +// CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Float.as.AddAssignWith.impl.Op(constants.%int_64) [concrete = constants.%Float.as.AddAssignWith.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc25_9.2: = bound_method %sum.ref, %specific_fn.loc25 +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc25_9.2(%sum.ref, %i.ref) +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.done: +// CHECK:STDOUT: %Destroy.Op.bound.loc24: = bound_method %.loc24_19.3, constants.%Destroy.Op.2dd605.8 +// CHECK:STDOUT: %Destroy.Op.call.loc24: init %empty_tuple.type = call %Destroy.Op.bound.loc24(%.loc24_19.3) +// CHECK:STDOUT: %impl.elem0.loc24_19.1: @Test.%.loc24_19.14 (%.fb1) = impl_witness_access constants.%Destroy.lookup_impl_witness.56d, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.648)] +// CHECK:STDOUT: %bound_method.loc24_19.7: = bound_method %var, %impl.elem0.loc24_19.1 +// CHECK:STDOUT: %specific_impl_fn.loc24_19.3: = specific_impl_function %impl.elem0.loc24_19.1, @Destroy.WithSelf.Op(constants.%impl.elem1.46d) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.05c)] +// CHECK:STDOUT: %bound_method.loc24_19.8: = bound_method %var, %specific_impl_fn.loc24_19.3 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc24_19.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%R) { -// CHECK:STDOUT: %R.loc32_10.1 => constants.%R -// CHECK:STDOUT: %R.as_type.loc32_113.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.26c6ea.2 +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.1(%self.param: ref %MaybeUnformed.bf7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.589) { -// CHECK:STDOUT: %R.loc32_10.1 => constants.%facet_value.589 -// CHECK:STDOUT: %R.as_type.loc32_113.1 => constants.%MutableRange -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.80f +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.2(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc32 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.25d -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.5b0 -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.901 -// CHECK:STDOUT: %.loc34_4 => constants.%.8fa -// CHECK:STDOUT: %impl.elem2.loc34_4.2 => constants.%Begin.1544bb.1 -// CHECK:STDOUT: %specific_impl_fn.loc34_4.2 => constants.%Begin.1544bb.1 -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.b8c -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.3a5 -// CHECK:STDOUT: %.loc35_4 => constants.%.374 -// CHECK:STDOUT: %impl.elem3.loc35_4.2 => constants.%End.be76e1.1 -// CHECK:STDOUT: %specific_impl_fn.loc35_4.2 => constants.%End.be76e1.1 -// CHECK:STDOUT: %impl.elem1.1 => constants.%Iterator.b8c -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc35 => constants.%custom_witness.fe6 -// CHECK:STDOUT: %Destroy.facet.loc35 => constants.%Destroy.facet.6ae -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc35 => constants.%Destroy.WithSelf.Op.type.018 -// CHECK:STDOUT: %.loc35_9.3 => constants.%.e53 -// CHECK:STDOUT: %impl.elem0.loc35_9.2 => constants.%Iterator.Op.cbb -// CHECK:STDOUT: %specific_impl_fn.loc35_9.2 => constants.%Iterator.Op.cbb -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc34 => constants.%custom_witness.fe6 -// CHECK:STDOUT: %Destroy.facet.loc34 => constants.%Destroy.facet.6ae -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc34 => constants.%Destroy.WithSelf.Op.type.018 -// CHECK:STDOUT: %.loc34_11.3 => constants.%.e53 -// CHECK:STDOUT: %impl.elem0.loc34_11.2 => constants.%Iterator.Op.cbb -// CHECK:STDOUT: %specific_impl_fn.loc34_11.2 => constants.%Iterator.Op.cbb +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.3(%self.param: ref %struct_type.value.has_value.ec9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.105) { -// CHECK:STDOUT: %R.loc32_10.1 => constants.%facet_value.105 -// CHECK:STDOUT: %R.as_type.loc32_113.1 => constants.%ConstRange +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.4(%self.param: ref %DefaultOptionalStorage.d02) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc24_19.5(%self.param: ref %Optional.249) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%R.706) { +// CHECK:STDOUT: %R.loc20_10.1 => constants.%R.706 +// CHECK:STDOUT: %R.as_type.loc20_55.1 => constants.%R.as_type.8de +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.4d6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%facet_value.7f4) { +// CHECK:STDOUT: %R.loc20_10.1 => constants.%facet_value.7f4 +// CHECK:STDOUT: %R.as_type.loc20_55.1 => constants.%ConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.88d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc32 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.4c3 -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.379 -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.b5c -// CHECK:STDOUT: %.loc34_4 => constants.%.093 -// CHECK:STDOUT: %impl.elem2.loc34_4.2 => constants.%Begin.1544bb.2 -// CHECK:STDOUT: %specific_impl_fn.loc34_4.2 => constants.%Begin.1544bb.2 -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.080 -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.735 -// CHECK:STDOUT: %.loc35_4 => constants.%.e31 -// CHECK:STDOUT: %impl.elem3.loc35_4.2 => constants.%End.be76e1.2 -// CHECK:STDOUT: %specific_impl_fn.loc35_4.2 => constants.%End.be76e1.2 -// CHECK:STDOUT: %impl.elem1.1 => constants.%Iterator.080 -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc35 => constants.%custom_witness.166 -// CHECK:STDOUT: %Destroy.facet.loc35 => constants.%Destroy.facet.488 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc35 => constants.%Destroy.WithSelf.Op.type.488 -// CHECK:STDOUT: %.loc35_9.3 => constants.%.8da -// CHECK:STDOUT: %impl.elem0.loc35_9.2 => constants.%Iterator.Op.dc6 -// CHECK:STDOUT: %specific_impl_fn.loc35_9.2 => constants.%Iterator.Op.dc6 -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc34 => constants.%custom_witness.166 -// CHECK:STDOUT: %Destroy.facet.loc34 => constants.%Destroy.facet.488 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc34 => constants.%Destroy.WithSelf.Op.type.488 -// CHECK:STDOUT: %.loc34_11.3 => constants.%.8da -// CHECK:STDOUT: %impl.elem0.loc34_11.2 => constants.%Iterator.Op.dc6 -// CHECK:STDOUT: %specific_impl_fn.loc34_11.2 => constants.%Iterator.Op.dc6 +// CHECK:STDOUT: %require_complete.loc20 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.d7d +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.946 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.aba +// CHECK:STDOUT: %.loc24_19.12 => constants.%.35d +// CHECK:STDOUT: %impl.elem2.loc24_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.51f +// CHECK:STDOUT: %specific_impl_fn.loc24_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.57a +// CHECK:STDOUT: %as_type => constants.%tuple.type.d7d +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.a15 +// CHECK:STDOUT: %ptr => constants.%ptr.365 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.eee +// CHECK:STDOUT: %.loc24_19.13 => constants.%.828 +// CHECK:STDOUT: %impl.elem3.loc24_19.2 => constants.%R.as_type.as.Iterate.impl.Next.753 +// CHECK:STDOUT: %specific_impl_fn.loc24_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.286 +// CHECK:STDOUT: %.loc24_19.14 => constants.%.2ef +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.9 +// CHECK:STDOUT: %impl.elem0.loc24_19.2 => constants.%Destroy.Op.2dd605.9 +// CHECK:STDOUT: %specific_impl_fn.loc24_19.6 => constants.%Destroy.Op.2dd605.9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_todo_adl_returns_same_types_mutable.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] +// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %T.4e7: %OptionalStorage.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Optional.Get.type.d22: type = fn_type @Optional.Get, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.Get.6fc: %Optional.Get.type.d22 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.498: type = fn_type @Optional.HasValue, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.bf8: %Optional.HasValue.type.498 = struct_value () [symbolic] +// CHECK:STDOUT: %T.cb0: %facet_type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.f8b: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.type.46f: type = fn_type @T.as_type.as.OptionalStorage.impl.Get, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.8c2: %T.as_type.as.OptionalStorage.impl.Get.type.46f = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.type.0ae: type = fn_type @T.as_type.as.OptionalStorage.impl.Has, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.e0f: %T.as_type.as.OptionalStorage.impl.Has.type.0ae = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.type.87a: type = fn_type @T.as_type.as.OptionalStorage.impl.Some, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.898: %T.as_type.as.OptionalStorage.impl.Some.type.87a = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.type.ceb: type = fn_type @T.as_type.as.OptionalStorage.impl.None, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.9dd: %T.as_type.as.OptionalStorage.impl.None.type.ceb = struct_value () [symbolic] +// CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.03d: %facet_type = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %N.fe9: Core.IntLiteral = symbolic_binding N, 0 [symbolic] +// CHECK:STDOUT: %f64.b55: type = class_type @Float, @Float(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.f3c: type = pattern_type %f64.b55 [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.2: type = fn_type @Destroy.Op.loc22_47.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.2: %Destroy.Op.type.790b3b.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.2: = custom_witness (%Destroy.Op.2dd605.2), @Destroy [concrete] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.type.125: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N.fe9) [symbolic] +// CHECK:STDOUT: %Float.as.Copy.impl.Op.bfc: %Float.as.Copy.impl.Op.type.125 = struct_value () [symbolic] +// CHECK:STDOUT: %Copy.impl_witness.811: = impl_witness imports.%Copy.impl_witness_table.384, @Float.as.Copy.impl(%int_64) [concrete] +// CHECK:STDOUT: %facet_value.b35: %facet_type = facet_value %f64.b55, (%custom_witness.e20f1f.2, %Copy.impl_witness.811) [concrete] +// CHECK:STDOUT: %Iterate_where.type.fd5: type = facet_type <@Iterate where %impl.elem0.03d = %facet_value.b35> [concrete] +// CHECK:STDOUT: %R.706: %Iterate_where.type.fd5 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %R.as_type.8de: type = facet_access_type %R.706 [symbolic] +// CHECK:STDOUT: %pattern_type.4d6: type = pattern_type %R.as_type.8de [symbolic] +// CHECK:STDOUT: %CppRangeForIterate.type: type = facet_type <@CppRangeForIterate> [concrete] +// CHECK:STDOUT: %.Self.10b: %CppRangeForIterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.5bf: = lookup_impl_witness %.Self.10b, @CppRangeForIterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.d47: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element0 [symbolic_self] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.bce: = lookup_impl_witness %impl.elem0.d47, @CppUnsafeDeref [symbolic_self] +// CHECK:STDOUT: %impl.elem0.c87: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.bce, element0 [symbolic_self] +// CHECK:STDOUT: %impl.elem1.846: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element1 [symbolic_self] +// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem0.d47 impls @Copy and %impl.elem0.d47 impls @CppUnsafeDeref and %impl.elem0.d47 impls @EqWith, @EqWith(%impl.elem1.846) and %impl.elem0.d47 impls @Inc and %impl.elem0.c87 impls @Destroy and %impl.elem0.c87 impls @Copy and %impl.elem1.846 impls @Destroy and %impl.elem1.846 impls @Copy> [concrete] +// CHECK:STDOUT: %R.6c6: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R.6c6, @CppRangeForIterate [symbolic] +// CHECK:STDOUT: %impl.elem1.bdcd2d.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element1 [symbolic] +// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.384: type = tuple_type (%impl.elem0.d5966e.2, %impl.elem1.bdcd2d.2) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.0ba: = lookup_impl_witness %tuple.type.384, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.2fe: %Destroy.type = facet_value %tuple.type.384, (%Destroy.lookup_impl_witness.0ba) [symbolic] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.ca4: = lookup_impl_witness %impl.elem0.d5966e.2, @CppUnsafeDeref [symbolic] +// CHECK:STDOUT: %impl.elem0.b10: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.ca4, element0 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.3d8: = lookup_impl_witness %impl.elem0.b10, @Destroy [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.bff: = lookup_impl_witness %impl.elem0.b10, @Copy [symbolic] +// CHECK:STDOUT: %facet_value.a30: %facet_type = facet_value %impl.elem0.b10, (%Destroy.lookup_impl_witness.3d8, %Copy.lookup_impl_witness.bff) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.5b5: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.cd2: %R.as_type.as.Iterate.impl.Next.type.5b5 = struct_value () [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.9b6: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.b29: %R.as_type.as.Iterate.impl.NewCursor.type.9b6 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.97c: = lookup_impl_witness %R.706, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.564: %Iterate.type = facet_value %R.as_type.8de, (%Iterate.lookup_impl_witness.97c) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.95b: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.31d: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %.937: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.95b, %Iterate.facet.564 [symbolic] +// CHECK:STDOUT: %impl.elem2.fdc: %.937 = impl_witness_access %Iterate.lookup_impl_witness.97c, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.46d: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.97c, element1 [symbolic] +// CHECK:STDOUT: %as_type.e0d: type = facet_access_type %impl.elem1.46d [symbolic] +// CHECK:STDOUT: %specific_impl_fn.a2c: = specific_impl_function %impl.elem2.fdc, @Iterate.WithSelf.NewCursor(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %ptr.678: type = ptr_type %as_type.e0d [symbolic] +// CHECK:STDOUT: %.b70: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.31d, %Iterate.facet.564 [symbolic] +// CHECK:STDOUT: %impl.elem3.5cd: %.b70 = impl_witness_access %Iterate.lookup_impl_witness.97c, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.d02: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.b35) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.4b5: = impl_witness imports.%OptionalStorage.impl_witness_table.6f7, @T.as_type.as.OptionalStorage.impl(%facet_value.b35) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.fd4: %OptionalStorage.type = facet_value %f64.b55, (%OptionalStorage.impl_witness.4b5) [concrete] +// CHECK:STDOUT: %Optional.249: type = class_type @Optional, @Optional(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %specific_impl_fn.e20: = specific_impl_function %impl.elem3.5cd, @Iterate.WithSelf.Next(%Iterate.facet.564) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.e04: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %Optional.HasValue.69e: %Optional.HasValue.type.e04 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.941: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %Optional.Get.8ce: %Optional.Get.type.941 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.169: %Destroy.type = facet_value %f64.b55, (%custom_witness.e20f1f.2) [concrete] +// CHECK:STDOUT: %MaybeUnformed.bf7: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.169) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.ec9: type = struct_type {.value: %MaybeUnformed.bf7, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.69e, @Optional.HasValue(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.8ce, @Optional.Get(%OptionalStorage.facet.fd4) [concrete] +// CHECK:STDOUT: %AddAssignWith.type.f8a: type = facet_type <@AddAssignWith, @AddAssignWith(%f64.b55)> [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.type.4cd: type = fn_type @Float.as.AddAssignWith.impl.Op, @Float.as.AddAssignWith.impl(%N.fe9) [symbolic] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.ec5: %Float.as.AddAssignWith.impl.Op.type.4cd = struct_value () [symbolic] +// CHECK:STDOUT: %AddAssignWith.impl_witness.4c6: = impl_witness imports.%AddAssignWith.impl_witness_table, @Float.as.AddAssignWith.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.type.db3: type = fn_type @Float.as.AddAssignWith.impl.Op, @Float.as.AddAssignWith.impl(%int_64) [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.ba4: %Float.as.AddAssignWith.impl.Op.type.db3 = struct_value () [concrete] +// CHECK:STDOUT: %AddAssignWith.facet: %AddAssignWith.type.f8a = facet_value %f64.b55, (%AddAssignWith.impl_witness.4c6) [concrete] +// CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.aab: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%f64.b55, %AddAssignWith.facet) [concrete] +// CHECK:STDOUT: %.8cc: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.aab, %AddAssignWith.facet [concrete] +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Float.as.AddAssignWith.impl.Op.ba4, @Float.as.AddAssignWith.impl.Op(%int_64) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.8: type = fn_type @Destroy.Op.loc26_19.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.8: %Destroy.Op.type.790b3b.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.56d: = lookup_impl_witness %impl.elem1.46d, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.19e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.46d) [symbolic] +// CHECK:STDOUT: %.fb1: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.19e, %impl.elem1.46d [symbolic] +// CHECK:STDOUT: %impl.elem0.648: %.fb1 = impl_witness_access %Destroy.lookup_impl_witness.56d, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.05c: = specific_impl_function %impl.elem0.648, @Destroy.WithSelf.Op(%impl.elem1.46d) [symbolic] +// CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] +// CHECK:STDOUT: %pattern_type.80f: type = pattern_type %MutableRange [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %Iterator: type = class_type @Iterator.1 [concrete] +// CHECK:STDOUT: %Begin.type: type = fn_type @Begin [concrete] +// CHECK:STDOUT: %Begin: %Begin.type = struct_value () [concrete] +// CHECK:STDOUT: %End.type: type = fn_type @End [concrete] +// CHECK:STDOUT: %End: %End.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.25d: = custom_witness (%Iterator, %Iterator, %Begin, %End), @CppRangeForIterate [concrete] +// CHECK:STDOUT: %Iterator.Op.type.910736.1: type = fn_type @Iterator.Op.1 [concrete] +// CHECK:STDOUT: %Iterator.Op.cbb479.1: %Iterator.Op.type.910736.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.5e7: = custom_witness (%f64.b55, %Iterator.Op.cbb479.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.910736.2: type = fn_type @Iterator.Op.2 [concrete] +// CHECK:STDOUT: %Iterator.Op.cbb479.2: %Iterator.Op.type.910736.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.fe6: = custom_witness (%Iterator.Op.cbb479.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.910736.3: type = fn_type @Iterator.Op.3 [concrete] +// CHECK:STDOUT: %Iterator.Op.cbb479.3: %Iterator.Op.type.910736.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b9a: = custom_witness (%Iterator.Op.cbb479.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] +// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] +// CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.ab9: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Iterator) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.910736.4: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.cbb479.4: %Iterator.Op.type.910736.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.88b: = custom_witness (%Iterator.Op.cbb479.4), @Inc [concrete] +// CHECK:STDOUT: %facet_value.fbd: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.e20f1f.2, %Copy.impl_witness.811, %custom_witness.25d, %custom_witness.fe6, %custom_witness.b9a, %custom_witness.5e7, %custom_witness.ab9, %custom_witness.88b) [concrete] +// CHECK:STDOUT: %tuple.type.e5c: type = tuple_type (%Iterator, %Iterator) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.9: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.9: %Destroy.Op.type.790b3b.9 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.9: = custom_witness (%Destroy.Op.2dd605.9), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.a02: %Destroy.type = facet_value %tuple.type.e5c, (%custom_witness.e20f1f.9) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.b58: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.fbd) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.efa: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.fbd) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.74e: %R.as_type.as.Iterate.impl.NewCursor.type.efa = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.ddb: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.fbd) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.adb: %R.as_type.as.Iterate.impl.Next.type.ddb = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.7ea: %Iterate.type = facet_value %MutableRange, (%Iterate.impl_witness.b58) [concrete] +// CHECK:STDOUT: %facet_value.459: %Iterate_where.type.fd5 = facet_value %MutableRange, (%Iterate.impl_witness.b58) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.7f2: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.7ea) [concrete] +// CHECK:STDOUT: %.b77: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.7f2, %Iterate.facet.7ea [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %R.as_type.as.Iterate.impl.NewCursor.74e, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.fbd) [concrete] +// CHECK:STDOUT: %complete_type.0e3: = complete_type_witness %tuple.type.e5c [concrete] +// CHECK:STDOUT: %ptr.505: type = ptr_type %tuple.type.e5c [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.8ae: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.7ea) [concrete] +// CHECK:STDOUT: %.8c6: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.8ae, %Iterate.facet.7ea [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %R.as_type.as.Iterate.impl.Next.adb, @R.as_type.as.Iterate.impl.Next(%facet_value.fbd) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.fe8: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.a02) [concrete] +// CHECK:STDOUT: %.9af: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.fe8, %Destroy.facet.a02 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core.import_ref.0b9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.498) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.bf8)] +// CHECK:STDOUT: %Core.import_ref.61f: @Optional.%Optional.Get.type (%Optional.Get.type.d22) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.6fc)] +// CHECK:STDOUT: %Core.import_ref.2b5: type = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%DefaultOptionalStorage (constants.%DefaultOptionalStorage.f8b)] +// CHECK:STDOUT: %Core.import_ref.b0a: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None.type (%T.as_type.as.OptionalStorage.impl.None.type.ceb) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None (constants.%T.as_type.as.OptionalStorage.impl.None.9dd)] +// CHECK:STDOUT: %Core.import_ref.3fc: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some.type (%T.as_type.as.OptionalStorage.impl.Some.type.87a) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some (constants.%T.as_type.as.OptionalStorage.impl.Some.898)] +// CHECK:STDOUT: %Core.import_ref.986: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has.type (%T.as_type.as.OptionalStorage.impl.Has.type.0ae) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has (constants.%T.as_type.as.OptionalStorage.impl.Has.e0f)] +// CHECK:STDOUT: %Core.import_ref.557: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get.type (%T.as_type.as.OptionalStorage.impl.Get.type.46f) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get (constants.%T.as_type.as.OptionalStorage.impl.Get.8c2)] +// CHECK:STDOUT: %Core.import_ref.999 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %OptionalStorage.impl_witness_table.6f7 = impl_witness_table (%Core.import_ref.2b5, %Core.import_ref.b0a, %Core.import_ref.3fc, %Core.import_ref.986, %Core.import_ref.557, %Core.import_ref.999), @T.as_type.as.OptionalStorage.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.461: @Float.as.Copy.impl.%Float.as.Copy.impl.Op.type (%Float.as.Copy.impl.Op.type.125) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Float.as.Copy.impl.%Float.as.Copy.impl.Op (constants.%Float.as.Copy.impl.Op.bfc)] +// CHECK:STDOUT: %Copy.impl_witness_table.384 = impl_witness_table (%Core.import_ref.461), @Float.as.Copy.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.89a: %facet_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%facet_value (constants.%facet_value.a30)] +// CHECK:STDOUT: %Core.import_ref.9ea: %Destroy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%Destroy.facet (constants.%Destroy.facet.2fe)] +// CHECK:STDOUT: %Core.import_ref.a6c: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor.type (%R.as_type.as.Iterate.impl.NewCursor.type.9b6) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor (constants.%R.as_type.as.Iterate.impl.NewCursor.b29)] +// CHECK:STDOUT: %Core.import_ref.a02: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next.type (%R.as_type.as.Iterate.impl.Next.type.5b5) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next (constants.%R.as_type.as.Iterate.impl.Next.cd2)] +// CHECK:STDOUT: %Iterate.impl_witness_table.9f0 = impl_witness_table (%Core.import_ref.89a, %Core.import_ref.9ea, %Core.import_ref.a6c, %Core.import_ref.a02), @R.as_type.as.Iterate.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.c81: @Float.as.AddAssignWith.impl.%Float.as.AddAssignWith.impl.Op.type (%Float.as.AddAssignWith.impl.Op.type.4cd) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Float.as.AddAssignWith.impl.%Float.as.AddAssignWith.impl.Op (constants.%Float.as.AddAssignWith.impl.Op.ec5)] +// CHECK:STDOUT: %AddAssignWith.impl_witness_table = impl_witness_table (%Core.import_ref.c81), @Float.as.AddAssignWith.impl [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Test(%R.loc22_10.2: %Iterate_where.type.fd5) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc22_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.97c)] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc22_55.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.564)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.95b)] +// CHECK:STDOUT: %.loc26_19.12: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc26_19.12 (constants.%.937)] +// CHECK:STDOUT: %impl.elem2.loc26_19.2: @Test.%.loc26_19.12 (%.937) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.fdc)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.4: = specific_impl_function %impl.elem2.loc26_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.a2c)] +// CHECK:STDOUT: +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.678)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.31d)] +// CHECK:STDOUT: %.loc26_19.13: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc26_19.13 (constants.%.b70)] +// CHECK:STDOUT: %impl.elem3.loc26_19.2: @Test.%.loc26_19.13 (%.b70) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.5cd)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.5: = specific_impl_function %impl.elem3.loc26_19.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.e20)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.19e)] +// CHECK:STDOUT: %.loc26_19.14: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc26_19.14 (constants.%.fb1)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.56d)] +// CHECK:STDOUT: %impl.elem0.loc26_19.2: @Test.%.loc26_19.14 (%.fb1) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.648)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.6: = specific_impl_function %impl.elem0.loc26_19.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.05c)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc22_55.1 (%R.as_type.8de)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.f3c = value_binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc22_55.1 (%R.as_type.8de) = name_ref r, %r +// CHECK:STDOUT: %impl.elem2.loc26_19.1: @Test.%.loc26_19.12 (%.937) = impl_witness_access constants.%Iterate.lookup_impl_witness.97c, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.fdc)] +// CHECK:STDOUT: %bound_method.loc26_19.1: = bound_method %r.ref, %impl.elem2.loc26_19.1 +// CHECK:STDOUT: %specific_impl_fn.loc26_19.1: = specific_impl_function %impl.elem2.loc26_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.564) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.a2c)] +// CHECK:STDOUT: %bound_method.loc26_19.2: = bound_method %r.ref, %specific_impl_fn.loc26_19.1 +// CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.e0d) = var invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @Test.%as_type (%as_type.e0d) to %var = call %bound_method.loc26_19.2(%r.ref) +// CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.next: +// CHECK:STDOUT: %addr: @Test.%ptr (%ptr.678) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc26_19.1: @Test.%.loc26_19.13 (%.b70) = impl_witness_access constants.%Iterate.lookup_impl_witness.97c, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.5cd)] +// CHECK:STDOUT: %bound_method.loc26_19.3: = bound_method %r.ref, %impl.elem3.loc26_19.1 +// CHECK:STDOUT: %.loc26_19.1: %Destroy.type = converted constants.%as_type.e0d, constants.%impl.elem1.46d [symbolic = %impl.elem1 (constants.%impl.elem1.46d)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.2: = specific_impl_function %impl.elem3.loc26_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.564) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.e20)] +// CHECK:STDOUT: %bound_method.loc26_19.4: = bound_method %r.ref, %specific_impl_fn.loc26_19.2 +// CHECK:STDOUT: %.loc26_19.2: ref %Optional.249 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.249 to %.loc26_19.2 = call %bound_method.loc26_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc26_19.3: ref %Optional.249 = temporary %.loc26_19.2, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc26_19.4: %Optional.HasValue.type.e04 = specific_constant imports.%Core.import_ref.0b9, @Optional(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.HasValue.69e] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.e04 = name_ref HasValue, %.loc26_19.4 [concrete = constants.%Optional.HasValue.69e] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc26_19.3, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_19.5: = bound_method %.loc26_19.3, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc26_19.5: %Optional.249 = acquire_value %.loc26_19.3 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc26_19.5(%.loc26_19.5) +// CHECK:STDOUT: %.loc26_19.6: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc26_19.7: bool = converted %Optional.HasValue.call, %.loc26_19.6 +// CHECK:STDOUT: if %.loc26_19.7 br !for.body else br !for.done +// CHECK:STDOUT: +// CHECK:STDOUT: !for.body: +// CHECK:STDOUT: %.loc26_19.8: %Optional.Get.type.941 = specific_constant imports.%Core.import_ref.61f, @Optional(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.Get.8ce] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.941 = name_ref Get, %.loc26_19.8 [concrete = constants.%Optional.Get.8ce] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc26_19.3, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.fd4) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc26_19.6: = bound_method %.loc26_19.3, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc26_19.9: %Optional.249 = acquire_value %.loc26_19.3 +// CHECK:STDOUT: %Optional.Get.call: init %f64.b55 = call %bound_method.loc26_19.6(%.loc26_19.9) +// CHECK:STDOUT: %f64.loc26: type = type_literal constants.%f64.b55 [concrete = constants.%f64.b55] +// CHECK:STDOUT: %.loc26_19.10: %f64.b55 = value_of_initializer %Optional.Get.call +// CHECK:STDOUT: %.loc26_19.11: %f64.b55 = converted %Optional.Get.call, %.loc26_19.10 +// CHECK:STDOUT: %i: %f64.b55 = value_binding i, %.loc26_19.11 +// CHECK:STDOUT: %sum.ref: ref %f64.b55 = name_ref sum, %sum +// CHECK:STDOUT: %i.ref: %f64.b55 = name_ref i, %i +// CHECK:STDOUT: %impl.elem0.loc27: %.8cc = impl_witness_access constants.%AddAssignWith.impl_witness.4c6, element0 [concrete = constants.%Float.as.AddAssignWith.impl.Op.ba4] +// CHECK:STDOUT: %bound_method.loc27_9.1: = bound_method %sum.ref, %impl.elem0.loc27 +// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Float.as.AddAssignWith.impl.Op(constants.%int_64) [concrete = constants.%Float.as.AddAssignWith.impl.Op.specific_fn] +// CHECK:STDOUT: %bound_method.loc27_9.2: = bound_method %sum.ref, %specific_fn.loc27 +// CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc27_9.2(%sum.ref, %i.ref) +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.done: +// CHECK:STDOUT: %Destroy.Op.bound.loc26: = bound_method %.loc26_19.3, constants.%Destroy.Op.2dd605.8 +// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call %Destroy.Op.bound.loc26(%.loc26_19.3) +// CHECK:STDOUT: %impl.elem0.loc26_19.1: @Test.%.loc26_19.14 (%.fb1) = impl_witness_access constants.%Destroy.lookup_impl_witness.56d, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.648)] +// CHECK:STDOUT: %bound_method.loc26_19.7: = bound_method %var, %impl.elem0.loc26_19.1 +// CHECK:STDOUT: %specific_impl_fn.loc26_19.3: = specific_impl_function %impl.elem0.loc26_19.1, @Destroy.WithSelf.Op(constants.%impl.elem1.46d) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.05c)] +// CHECK:STDOUT: %bound_method.loc26_19.8: = bound_method %var, %specific_impl_fn.loc26_19.3 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc26_19.8(%var) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.1(%self.param: ref %MaybeUnformed.bf7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.2(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.3(%self.param: ref %struct_type.value.has_value.ec9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.4(%self.param: ref %DefaultOptionalStorage.d02) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc26_19.5(%self.param: ref %Optional.249) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%R.706) { +// CHECK:STDOUT: %R.loc22_10.1 => constants.%R.706 +// CHECK:STDOUT: %R.as_type.loc22_55.1 => constants.%R.as_type.8de +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.4d6 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%facet_value.459) { +// CHECK:STDOUT: %R.loc22_10.1 => constants.%facet_value.459 +// CHECK:STDOUT: %R.as_type.loc22_55.1 => constants.%MutableRange +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.80f +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %require_complete.loc22 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.b58 +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.7ea +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.7f2 +// CHECK:STDOUT: %.loc26_19.12 => constants.%.b77 +// CHECK:STDOUT: %impl.elem2.loc26_19.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.74e +// CHECK:STDOUT: %specific_impl_fn.loc26_19.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.a02 +// CHECK:STDOUT: %as_type => constants.%tuple.type.e5c +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.0e3 +// CHECK:STDOUT: %ptr => constants.%ptr.505 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.8ae +// CHECK:STDOUT: %.loc26_19.13 => constants.%.8c6 +// CHECK:STDOUT: %impl.elem3.loc26_19.2 => constants.%R.as_type.as.Iterate.impl.Next.adb +// CHECK:STDOUT: %specific_impl_fn.loc26_19.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.fe8 +// CHECK:STDOUT: %.loc26_19.14 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.9 +// CHECK:STDOUT: %impl.elem0.loc26_19.2 => constants.%Destroy.Op.2dd605.9 +// CHECK:STDOUT: %specific_impl_fn.loc26_19.6 => constants.%Destroy.Op.2dd605.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adl_returns_different_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] +// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %T.4e7: %OptionalStorage.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Optional.Get.type.d22: type = fn_type @Optional.Get, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.Get.6fc: %Optional.Get.type.d22 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.498: type = fn_type @Optional.HasValue, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.bf8: %Optional.HasValue.type.498 = struct_value () [symbolic] +// CHECK:STDOUT: %T.cb0: %facet_type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.f8b: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.type.46f: type = fn_type @T.as_type.as.OptionalStorage.impl.Get, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.8c2: %T.as_type.as.OptionalStorage.impl.Get.type.46f = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.type.0ae: type = fn_type @T.as_type.as.OptionalStorage.impl.Has, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.e0f: %T.as_type.as.OptionalStorage.impl.Has.type.0ae = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.type.87a: type = fn_type @T.as_type.as.OptionalStorage.impl.Some, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.898: %T.as_type.as.OptionalStorage.impl.Some.type.87a = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.type.ceb: type = fn_type @T.as_type.as.OptionalStorage.impl.None, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.9dd: %T.as_type.as.OptionalStorage.impl.None.type.ceb = struct_value () [symbolic] +// CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.03d: %facet_type = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] +// CHECK:STDOUT: %ValueType: type = class_type @ValueType [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.94b: type = pattern_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor.type: type = fn_type @ValueType.cpp_destructor [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor: %ValueType.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %ValueType.Op.type.bd116f.1: type = fn_type @ValueType.Op.1 [concrete] +// CHECK:STDOUT: %ValueType.Op.1edc3c.1: %ValueType.Op.type.bd116f.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.031: = custom_witness (%ValueType.Op.1edc3c.1), @Destroy [concrete] +// CHECK:STDOUT: %const.e15: type = const_type %ValueType [concrete] +// CHECK:STDOUT: %ptr.140: type = ptr_type %const.e15 [concrete] +// CHECK:STDOUT: %ptr.fed: type = ptr_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.Op.type.bd116f.2: type = fn_type @ValueType.Op.2 [concrete] +// CHECK:STDOUT: %ValueType.Op.1edc3c.2: %ValueType.Op.type.bd116f.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.d86: = custom_witness (%ValueType.Op.1edc3c.2), @Copy [concrete] +// CHECK:STDOUT: %facet_value.95f: %facet_type = facet_value %ValueType, (%custom_witness.031, %custom_witness.d86) [concrete] +// CHECK:STDOUT: %Iterate_where.type.6d9: type = facet_type <@Iterate where %impl.elem0.03d = %facet_value.95f> [concrete] +// CHECK:STDOUT: %R.bd8: %Iterate_where.type.6d9 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %R.as_type.e1d: type = facet_access_type %R.bd8 [symbolic] +// CHECK:STDOUT: %pattern_type.b93: type = pattern_type %R.as_type.e1d [symbolic] // CHECK:STDOUT: %CppRangeForIterate.type: type = facet_type <@CppRangeForIterate> [concrete] -// CHECK:STDOUT: %Self.6c6: %CppRangeForIterate.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.056be7.1: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.a331a3.1: %CppRangeForIterate.WithSelf.End.type.056be7.1 = struct_value () [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.753895.1: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.2b31f7.1: %CppRangeForIterate.WithSelf.Begin.type.753895.1 = struct_value () [symbolic] // CHECK:STDOUT: %.Self.10b: %CppRangeForIterate.type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate.assoc_type: type = assoc_entity_type @CppRangeForIterate [concrete] // CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.5bf: = lookup_impl_witness %.Self.10b, @CppRangeForIterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.d47: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element0 [symbolic_self] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.bce: = lookup_impl_witness %impl.elem0.d47, @CppUnsafeDeref [symbolic_self] +// CHECK:STDOUT: %impl.elem0.c87: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.bce, element0 [symbolic_self] // CHECK:STDOUT: %impl.elem1.846: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element1 [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem1.846 impls @Destroy> [concrete] -// CHECK:STDOUT: %R: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] -// CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.26c6ea.2: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %assoc2: %CppRangeForIterate.assoc_type = assoc_entity element2, imports.%Core.import_ref.213 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R, @CppRangeForIterate [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.facet.0d2: %CppRangeForIterate.type = facet_value %R.as_type, (%CppRangeForIterate.lookup_impl_witness.edd1fe.2) [symbolic] -// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem0.d47 impls @Copy and %impl.elem0.d47 impls @CppUnsafeDeref and %impl.elem0.d47 impls @EqWith, @EqWith(%impl.elem1.846) and %impl.elem0.d47 impls @Inc and %impl.elem0.c87 impls @Destroy and %impl.elem0.c87 impls @Copy and %impl.elem1.846 impls @Destroy and %impl.elem1.846 impls @Copy> [concrete] +// CHECK:STDOUT: %R.6c6: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R.6c6, @CppRangeForIterate [symbolic] // CHECK:STDOUT: %impl.elem1.bdcd2d.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element1 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.57e: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.04d: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %.b85: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.57e, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem2: %.b85 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c0f: = specific_impl_function %impl.elem2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %assoc3: %CppRangeForIterate.assoc_type = assoc_entity element3, imports.%Core.import_ref.730 [concrete] -// CHECK:STDOUT: %.b40: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.04d, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem3: %.b40 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.d6a: = specific_impl_function %impl.elem3, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.a8f: = lookup_impl_witness %impl.elem1.bdcd2d.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.543: %Destroy.type = facet_value %impl.elem1.bdcd2d.2, (%Destroy.lookup_impl_witness.a8f) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.366: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %.b83: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.366, %Destroy.facet.543 [symbolic] -// CHECK:STDOUT: %impl.elem0.acf: %.b83 = impl_witness_access %Destroy.lookup_impl_witness.a8f, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.add: = specific_impl_function %impl.elem0.acf, @Destroy.WithSelf.Op(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.089: = lookup_impl_witness %impl.elem0.d5966e.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.5e8: %Destroy.type = facet_value %impl.elem0.d5966e.2, (%Destroy.lookup_impl_witness.089) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.7cb: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.5e8) [symbolic] -// CHECK:STDOUT: %.a68: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.7cb, %Destroy.facet.5e8 [symbolic] -// CHECK:STDOUT: %impl.elem0.f59: %.a68 = impl_witness_access %Destroy.lookup_impl_witness.089, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.f06: = specific_impl_function %impl.elem0.f59, @Destroy.WithSelf.Op(%Destroy.facet.5e8) [symbolic] -// CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] -// CHECK:STDOUT: %pattern_type.80f: type = pattern_type %MutableRange [concrete] +// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.384: type = tuple_type (%impl.elem0.d5966e.2, %impl.elem1.bdcd2d.2) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.0ba: = lookup_impl_witness %tuple.type.384, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.2fe: %Destroy.type = facet_value %tuple.type.384, (%Destroy.lookup_impl_witness.0ba) [symbolic] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.ca4: = lookup_impl_witness %impl.elem0.d5966e.2, @CppUnsafeDeref [symbolic] +// CHECK:STDOUT: %impl.elem0.b10: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.ca4, element0 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.3d8: = lookup_impl_witness %impl.elem0.b10, @Destroy [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.bff: = lookup_impl_witness %impl.elem0.b10, @Copy [symbolic] +// CHECK:STDOUT: %facet_value.a30: %facet_type = facet_value %impl.elem0.b10, (%Destroy.lookup_impl_witness.3d8, %Copy.lookup_impl_witness.bff) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.5b5: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.cd2: %R.as_type.as.Iterate.impl.Next.type.5b5 = struct_value () [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.9b6: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.b29: %R.as_type.as.Iterate.impl.NewCursor.type.9b6 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.135: = lookup_impl_witness %R.bd8, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.dca: %Iterate.type = facet_value %R.as_type.e1d, (%Iterate.lookup_impl_witness.135) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.842: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.a4d: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %.89c: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.842, %Iterate.facet.dca [symbolic] +// CHECK:STDOUT: %impl.elem2.488: %.89c = impl_witness_access %Iterate.lookup_impl_witness.135, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.b38: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.135, element1 [symbolic] +// CHECK:STDOUT: %as_type.470: type = facet_access_type %impl.elem1.b38 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5a0: = specific_impl_function %impl.elem2.488, @Iterate.WithSelf.NewCursor(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %ptr.ce1: type = ptr_type %as_type.470 [symbolic] +// CHECK:STDOUT: %.503: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.a4d, %Iterate.facet.dca [symbolic] +// CHECK:STDOUT: %impl.elem3.3bc: %.503 = impl_witness_access %Iterate.lookup_impl_witness.135, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.046: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.95f) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.1ee: = impl_witness imports.%OptionalStorage.impl_witness_table.6f7, @T.as_type.as.OptionalStorage.impl(%facet_value.95f) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.7ac: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.1ee) [concrete] +// CHECK:STDOUT: %Optional.fb3: type = class_type @Optional, @Optional(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %specific_impl_fn.7c6: = specific_impl_function %impl.elem3.3bc, @Iterate.WithSelf.Next(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.475: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %Optional.HasValue.c00: %Optional.HasValue.type.475 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.dd5: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %Optional.Get.335: %Optional.Get.type.dd5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.1a4: %Destroy.type = facet_value %ValueType, (%custom_witness.031) [concrete] +// CHECK:STDOUT: %MaybeUnformed.d14: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.1a4) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.330: type = struct_type {.value: %MaybeUnformed.d14, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.c00, @Optional.HasValue(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.335, @Optional.Get(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator.type: type = fn_type @ValueType.cpp_operator [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.6: type = fn_type @Destroy.Op.loc31_31.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.6: %Destroy.Op.type.790b3b.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.55f: = lookup_impl_witness %impl.elem1.b38, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.567: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.b38) [symbolic] +// CHECK:STDOUT: %.c3e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.567, %impl.elem1.b38 [symbolic] +// CHECK:STDOUT: %impl.elem0.38e: %.c3e = impl_witness_access %Destroy.lookup_impl_witness.55f, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.3a8: = specific_impl_function %impl.elem0.38e, @Destroy.WithSelf.Op(%impl.elem1.b38) [symbolic] // CHECK:STDOUT: %ConstRange: type = class_type @ConstRange [concrete] // CHECK:STDOUT: %pattern_type.88d: type = pattern_type %ConstRange [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %Iterator.b8c: type = class_type @Iterator.1 [concrete] -// CHECK:STDOUT: %Sentinel.501: type = class_type @Sentinel.1 [concrete] -// CHECK:STDOUT: %Begin.type.793876.1: type = fn_type @Begin.1 [concrete] -// CHECK:STDOUT: %Begin.1544bb.1: %Begin.type.793876.1 = struct_value () [concrete] -// CHECK:STDOUT: %End.type.16398b.1: type = fn_type @End.1 [concrete] -// CHECK:STDOUT: %End.be76e1.1: %End.type.16398b.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.8be: = custom_witness (%Iterator.b8c, %Sentinel.501, %Begin.1544bb.1, %End.be76e1.1), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.23e: %CppRangeForIterate.type = facet_value %MutableRange, (%custom_witness.8be) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.910: type = fn_type @Iterator.Op.1 [concrete] -// CHECK:STDOUT: %Iterator.Op.cbb: %Iterator.Op.type.910 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.fe6529.1: = custom_witness (%Iterator.Op.cbb), @Destroy [concrete] -// CHECK:STDOUT: %Sentinel.Op.type.910: type = fn_type @Sentinel.Op.1 [concrete] -// CHECK:STDOUT: %Sentinel.Op.cbb: %Sentinel.Op.type.910 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.fe6529.2: = custom_witness (%Sentinel.Op.cbb), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.2d2: %CppRangeForIterate_where.type = facet_value %MutableRange, (%custom_witness.8be, %custom_witness.fe6529.1, %custom_witness.fe6529.2) [concrete] -// CHECK:STDOUT: %Iterator.080: type = class_type @Iterator.2 [concrete] -// CHECK:STDOUT: %Sentinel.a47: type = class_type @Sentinel.2 [concrete] -// CHECK:STDOUT: %Begin.type.793876.2: type = fn_type @Begin.2 [concrete] -// CHECK:STDOUT: %Begin.1544bb.2: %Begin.type.793876.2 = struct_value () [concrete] -// CHECK:STDOUT: %End.type.16398b.2: type = fn_type @End.2 [concrete] -// CHECK:STDOUT: %End.be76e1.2: %End.type.16398b.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.2ff: = custom_witness (%Iterator.080, %Sentinel.a47, %Begin.1544bb.2, %End.be76e1.2), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.b4e: %CppRangeForIterate.type = facet_value %ConstRange, (%custom_witness.2ff) [concrete] -// CHECK:STDOUT: %Iterator.Op.type.587: type = fn_type @Iterator.Op.2 [concrete] -// CHECK:STDOUT: %Iterator.Op.dc6: %Iterator.Op.type.587 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.166783.1: = custom_witness (%Iterator.Op.dc6), @Destroy [concrete] -// CHECK:STDOUT: %Sentinel.Op.type.587: type = fn_type @Sentinel.Op.2 [concrete] -// CHECK:STDOUT: %Sentinel.Op.dc6: %Sentinel.Op.type.587 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.166783.2: = custom_witness (%Sentinel.Op.dc6), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.c34: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.2ff, %custom_witness.166783.1, %custom_witness.166783.2) [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.f2b: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.23e) [concrete] -// CHECK:STDOUT: %.94e: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.f2b, %CppRangeForIterate.facet.23e [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.a76: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.23e) [concrete] -// CHECK:STDOUT: %.f95: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.a76, %CppRangeForIterate.facet.23e [concrete] -// CHECK:STDOUT: %Destroy.facet.15e: %Destroy.type = facet_value %Sentinel.501, (%custom_witness.fe6529.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.447: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.15e) [concrete] -// CHECK:STDOUT: %.67d: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.447, %Destroy.facet.15e [concrete] -// CHECK:STDOUT: %Destroy.facet.6ae: %Destroy.type = facet_value %Iterator.b8c, (%custom_witness.fe6529.1) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.018: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.6ae) [concrete] -// CHECK:STDOUT: %.e53: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.018, %Destroy.facet.6ae [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.982: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.b4e) [concrete] -// CHECK:STDOUT: %.8d9: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.982, %CppRangeForIterate.facet.b4e [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.c86: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.b4e) [concrete] -// CHECK:STDOUT: %.a33: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.c86, %CppRangeForIterate.facet.b4e [concrete] -// CHECK:STDOUT: %Destroy.facet.a7c: %Destroy.type = facet_value %Sentinel.a47, (%custom_witness.166783.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.89d: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.a7c) [concrete] -// CHECK:STDOUT: %.514: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.89d, %Destroy.facet.a7c [concrete] -// CHECK:STDOUT: %Destroy.facet.488: %Destroy.type = facet_value %Iterator.080, (%custom_witness.166783.1) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.488: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.488) [concrete] -// CHECK:STDOUT: %.8da: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.488, %Destroy.facet.488 [concrete] +// CHECK:STDOUT: %Iterator: type = class_type @Iterator.1 [concrete] +// CHECK:STDOUT: %Sentinel: type = class_type @Sentinel.1 [concrete] +// CHECK:STDOUT: %Begin.type: type = fn_type @Begin [concrete] +// CHECK:STDOUT: %Begin: %Begin.type = struct_value () [concrete] +// CHECK:STDOUT: %End.type: type = fn_type @End [concrete] +// CHECK:STDOUT: %End: %End.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.2ff: = custom_witness (%Iterator, %Sentinel, %Begin, %End), @CppRangeForIterate [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.1: type = fn_type @Iterator.Op.1 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.1: %Iterator.Op.type.587642.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.23f: = custom_witness (%ValueType, %Iterator.Op.dc644c.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.2: type = fn_type @Iterator.Op.2 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.2: %Iterator.Op.type.587642.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.166783.1: = custom_witness (%Iterator.Op.dc644c.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.3: type = fn_type @Iterator.Op.3 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.3: %Iterator.Op.type.587642.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b36db2.1: = custom_witness (%Iterator.Op.dc644c.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] +// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] +// CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.2ed: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Sentinel) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.587642.4: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.dc644c.4: %Iterator.Op.type.587642.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8ca: = custom_witness (%Iterator.Op.dc644c.4), @Inc [concrete] +// CHECK:STDOUT: %Sentinel.Op.type.587642.1: type = fn_type @Sentinel.Op.1 [concrete] +// CHECK:STDOUT: %Sentinel.Op.dc644c.1: %Sentinel.Op.type.587642.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.166783.2: = custom_witness (%Sentinel.Op.dc644c.1), @Destroy [concrete] +// CHECK:STDOUT: %Sentinel.Op.type.587642.2: type = fn_type @Sentinel.Op.2 [concrete] +// CHECK:STDOUT: %Sentinel.Op.dc644c.2: %Sentinel.Op.type.587642.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b36db2.2: = custom_witness (%Sentinel.Op.dc644c.2), @Copy [concrete] +// CHECK:STDOUT: %facet_value.166: %CppRangeForIterate_where.type = facet_value %ConstRange, (%custom_witness.031, %custom_witness.d86, %custom_witness.2ff, %custom_witness.166783.1, %custom_witness.b36db2.1, %custom_witness.23f, %custom_witness.2ed, %custom_witness.8ca, %custom_witness.166783.2, %custom_witness.b36db2.2) [concrete] +// CHECK:STDOUT: %tuple.type.a15: type = tuple_type (%Iterator, %Sentinel) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.7: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.7: %Destroy.Op.type.790b3b.7 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.7: = custom_witness (%Destroy.Op.2dd605.7), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.c5c: %Destroy.type = facet_value %tuple.type.a15, (%custom_witness.e20f1f.7) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.5a2: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.166) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.49f: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.166) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.1c2: %R.as_type.as.Iterate.impl.NewCursor.type.49f = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.fc8: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.166) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.7bf: %R.as_type.as.Iterate.impl.Next.type.fc8 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.bdd: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.5a2) [concrete] +// CHECK:STDOUT: %facet_value.5f8: %Iterate_where.type.6d9 = facet_value %ConstRange, (%Iterate.impl_witness.5a2) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.e45: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.bdd) [concrete] +// CHECK:STDOUT: %.cc1: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.e45, %Iterate.facet.bdd [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %R.as_type.as.Iterate.impl.NewCursor.1c2, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.166) [concrete] +// CHECK:STDOUT: %complete_type.443: = complete_type_witness %tuple.type.a15 [concrete] +// CHECK:STDOUT: %ptr.261: type = ptr_type %tuple.type.a15 [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.3db: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.bdd) [concrete] +// CHECK:STDOUT: %.c8f: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.3db, %Iterate.facet.bdd [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %R.as_type.as.Iterate.impl.Next.7bf, @R.as_type.as.Iterate.impl.Next(%facet_value.166) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.6c1: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.c5c) [concrete] +// CHECK:STDOUT: %.3f3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.6c1, %Destroy.facet.c5c [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.735: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] -// CHECK:STDOUT: %Core.import_ref.572: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc3] -// CHECK:STDOUT: %Core.import_ref.213: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin.type (%CppRangeForIterate.WithSelf.Begin.type.753895.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin (constants.%CppRangeForIterate.WithSelf.Begin.2b31f7.1)] -// CHECK:STDOUT: %Core.import_ref.730: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End.type (%CppRangeForIterate.WithSelf.End.type.056be7.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End (constants.%CppRangeForIterate.WithSelf.End.a331a3.1)] +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.0b9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.498) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.bf8)] +// CHECK:STDOUT: %Core.import_ref.61f: @Optional.%Optional.Get.type (%Optional.Get.type.d22) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.6fc)] +// CHECK:STDOUT: %Core.import_ref.2b5: type = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%DefaultOptionalStorage (constants.%DefaultOptionalStorage.f8b)] +// CHECK:STDOUT: %Core.import_ref.b0a: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None.type (%T.as_type.as.OptionalStorage.impl.None.type.ceb) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None (constants.%T.as_type.as.OptionalStorage.impl.None.9dd)] +// CHECK:STDOUT: %Core.import_ref.3fc: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some.type (%T.as_type.as.OptionalStorage.impl.Some.type.87a) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some (constants.%T.as_type.as.OptionalStorage.impl.Some.898)] +// CHECK:STDOUT: %Core.import_ref.986: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has.type (%T.as_type.as.OptionalStorage.impl.Has.type.0ae) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has (constants.%T.as_type.as.OptionalStorage.impl.Has.e0f)] +// CHECK:STDOUT: %Core.import_ref.557: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get.type (%T.as_type.as.OptionalStorage.impl.Get.type.46f) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get (constants.%T.as_type.as.OptionalStorage.impl.Get.8c2)] +// CHECK:STDOUT: %Core.import_ref.999 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %OptionalStorage.impl_witness_table.6f7 = impl_witness_table (%Core.import_ref.2b5, %Core.import_ref.b0a, %Core.import_ref.3fc, %Core.import_ref.986, %Core.import_ref.557, %Core.import_ref.999), @T.as_type.as.OptionalStorage.impl [concrete] +// CHECK:STDOUT: %N: = namespace [concrete] { +// CHECK:STDOUT: .ValueType = %ValueType.decl +// CHECK:STDOUT: .ConstRange = %ConstRange.decl +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %ValueType.decl: type = class_decl @ValueType [concrete = constants.%ValueType] {} {} +// CHECK:STDOUT: %ValueType.cpp_destructor.decl: %ValueType.cpp_destructor.type = fn_decl @ValueType.cpp_destructor [concrete = constants.%ValueType.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.89a: %facet_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%facet_value (constants.%facet_value.a30)] +// CHECK:STDOUT: %Core.import_ref.9ea: %Destroy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%Destroy.facet (constants.%Destroy.facet.2fe)] +// CHECK:STDOUT: %Core.import_ref.a6c: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor.type (%R.as_type.as.Iterate.impl.NewCursor.type.9b6) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor (constants.%R.as_type.as.Iterate.impl.NewCursor.b29)] +// CHECK:STDOUT: %Core.import_ref.a02: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next.type (%R.as_type.as.Iterate.impl.Next.type.5b5) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next (constants.%R.as_type.as.Iterate.impl.Next.cd2)] +// CHECK:STDOUT: %Iterate.impl_witness_table.9f0 = impl_witness_table (%Core.import_ref.89a, %Core.import_ref.9ea, %Core.import_ref.a6c, %Core.import_ref.a02), @R.as_type.as.Iterate.impl [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator.decl: %ValueType.cpp_operator.type = fn_decl @ValueType.cpp_operator [concrete = constants.%ValueType.cpp_operator] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %ConstRange.decl: type = class_decl @ConstRange [concrete = constants.%ConstRange] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Test(%R.loc42_10.2: %CppRangeForIterate_where.type) { +// CHECK:STDOUT: generic fn @Test(%R.loc27_10.2: %Iterate_where.type.6d9) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness: = lookup_impl_witness %R.loc42_10.1, @CppRangeForIterate [symbolic = %CppRangeForIterate.lookup_impl_witness (constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2)] -// CHECK:STDOUT: %CppRangeForIterate.facet: %CppRangeForIterate.type = facet_value %R.as_type.loc42_113.1, (%CppRangeForIterate.lookup_impl_witness) [symbolic = %CppRangeForIterate.facet (constants.%CppRangeForIterate.facet.0d2)] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.Begin.type (constants.%CppRangeForIterate.WithSelf.Begin.type.57e)] -// CHECK:STDOUT: %.loc44_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type, %CppRangeForIterate.facet [symbolic = %.loc44_4 (constants.%.b85)] -// CHECK:STDOUT: %impl.elem2.loc44_4.2: @Test.%.loc44_4 (%.b85) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %specific_impl_fn.loc44_4.2: = specific_impl_function %impl.elem2.loc44_4.2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc44_4.2 (constants.%specific_impl_fn.c0f)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc27_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.135)] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc27_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.dca)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.842)] +// CHECK:STDOUT: %.loc31_31.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc31_31.13 (constants.%.89c)] +// CHECK:STDOUT: %impl.elem2.loc31_31.2: @Test.%.loc31_31.13 (%.89c) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_31.2 (constants.%impl.elem2.488)] +// CHECK:STDOUT: %specific_impl_fn.loc31_31.4: = specific_impl_function %impl.elem2.loc31_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc31_31.4 (constants.%specific_impl_fn.5a0)] // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.End.type (constants.%CppRangeForIterate.WithSelf.End.type.04d)] -// CHECK:STDOUT: %.loc45_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type, %CppRangeForIterate.facet [symbolic = %.loc45_4 (constants.%.b40)] -// CHECK:STDOUT: %impl.elem3.loc45_4.2: @Test.%.loc45_4 (%.b40) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc45_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %specific_impl_fn.loc45_4.2: = specific_impl_function %impl.elem3.loc45_4.2, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc45_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc45: = lookup_impl_witness %impl.elem1.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc45 (constants.%Destroy.lookup_impl_witness.a8f)] -// CHECK:STDOUT: %Destroy.facet.loc45: %Destroy.type = facet_value %impl.elem1.1, (%Destroy.lookup_impl_witness.loc45) [symbolic = %Destroy.facet.loc45 (constants.%Destroy.facet.543)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc45: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc45) [symbolic = %Destroy.WithSelf.Op.type.loc45 (constants.%Destroy.WithSelf.Op.type.366)] -// CHECK:STDOUT: %.loc45_9.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc45, %Destroy.facet.loc45 [symbolic = %.loc45_9.3 (constants.%.b83)] -// CHECK:STDOUT: %impl.elem0.loc45_9.2: @Test.%.loc45_9.3 (%.b83) = impl_witness_access %Destroy.lookup_impl_witness.loc45, element0 [symbolic = %impl.elem0.loc45_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %specific_impl_fn.loc45_9.2: = specific_impl_function %impl.elem0.loc45_9.2, @Destroy.WithSelf.Op(%Destroy.facet.loc45) [symbolic = %specific_impl_fn.loc45_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc44: = lookup_impl_witness %impl.elem0.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc44 (constants.%Destroy.lookup_impl_witness.089)] -// CHECK:STDOUT: %Destroy.facet.loc44: %Destroy.type = facet_value %impl.elem0.1, (%Destroy.lookup_impl_witness.loc44) [symbolic = %Destroy.facet.loc44 (constants.%Destroy.facet.5e8)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc44: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc44) [symbolic = %Destroy.WithSelf.Op.type.loc44 (constants.%Destroy.WithSelf.Op.type.7cb)] -// CHECK:STDOUT: %.loc44_11.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc44, %Destroy.facet.loc44 [symbolic = %.loc44_11.3 (constants.%.a68)] -// CHECK:STDOUT: %impl.elem0.loc44_11.2: @Test.%.loc44_11.3 (%.a68) = impl_witness_access %Destroy.lookup_impl_witness.loc44, element0 [symbolic = %impl.elem0.loc44_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %specific_impl_fn.loc44_11.2: = specific_impl_function %impl.elem0.loc44_11.2, @Destroy.WithSelf.Op(%Destroy.facet.loc44) [symbolic = %specific_impl_fn.loc44_11.2 (constants.%specific_impl_fn.f06)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.ce1)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.a4d)] +// CHECK:STDOUT: %.loc31_31.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc31_31.14 (constants.%.503)] +// CHECK:STDOUT: %impl.elem3.loc31_31.2: @Test.%.loc31_31.14 (%.503) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_31.2 (constants.%impl.elem3.3bc)] +// CHECK:STDOUT: %specific_impl_fn.loc31_31.5: = specific_impl_function %impl.elem3.loc31_31.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc31_31.5 (constants.%specific_impl_fn.7c6)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.567)] +// CHECK:STDOUT: %.loc31_31.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc31_31.15 (constants.%.c3e)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.55f)] +// CHECK:STDOUT: %impl.elem0.loc31_31.2: @Test.%.loc31_31.15 (%.c3e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc31_31.2 (constants.%impl.elem0.38e)] +// CHECK:STDOUT: %specific_impl_fn.loc31_31.6: = specific_impl_function %impl.elem0.loc31_31.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc31_31.6 (constants.%specific_impl_fn.3a8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%r.param: ref @Test.%R.as_type.loc42_113.1 (%R.as_type)) { +// CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc27_67.1 (%R.as_type.e1d)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %r.ref.loc44: ref @Test.%R.as_type.loc42_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %Begin.ref: %CppRangeForIterate.assoc_type = name_ref Begin, imports.%Core.import_ref.735 [concrete = constants.%assoc2] -// CHECK:STDOUT: %impl.elem2.loc44_4.1: @Test.%.loc44_4 (%.b85) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic = %impl.elem2.loc44_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %bound_method.loc44_4: = bound_method %r.ref.loc44, %impl.elem2.loc44_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc44_4.1: = specific_impl_function %impl.elem2.loc44_4.1, @CppRangeForIterate.WithSelf.Begin(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc44_4.2 (constants.%specific_impl_fn.c0f)] -// CHECK:STDOUT: %bound_method.loc44_11.1: = bound_method %r.ref.loc44, %specific_impl_fn.loc44_4.1 -// CHECK:STDOUT: %.loc44_11.1: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.call: init @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) to %.loc44_11.1 = call %bound_method.loc44_11.1(%r.ref.loc44) -// CHECK:STDOUT: %.loc44_11.2: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary %.loc44_11.1, %CppRangeForIterate.WithSelf.Begin.call -// CHECK:STDOUT: %r.ref.loc45: ref @Test.%R.as_type.loc42_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %End.ref: %CppRangeForIterate.assoc_type = name_ref End, imports.%Core.import_ref.572 [concrete = constants.%assoc3] -// CHECK:STDOUT: %impl.elem3.loc45_4.1: @Test.%.loc45_4 (%.b40) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic = %impl.elem3.loc45_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %bound_method.loc45_4: = bound_method %r.ref.loc45, %impl.elem3.loc45_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc45_4.1: = specific_impl_function %impl.elem3.loc45_4.1, @CppRangeForIterate.WithSelf.End(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc45_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: %bound_method.loc45_9.1: = bound_method %r.ref.loc45, %specific_impl_fn.loc45_4.1 -// CHECK:STDOUT: %.loc45_9.1: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.call: init @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) to %.loc45_9.1 = call %bound_method.loc45_9.1(%r.ref.loc45) -// CHECK:STDOUT: %.loc45_9.2: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary %.loc45_9.1, %CppRangeForIterate.WithSelf.End.call -// CHECK:STDOUT: %impl.elem0.loc45_9.1: @Test.%.loc45_9.3 (%.b83) = impl_witness_access constants.%Destroy.lookup_impl_witness.a8f, element0 [symbolic = %impl.elem0.loc45_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %bound_method.loc45_9.2: = bound_method %.loc45_9.2, %impl.elem0.loc45_9.1 -// CHECK:STDOUT: %specific_impl_fn.loc45_9.1: = specific_impl_function %impl.elem0.loc45_9.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.543) [symbolic = %specific_impl_fn.loc45_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %bound_method.loc45_9.3: = bound_method %.loc45_9.2, %specific_impl_fn.loc45_9.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc45: init %empty_tuple.type = call %bound_method.loc45_9.3(%.loc45_9.2) -// CHECK:STDOUT: %impl.elem0.loc44_11.1: @Test.%.loc44_11.3 (%.a68) = impl_witness_access constants.%Destroy.lookup_impl_witness.089, element0 [symbolic = %impl.elem0.loc44_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %bound_method.loc44_11.2: = bound_method %.loc44_11.2, %impl.elem0.loc44_11.1 -// CHECK:STDOUT: %specific_impl_fn.loc44_11.1: = specific_impl_function %impl.elem0.loc44_11.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.5e8) [symbolic = %specific_impl_fn.loc44_11.2 (constants.%specific_impl_fn.f06)] -// CHECK:STDOUT: %bound_method.loc44_11.3: = bound_method %.loc44_11.2, %specific_impl_fn.loc44_11.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc44: init %empty_tuple.type = call %bound_method.loc44_11.3(%.loc44_11.2) +// CHECK:STDOUT: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.94b = value_binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc27_67.1 (%R.as_type.e1d) = name_ref r, %r +// CHECK:STDOUT: %impl.elem2.loc31_31.1: @Test.%.loc31_31.13 (%.89c) = impl_witness_access constants.%Iterate.lookup_impl_witness.135, element2 [symbolic = %impl.elem2.loc31_31.2 (constants.%impl.elem2.488)] +// CHECK:STDOUT: %bound_method.loc31_31.1: = bound_method %r.ref, %impl.elem2.loc31_31.1 +// CHECK:STDOUT: %specific_impl_fn.loc31_31.1: = specific_impl_function %impl.elem2.loc31_31.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.dca) [symbolic = %specific_impl_fn.loc31_31.4 (constants.%specific_impl_fn.5a0)] +// CHECK:STDOUT: %bound_method.loc31_31.2: = bound_method %r.ref, %specific_impl_fn.loc31_31.1 +// CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.470) = var invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @Test.%as_type (%as_type.470) to %var = call %bound_method.loc31_31.2(%r.ref) +// CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.next: +// CHECK:STDOUT: %addr.loc31: @Test.%ptr (%ptr.ce1) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc31_31.1: @Test.%.loc31_31.14 (%.503) = impl_witness_access constants.%Iterate.lookup_impl_witness.135, element3 [symbolic = %impl.elem3.loc31_31.2 (constants.%impl.elem3.3bc)] +// CHECK:STDOUT: %bound_method.loc31_31.3: = bound_method %r.ref, %impl.elem3.loc31_31.1 +// CHECK:STDOUT: %.loc31_31.1: %Destroy.type = converted constants.%as_type.470, constants.%impl.elem1.b38 [symbolic = %impl.elem1 (constants.%impl.elem1.b38)] +// CHECK:STDOUT: %specific_impl_fn.loc31_31.2: = specific_impl_function %impl.elem3.loc31_31.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.dca) [symbolic = %specific_impl_fn.loc31_31.5 (constants.%specific_impl_fn.7c6)] +// CHECK:STDOUT: %bound_method.loc31_31.4: = bound_method %r.ref, %specific_impl_fn.loc31_31.2 +// CHECK:STDOUT: %.loc31_31.2: ref %Optional.fb3 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.fb3 to %.loc31_31.2 = call %bound_method.loc31_31.4(%r.ref, %addr.loc31) +// CHECK:STDOUT: %.loc31_31.3: ref %Optional.fb3 = temporary %.loc31_31.2, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc31_31.4: %Optional.HasValue.type.475 = specific_constant imports.%Core.import_ref.0b9, @Optional(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.HasValue.c00] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.475 = name_ref HasValue, %.loc31_31.4 [concrete = constants.%Optional.HasValue.c00] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc31_31.3, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc31_31.5: = bound_method %.loc31_31.3, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc31_31.5: %Optional.fb3 = acquire_value %.loc31_31.3 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc31_31.5(%.loc31_31.5) +// CHECK:STDOUT: %.loc31_31.6: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc31_31.7: bool = converted %Optional.HasValue.call, %.loc31_31.6 +// CHECK:STDOUT: if %.loc31_31.7 br !for.body else br !for.done +// CHECK:STDOUT: +// CHECK:STDOUT: !for.body: +// CHECK:STDOUT: %.loc31_31.8: %Optional.Get.type.dd5 = specific_constant imports.%Core.import_ref.61f, @Optional(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.Get.335] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.dd5 = name_ref Get, %.loc31_31.8 [concrete = constants.%Optional.Get.335] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc31_31.3, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc31_31.6: = bound_method %.loc31_31.3, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc31_31.9: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc31_31.10: %Optional.fb3 = acquire_value %.loc31_31.3 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc31_31.9 = call %bound_method.loc31_31.6(%.loc31_31.10) +// CHECK:STDOUT: %.loc31_16: type = splice_block %ValueType.ref.loc31 [concrete = constants.%ValueType] { +// CHECK:STDOUT: %Cpp.ref.loc31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %N.ref.loc31: = name_ref N, imports.%N [concrete = imports.%N] +// CHECK:STDOUT: %ValueType.ref.loc31: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc31_31.11: ref %ValueType = temporary %.loc31_31.9, %Optional.Get.call +// CHECK:STDOUT: %.loc31_31.12: %ValueType = acquire_value %.loc31_31.11 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc31_31.12 +// CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum +// CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i +// CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl +// CHECK:STDOUT: %.loc32_12: ref %ValueType = value_as_ref %i.ref +// CHECK:STDOUT: %addr.loc32: %ptr.fed = addr_of %.loc32_12 +// CHECK:STDOUT: %.loc32_9.1: %ptr.140 = as_compatible %addr.loc32 +// CHECK:STDOUT: %.loc32_9.2: %ptr.140 = converted %addr.loc32, %.loc32_9.1 +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc32_9.2) +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.done: +// CHECK:STDOUT: %ValueType.Op.bound.loc31: = bound_method %.loc31_31.11, constants.%ValueType.Op.1edc3c.1 +// CHECK:STDOUT: %Op.ref.loc31: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc31: = bound_method %.loc31_31.11, %Op.ref.loc31 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc31: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc31(%.loc31_31.11) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc31_31.3, constants.%Destroy.Op.2dd605.6 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc31_31.3) +// CHECK:STDOUT: %impl.elem0.loc31_31.1: @Test.%.loc31_31.15 (%.c3e) = impl_witness_access constants.%Destroy.lookup_impl_witness.55f, element0 [symbolic = %impl.elem0.loc31_31.2 (constants.%impl.elem0.38e)] +// CHECK:STDOUT: %bound_method.loc31_31.7: = bound_method %var, %impl.elem0.loc31_31.1 +// CHECK:STDOUT: %specific_impl_fn.loc31_31.3: = specific_impl_function %impl.elem0.loc31_31.1, @Destroy.WithSelf.Op(constants.%impl.elem1.b38) [symbolic = %specific_impl_fn.loc31_31.6 (constants.%specific_impl_fn.3a8)] +// CHECK:STDOUT: %bound_method.loc31_31.8: = bound_method %var, %specific_impl_fn.loc31_31.3 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc31_31.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%R) { -// CHECK:STDOUT: %R.loc42_10.1 => constants.%R -// CHECK:STDOUT: %R.as_type.loc42_113.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.26c6ea.2 +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.1(%self.param: ref %MaybeUnformed.d14) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.2d2) { -// CHECK:STDOUT: %R.loc42_10.1 => constants.%facet_value.2d2 -// CHECK:STDOUT: %R.as_type.loc42_113.1 => constants.%MutableRange -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.80f +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.2(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc42 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.8be -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.23e -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.f2b -// CHECK:STDOUT: %.loc44_4 => constants.%.94e -// CHECK:STDOUT: %impl.elem2.loc44_4.2 => constants.%Begin.1544bb.1 -// CHECK:STDOUT: %specific_impl_fn.loc44_4.2 => constants.%Begin.1544bb.1 -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.b8c -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.a76 -// CHECK:STDOUT: %.loc45_4 => constants.%.f95 -// CHECK:STDOUT: %impl.elem3.loc45_4.2 => constants.%End.be76e1.1 -// CHECK:STDOUT: %specific_impl_fn.loc45_4.2 => constants.%End.be76e1.1 -// CHECK:STDOUT: %impl.elem1.1 => constants.%Sentinel.501 -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc45 => constants.%custom_witness.fe6529.2 -// CHECK:STDOUT: %Destroy.facet.loc45 => constants.%Destroy.facet.15e -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc45 => constants.%Destroy.WithSelf.Op.type.447 -// CHECK:STDOUT: %.loc45_9.3 => constants.%.67d -// CHECK:STDOUT: %impl.elem0.loc45_9.2 => constants.%Sentinel.Op.cbb -// CHECK:STDOUT: %specific_impl_fn.loc45_9.2 => constants.%Sentinel.Op.cbb -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc44 => constants.%custom_witness.fe6529.1 -// CHECK:STDOUT: %Destroy.facet.loc44 => constants.%Destroy.facet.6ae -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc44 => constants.%Destroy.WithSelf.Op.type.018 -// CHECK:STDOUT: %.loc44_11.3 => constants.%.e53 -// CHECK:STDOUT: %impl.elem0.loc44_11.2 => constants.%Iterator.Op.cbb -// CHECK:STDOUT: %specific_impl_fn.loc44_11.2 => constants.%Iterator.Op.cbb +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.3(%self.param: ref %struct_type.value.has_value.330) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value.c34) { -// CHECK:STDOUT: %R.loc42_10.1 => constants.%facet_value.c34 -// CHECK:STDOUT: %R.as_type.loc42_113.1 => constants.%ConstRange +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.4(%self.param: ref %DefaultOptionalStorage.046) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc31_31.5(%self.param: ref %Optional.fb3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%R.bd8) { +// CHECK:STDOUT: %R.loc27_10.1 => constants.%R.bd8 +// CHECK:STDOUT: %R.as_type.loc27_67.1 => constants.%R.as_type.e1d +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.b93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%facet_value.5f8) { +// CHECK:STDOUT: %R.loc27_10.1 => constants.%facet_value.5f8 +// CHECK:STDOUT: %R.as_type.loc27_67.1 => constants.%ConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.88d // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc42 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.2ff -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.b4e -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.982 -// CHECK:STDOUT: %.loc44_4 => constants.%.8d9 -// CHECK:STDOUT: %impl.elem2.loc44_4.2 => constants.%Begin.1544bb.2 -// CHECK:STDOUT: %specific_impl_fn.loc44_4.2 => constants.%Begin.1544bb.2 -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator.080 -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.c86 -// CHECK:STDOUT: %.loc45_4 => constants.%.a33 -// CHECK:STDOUT: %impl.elem3.loc45_4.2 => constants.%End.be76e1.2 -// CHECK:STDOUT: %specific_impl_fn.loc45_4.2 => constants.%End.be76e1.2 -// CHECK:STDOUT: %impl.elem1.1 => constants.%Sentinel.a47 -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc45 => constants.%custom_witness.166783.2 -// CHECK:STDOUT: %Destroy.facet.loc45 => constants.%Destroy.facet.a7c -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc45 => constants.%Destroy.WithSelf.Op.type.89d -// CHECK:STDOUT: %.loc45_9.3 => constants.%.514 -// CHECK:STDOUT: %impl.elem0.loc45_9.2 => constants.%Sentinel.Op.dc6 -// CHECK:STDOUT: %specific_impl_fn.loc45_9.2 => constants.%Sentinel.Op.dc6 -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc44 => constants.%custom_witness.166783.1 -// CHECK:STDOUT: %Destroy.facet.loc44 => constants.%Destroy.facet.488 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc44 => constants.%Destroy.WithSelf.Op.type.488 -// CHECK:STDOUT: %.loc44_11.3 => constants.%.8da -// CHECK:STDOUT: %impl.elem0.loc44_11.2 => constants.%Iterator.Op.dc6 -// CHECK:STDOUT: %specific_impl_fn.loc44_11.2 => constants.%Iterator.Op.dc6 +// CHECK:STDOUT: %require_complete.loc27 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.5a2 +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.bdd +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.e45 +// CHECK:STDOUT: %.loc31_31.13 => constants.%.cc1 +// CHECK:STDOUT: %impl.elem2.loc31_31.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.1c2 +// CHECK:STDOUT: %specific_impl_fn.loc31_31.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.c5c +// CHECK:STDOUT: %as_type => constants.%tuple.type.a15 +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.443 +// CHECK:STDOUT: %ptr => constants.%ptr.261 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.3db +// CHECK:STDOUT: %.loc31_31.14 => constants.%.c8f +// CHECK:STDOUT: %impl.elem3.loc31_31.2 => constants.%R.as_type.as.Iterate.impl.Next.7bf +// CHECK:STDOUT: %specific_impl_fn.loc31_31.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.6c1 +// CHECK:STDOUT: %.loc31_31.15 => constants.%.3f3 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.7 +// CHECK:STDOUT: %impl.elem0.loc31_31.2 => constants.%Destroy.Op.2dd605.7 +// CHECK:STDOUT: %specific_impl_fn.loc31_31.6 => constants.%Destroy.Op.2dd605.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- adl_overloads.carbon +// CHECK:STDOUT: --- fail_todo_adl_returns_different_types_mutable.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] +// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %T.4e7: %OptionalStorage.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Optional.Get.type.d22: type = fn_type @Optional.Get, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.Get.6fc: %Optional.Get.type.d22 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.498: type = fn_type @Optional.HasValue, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.bf8: %Optional.HasValue.type.498 = struct_value () [symbolic] +// CHECK:STDOUT: %T.cb0: %facet_type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.f8b: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.type.46f: type = fn_type @T.as_type.as.OptionalStorage.impl.Get, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.8c2: %T.as_type.as.OptionalStorage.impl.Get.type.46f = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.type.0ae: type = fn_type @T.as_type.as.OptionalStorage.impl.Has, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.e0f: %T.as_type.as.OptionalStorage.impl.Has.type.0ae = struct_value () [symbolic] +// CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.03d: %facet_type = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] +// CHECK:STDOUT: %ValueType: type = class_type @ValueType [concrete] +// CHECK:STDOUT: %pattern_type.94b: type = pattern_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor.type: type = fn_type @ValueType.cpp_destructor [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor: %ValueType.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %ValueType.Op.type.bd116f.1: type = fn_type @ValueType.Op.1 [concrete] +// CHECK:STDOUT: %ValueType.Op.1edc3c.1: %ValueType.Op.type.bd116f.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.031: = custom_witness (%ValueType.Op.1edc3c.1), @Destroy [concrete] +// CHECK:STDOUT: %const.e15: type = const_type %ValueType [concrete] +// CHECK:STDOUT: %ptr.140: type = ptr_type %const.e15 [concrete] +// CHECK:STDOUT: %ptr.fed: type = ptr_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.Op.type.bd116f.2: type = fn_type @ValueType.Op.2 [concrete] +// CHECK:STDOUT: %ValueType.Op.1edc3c.2: %ValueType.Op.type.bd116f.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.d86: = custom_witness (%ValueType.Op.1edc3c.2), @Copy [concrete] +// CHECK:STDOUT: %facet_value.95f: %facet_type = facet_value %ValueType, (%custom_witness.031, %custom_witness.d86) [concrete] +// CHECK:STDOUT: %Iterate_where.type.6d9: type = facet_type <@Iterate where %impl.elem0.03d = %facet_value.95f> [concrete] +// CHECK:STDOUT: %R.bd8: %Iterate_where.type.6d9 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %R.as_type.e1d: type = facet_access_type %R.bd8 [symbolic] +// CHECK:STDOUT: %pattern_type.b93: type = pattern_type %R.as_type.e1d [symbolic] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.135: = lookup_impl_witness %R.bd8, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.e1d, (%Iterate.lookup_impl_witness.135) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.842: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.a4d: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic] +// CHECK:STDOUT: %.89c: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.842, %Iterate.facet [symbolic] +// CHECK:STDOUT: %impl.elem2.488: %.89c = impl_witness_access %Iterate.lookup_impl_witness.135, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.b38: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.135, element1 [symbolic] +// CHECK:STDOUT: %as_type.470: type = facet_access_type %impl.elem1.b38 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5a0: = specific_impl_function %impl.elem2.488, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic] +// CHECK:STDOUT: %ptr.ce1: type = ptr_type %as_type.470 [symbolic] +// CHECK:STDOUT: %.503: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.a4d, %Iterate.facet [symbolic] +// CHECK:STDOUT: %impl.elem3.3bc: %.503 = impl_witness_access %Iterate.lookup_impl_witness.135, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.046: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.95f) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.342: = impl_witness imports.%OptionalStorage.impl_witness_table.041, @T.as_type.as.OptionalStorage.impl(%facet_value.95f) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.52a: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.342) [concrete] +// CHECK:STDOUT: %Optional.68d: type = class_type @Optional, @Optional(%OptionalStorage.facet.52a) [concrete] +// CHECK:STDOUT: %specific_impl_fn.7c6: = specific_impl_function %impl.elem3.3bc, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.426: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.52a) [concrete] +// CHECK:STDOUT: %Optional.HasValue.9f3: %Optional.HasValue.type.426 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.1e2: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.52a) [concrete] +// CHECK:STDOUT: %Optional.Get.64e: %Optional.Get.type.1e2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.1a4: %Destroy.type = facet_value %ValueType, (%custom_witness.031) [concrete] +// CHECK:STDOUT: %MaybeUnformed.d14: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.1a4) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.330: type = struct_type {.value: %MaybeUnformed.d14, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.9f3, @Optional.HasValue(%OptionalStorage.facet.52a) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.64e, @Optional.Get(%OptionalStorage.facet.52a) [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator.type: type = fn_type @ValueType.cpp_operator [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.6: type = fn_type @Destroy.Op.loc32_31.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.6: %Destroy.Op.type.790b3b.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.55f: = lookup_impl_witness %impl.elem1.b38, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.567: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.b38) [symbolic] +// CHECK:STDOUT: %.c3e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.567, %impl.elem1.b38 [symbolic] +// CHECK:STDOUT: %impl.elem0.38e: %.c3e = impl_witness_access %Destroy.lookup_impl_witness.55f, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.3a8: = specific_impl_function %impl.elem0.38e, @Destroy.WithSelf.Op(%impl.elem1.b38) [symbolic] +// CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.0b9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.498) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.bf8)] +// CHECK:STDOUT: %Core.import_ref.61f: @Optional.%Optional.Get.type (%Optional.Get.type.d22) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.6fc)] +// CHECK:STDOUT: %Core.import_ref.2b5: type = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%DefaultOptionalStorage (constants.%DefaultOptionalStorage.f8b)] +// CHECK:STDOUT: %Core.import_ref.b5a = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %Core.import_ref.977 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %Core.import_ref.986: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has.type (%T.as_type.as.OptionalStorage.impl.Has.type.0ae) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has (constants.%T.as_type.as.OptionalStorage.impl.Has.e0f)] +// CHECK:STDOUT: %Core.import_ref.557: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get.type (%T.as_type.as.OptionalStorage.impl.Get.type.46f) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get (constants.%T.as_type.as.OptionalStorage.impl.Get.8c2)] +// CHECK:STDOUT: %Core.import_ref.999 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %OptionalStorage.impl_witness_table.041 = impl_witness_table (%Core.import_ref.2b5, %Core.import_ref.b5a, %Core.import_ref.977, %Core.import_ref.986, %Core.import_ref.557, %Core.import_ref.999), @T.as_type.as.OptionalStorage.impl [concrete] +// CHECK:STDOUT: %N: = namespace [concrete] { +// CHECK:STDOUT: .ValueType = %ValueType.decl +// CHECK:STDOUT: .MutableRange = %MutableRange.decl +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %ValueType.decl: type = class_decl @ValueType [concrete = constants.%ValueType] {} {} +// CHECK:STDOUT: %ValueType.cpp_destructor.decl: %ValueType.cpp_destructor.type = fn_decl @ValueType.cpp_destructor [concrete = constants.%ValueType.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %ValueType.cpp_operator.decl: %ValueType.cpp_operator.type = fn_decl @ValueType.cpp_operator [concrete = constants.%ValueType.cpp_operator] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %MutableRange.decl: type = class_decl @MutableRange [concrete = constants.%MutableRange] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @Test(%R.loc28_10.2: %Iterate_where.type.6d9) { +// CHECK:STDOUT: +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc28_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.135)] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc28_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.842)] +// CHECK:STDOUT: %.loc32_31.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc32_31.13 (constants.%.89c)] +// CHECK:STDOUT: %impl.elem2.loc32_31.2: @Test.%.loc32_31.13 (%.89c) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc32_31.2 (constants.%impl.elem2.488)] +// CHECK:STDOUT: %specific_impl_fn.loc32_31.4: = specific_impl_function %impl.elem2.loc32_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.4 (constants.%specific_impl_fn.5a0)] +// CHECK:STDOUT: +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.ce1)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.a4d)] +// CHECK:STDOUT: %.loc32_31.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc32_31.14 (constants.%.503)] +// CHECK:STDOUT: %impl.elem3.loc32_31.2: @Test.%.loc32_31.14 (%.503) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc32_31.2 (constants.%impl.elem3.3bc)] +// CHECK:STDOUT: %specific_impl_fn.loc32_31.5: = specific_impl_function %impl.elem3.loc32_31.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.5 (constants.%specific_impl_fn.7c6)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.567)] +// CHECK:STDOUT: %.loc32_31.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc32_31.15 (constants.%.c3e)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.55f)] +// CHECK:STDOUT: %impl.elem0.loc32_31.2: @Test.%.loc32_31.15 (%.c3e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc32_31.2 (constants.%impl.elem0.38e)] +// CHECK:STDOUT: %specific_impl_fn.loc32_31.6: = specific_impl_function %impl.elem0.loc32_31.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc32_31.6 (constants.%specific_impl_fn.3a8)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc28_67.1 (%R.as_type.e1d)) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.94b = value_binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc28_67.1 (%R.as_type.e1d) = name_ref r, %r +// CHECK:STDOUT: %impl.elem2.loc32_31.1: @Test.%.loc32_31.13 (%.89c) = impl_witness_access constants.%Iterate.lookup_impl_witness.135, element2 [symbolic = %impl.elem2.loc32_31.2 (constants.%impl.elem2.488)] +// CHECK:STDOUT: %bound_method.loc32_31.1: = bound_method %r.ref, %impl.elem2.loc32_31.1 +// CHECK:STDOUT: %specific_impl_fn.loc32_31.1: = specific_impl_function %impl.elem2.loc32_31.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.4 (constants.%specific_impl_fn.5a0)] +// CHECK:STDOUT: %bound_method.loc32_31.2: = bound_method %r.ref, %specific_impl_fn.loc32_31.1 +// CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.470) = var invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @Test.%as_type (%as_type.470) to %var = call %bound_method.loc32_31.2(%r.ref) +// CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.next: +// CHECK:STDOUT: %addr.loc32: @Test.%ptr (%ptr.ce1) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc32_31.1: @Test.%.loc32_31.14 (%.503) = impl_witness_access constants.%Iterate.lookup_impl_witness.135, element3 [symbolic = %impl.elem3.loc32_31.2 (constants.%impl.elem3.3bc)] +// CHECK:STDOUT: %bound_method.loc32_31.3: = bound_method %r.ref, %impl.elem3.loc32_31.1 +// CHECK:STDOUT: %.loc32_31.1: %Destroy.type = converted constants.%as_type.470, constants.%impl.elem1.b38 [symbolic = %impl.elem1 (constants.%impl.elem1.b38)] +// CHECK:STDOUT: %specific_impl_fn.loc32_31.2: = specific_impl_function %impl.elem3.loc32_31.1, @Iterate.WithSelf.Next(constants.%Iterate.facet) [symbolic = %specific_impl_fn.loc32_31.5 (constants.%specific_impl_fn.7c6)] +// CHECK:STDOUT: %bound_method.loc32_31.4: = bound_method %r.ref, %specific_impl_fn.loc32_31.2 +// CHECK:STDOUT: %.loc32_31.2: ref %Optional.68d = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.68d to %.loc32_31.2 = call %bound_method.loc32_31.4(%r.ref, %addr.loc32) +// CHECK:STDOUT: %.loc32_31.3: ref %Optional.68d = temporary %.loc32_31.2, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc32_31.4: %Optional.HasValue.type.426 = specific_constant imports.%Core.import_ref.0b9, @Optional(constants.%OptionalStorage.facet.52a) [concrete = constants.%Optional.HasValue.9f3] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.426 = name_ref HasValue, %.loc32_31.4 [concrete = constants.%Optional.HasValue.9f3] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc32_31.3, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.52a) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_31.5: = bound_method %.loc32_31.3, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc32_31.5: %Optional.68d = acquire_value %.loc32_31.3 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc32_31.5(%.loc32_31.5) +// CHECK:STDOUT: %.loc32_31.6: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc32_31.7: bool = converted %Optional.HasValue.call, %.loc32_31.6 +// CHECK:STDOUT: if %.loc32_31.7 br !for.body else br !for.done +// CHECK:STDOUT: +// CHECK:STDOUT: !for.body: +// CHECK:STDOUT: %.loc32_31.8: %Optional.Get.type.1e2 = specific_constant imports.%Core.import_ref.61f, @Optional(constants.%OptionalStorage.facet.52a) [concrete = constants.%Optional.Get.64e] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.1e2 = name_ref Get, %.loc32_31.8 [concrete = constants.%Optional.Get.64e] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc32_31.3, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.52a) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc32_31.6: = bound_method %.loc32_31.3, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc32_31.9: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc32_31.10: %Optional.68d = acquire_value %.loc32_31.3 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc32_31.9 = call %bound_method.loc32_31.6(%.loc32_31.10) +// CHECK:STDOUT: %.loc32_16: type = splice_block %ValueType.ref.loc32 [concrete = constants.%ValueType] { +// CHECK:STDOUT: %Cpp.ref.loc32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %N.ref.loc32: = name_ref N, imports.%N [concrete = imports.%N] +// CHECK:STDOUT: %ValueType.ref.loc32: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc32_31.11: ref %ValueType = temporary %.loc32_31.9, %Optional.Get.call +// CHECK:STDOUT: %.loc32_31.12: %ValueType = acquire_value %.loc32_31.11 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc32_31.12 +// CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum +// CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i +// CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl +// CHECK:STDOUT: %.loc33_12: ref %ValueType = value_as_ref %i.ref +// CHECK:STDOUT: %addr.loc33: %ptr.fed = addr_of %.loc33_12 +// CHECK:STDOUT: %.loc33_9.1: %ptr.140 = as_compatible %addr.loc33 +// CHECK:STDOUT: %.loc33_9.2: %ptr.140 = converted %addr.loc33, %.loc33_9.1 +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc33_9.2) +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.done: +// CHECK:STDOUT: %ValueType.Op.bound.loc32: = bound_method %.loc32_31.11, constants.%ValueType.Op.1edc3c.1 +// CHECK:STDOUT: %Op.ref.loc32: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc32: = bound_method %.loc32_31.11, %Op.ref.loc32 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc32: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc32(%.loc32_31.11) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc32_31.3, constants.%Destroy.Op.2dd605.6 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc32_31.3) +// CHECK:STDOUT: %impl.elem0.loc32_31.1: @Test.%.loc32_31.15 (%.c3e) = impl_witness_access constants.%Destroy.lookup_impl_witness.55f, element0 [symbolic = %impl.elem0.loc32_31.2 (constants.%impl.elem0.38e)] +// CHECK:STDOUT: %bound_method.loc32_31.7: = bound_method %var, %impl.elem0.loc32_31.1 +// CHECK:STDOUT: %specific_impl_fn.loc32_31.3: = specific_impl_function %impl.elem0.loc32_31.1, @Destroy.WithSelf.Op(constants.%impl.elem1.b38) [symbolic = %specific_impl_fn.loc32_31.6 (constants.%specific_impl_fn.3a8)] +// CHECK:STDOUT: %bound_method.loc32_31.8: = bound_method %var, %specific_impl_fn.loc32_31.3 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc32_31.8(%var) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.1(%self.param: ref %MaybeUnformed.d14) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.2(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.3(%self.param: ref %struct_type.value.has_value.330) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.4(%self.param: ref %DefaultOptionalStorage.046) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc32_31.5(%self.param: ref %Optional.68d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%R.bd8) { +// CHECK:STDOUT: %R.loc28_10.1 => constants.%R.bd8 +// CHECK:STDOUT: %R.as_type.loc28_67.1 => constants.%R.as_type.e1d +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.b93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_todo_adl_overloads.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] +// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %facet_type: type = facet_type <@Destroy & @Copy> [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %T.4e7: %OptionalStorage.type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %Optional.Get.type.d22: type = fn_type @Optional.Get, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.Get.6fc: %Optional.Get.type.d22 = struct_value () [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.498: type = fn_type @Optional.HasValue, @Optional(%T.4e7) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.bf8: %Optional.HasValue.type.498 = struct_value () [symbolic] +// CHECK:STDOUT: %T.cb0: %facet_type = symbolic_binding T, 0 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.f8b: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.type.46f: type = fn_type @T.as_type.as.OptionalStorage.impl.Get, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Get.8c2: %T.as_type.as.OptionalStorage.impl.Get.type.46f = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.type.0ae: type = fn_type @T.as_type.as.OptionalStorage.impl.Has, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Has.e0f: %T.as_type.as.OptionalStorage.impl.Has.type.0ae = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.type.87a: type = fn_type @T.as_type.as.OptionalStorage.impl.Some, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.Some.898: %T.as_type.as.OptionalStorage.impl.Some.type.87a = struct_value () [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.type.ceb: type = fn_type @T.as_type.as.OptionalStorage.impl.None, @T.as_type.as.OptionalStorage.impl(%T.cb0) [symbolic] +// CHECK:STDOUT: %T.as_type.as.OptionalStorage.impl.None.9dd: %T.as_type.as.OptionalStorage.impl.None.type.ceb = struct_value () [symbolic] +// CHECK:STDOUT: %.Self.e31: %Iterate.type = symbolic_binding .Self [symbolic_self] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.732: = lookup_impl_witness %.Self.e31, @Iterate [symbolic_self] +// CHECK:STDOUT: %impl.elem0.03d: %facet_type = impl_witness_access %Iterate.lookup_impl_witness.732, element0 [symbolic_self] +// CHECK:STDOUT: %ValueType: type = class_type @ValueType [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.94b: type = pattern_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor.type: type = fn_type @ValueType.cpp_destructor [concrete] +// CHECK:STDOUT: %ValueType.cpp_destructor: %ValueType.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %ValueType.Op.type.bd116f.1: type = fn_type @ValueType.Op.1 [concrete] +// CHECK:STDOUT: %ValueType.Op.1edc3c.1: %ValueType.Op.type.bd116f.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.031: = custom_witness (%ValueType.Op.1edc3c.1), @Destroy [concrete] +// CHECK:STDOUT: %const.e15: type = const_type %ValueType [concrete] +// CHECK:STDOUT: %ptr.140: type = ptr_type %const.e15 [concrete] +// CHECK:STDOUT: %ptr.fed: type = ptr_type %ValueType [concrete] +// CHECK:STDOUT: %ValueType.Op.type.bd116f.2: type = fn_type @ValueType.Op.2 [concrete] +// CHECK:STDOUT: %ValueType.Op.1edc3c.2: %ValueType.Op.type.bd116f.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.d86: = custom_witness (%ValueType.Op.1edc3c.2), @Copy [concrete] +// CHECK:STDOUT: %facet_value.95f: %facet_type = facet_value %ValueType, (%custom_witness.031, %custom_witness.d86) [concrete] +// CHECK:STDOUT: %Iterate_where.type.6d9: type = facet_type <@Iterate where %impl.elem0.03d = %facet_value.95f> [concrete] +// CHECK:STDOUT: %R.bd8: %Iterate_where.type.6d9 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %R.as_type.e1d: type = facet_access_type %R.bd8 [symbolic] +// CHECK:STDOUT: %pattern_type.b93: type = pattern_type %R.as_type.e1d [symbolic] // CHECK:STDOUT: %CppRangeForIterate.type: type = facet_type <@CppRangeForIterate> [concrete] -// CHECK:STDOUT: %Self.6c6: %CppRangeForIterate.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.056be7.1: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.a331a3.1: %CppRangeForIterate.WithSelf.End.type.056be7.1 = struct_value () [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.753895.1: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%Self.6c6) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.2b31f7.1: %CppRangeForIterate.WithSelf.Begin.type.753895.1 = struct_value () [symbolic] // CHECK:STDOUT: %.Self.10b: %CppRangeForIterate.type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate.assoc_type: type = assoc_entity_type @CppRangeForIterate [concrete] // CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.5bf: = lookup_impl_witness %.Self.10b, @CppRangeForIterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.d47: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element0 [symbolic_self] -// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.bce: = lookup_impl_witness %impl.elem0.d47, @CppUnsafeDeref [symbolic_self] +// CHECK:STDOUT: %impl.elem0.c87: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.bce, element0 [symbolic_self] // CHECK:STDOUT: %impl.elem1.846: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.5bf, element1 [symbolic_self] -// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem1.846 impls @Destroy> [concrete] -// CHECK:STDOUT: %R: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] -// CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.26c6ea.2: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %assoc2: %CppRangeForIterate.assoc_type = assoc_entity element2, imports.%Core.import_ref.213 [concrete] -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R, @CppRangeForIterate [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.facet.0d2: %CppRangeForIterate.type = facet_value %R.as_type, (%CppRangeForIterate.lookup_impl_witness.edd1fe.2) [symbolic] -// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate_where.type: type = facet_type <@CppRangeForIterate where %impl.elem0.d47 impls @Destroy and %impl.elem0.d47 impls @Copy and %impl.elem0.d47 impls @CppUnsafeDeref and %impl.elem0.d47 impls @EqWith, @EqWith(%impl.elem1.846) and %impl.elem0.d47 impls @Inc and %impl.elem0.c87 impls @Destroy and %impl.elem0.c87 impls @Copy and %impl.elem1.846 impls @Destroy and %impl.elem1.846 impls @Copy> [concrete] +// CHECK:STDOUT: %R.6c6: %CppRangeForIterate_where.type = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness.edd1fe.2: = lookup_impl_witness %R.6c6, @CppRangeForIterate [symbolic] // CHECK:STDOUT: %impl.elem1.bdcd2d.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element1 [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.57e: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.04d: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %.b85: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.57e, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem2: %.b85 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c0f: = specific_impl_function %impl.elem2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %assoc3: %CppRangeForIterate.assoc_type = assoc_entity element3, imports.%Core.import_ref.730 [concrete] -// CHECK:STDOUT: %.b40: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.04d, %CppRangeForIterate.facet.0d2 [symbolic] -// CHECK:STDOUT: %impl.elem3: %.b40 = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.d6a: = specific_impl_function %impl.elem3, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet.0d2) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.a8f: = lookup_impl_witness %impl.elem1.bdcd2d.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.543: %Destroy.type = facet_value %impl.elem1.bdcd2d.2, (%Destroy.lookup_impl_witness.a8f) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.366: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %.b83: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.366, %Destroy.facet.543 [symbolic] -// CHECK:STDOUT: %impl.elem0.acf: %.b83 = impl_witness_access %Destroy.lookup_impl_witness.a8f, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.add: = specific_impl_function %impl.elem0.acf, @Destroy.WithSelf.Op(%Destroy.facet.543) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.089: = lookup_impl_witness %impl.elem0.d5966e.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.5e8: %Destroy.type = facet_value %impl.elem0.d5966e.2, (%Destroy.lookup_impl_witness.089) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.7cb: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.5e8) [symbolic] -// CHECK:STDOUT: %.a68: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.7cb, %Destroy.facet.5e8 [symbolic] -// CHECK:STDOUT: %impl.elem0.f59: %.a68 = impl_witness_access %Destroy.lookup_impl_witness.089, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.f06: = specific_impl_function %impl.elem0.f59, @Destroy.WithSelf.Op(%Destroy.facet.5e8) [symbolic] +// CHECK:STDOUT: %impl.elem0.d5966e.2: type = impl_witness_access %CppRangeForIterate.lookup_impl_witness.edd1fe.2, element0 [symbolic] +// CHECK:STDOUT: %tuple.type.384: type = tuple_type (%impl.elem0.d5966e.2, %impl.elem1.bdcd2d.2) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.0ba: = lookup_impl_witness %tuple.type.384, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.2fe: %Destroy.type = facet_value %tuple.type.384, (%Destroy.lookup_impl_witness.0ba) [symbolic] +// CHECK:STDOUT: %CppUnsafeDeref.lookup_impl_witness.ca4: = lookup_impl_witness %impl.elem0.d5966e.2, @CppUnsafeDeref [symbolic] +// CHECK:STDOUT: %impl.elem0.b10: type = impl_witness_access %CppUnsafeDeref.lookup_impl_witness.ca4, element0 [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.3d8: = lookup_impl_witness %impl.elem0.b10, @Destroy [symbolic] +// CHECK:STDOUT: %Copy.lookup_impl_witness.bff: = lookup_impl_witness %impl.elem0.b10, @Copy [symbolic] +// CHECK:STDOUT: %facet_value.a30: %facet_type = facet_value %impl.elem0.b10, (%Destroy.lookup_impl_witness.3d8, %Copy.lookup_impl_witness.bff) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.5b5: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.cd2: %R.as_type.as.Iterate.impl.Next.type.5b5 = struct_value () [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.9b6: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%R.6c6) [symbolic] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.b29: %R.as_type.as.Iterate.impl.NewCursor.type.9b6 = struct_value () [symbolic] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.135: = lookup_impl_witness %R.bd8, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.dca: %Iterate.type = facet_value %R.as_type.e1d, (%Iterate.lookup_impl_witness.135) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.842: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.a4d: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %.89c: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.842, %Iterate.facet.dca [symbolic] +// CHECK:STDOUT: %impl.elem2.488: %.89c = impl_witness_access %Iterate.lookup_impl_witness.135, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.b38: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.135, element1 [symbolic] +// CHECK:STDOUT: %as_type.470: type = facet_access_type %impl.elem1.b38 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5a0: = specific_impl_function %impl.elem2.488, @Iterate.WithSelf.NewCursor(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %ptr.ce1: type = ptr_type %as_type.470 [symbolic] +// CHECK:STDOUT: %.503: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.a4d, %Iterate.facet.dca [symbolic] +// CHECK:STDOUT: %impl.elem3.3bc: %.503 = impl_witness_access %Iterate.lookup_impl_witness.135, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.046: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.95f) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.1ee: = impl_witness imports.%OptionalStorage.impl_witness_table.6f7, @T.as_type.as.OptionalStorage.impl(%facet_value.95f) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.7ac: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.1ee) [concrete] +// CHECK:STDOUT: %Optional.fb3: type = class_type @Optional, @Optional(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %specific_impl_fn.7c6: = specific_impl_function %impl.elem3.3bc, @Iterate.WithSelf.Next(%Iterate.facet.dca) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.475: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %Optional.HasValue.c00: %Optional.HasValue.type.475 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.dd5: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %Optional.Get.335: %Optional.Get.type.dd5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.1a4: %Destroy.type = facet_value %ValueType, (%custom_witness.031) [concrete] +// CHECK:STDOUT: %MaybeUnformed.d14: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.1a4) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.330: type = struct_type {.value: %MaybeUnformed.d14, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.c00, @Optional.HasValue(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.335, @Optional.Get(%OptionalStorage.facet.7ac) [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator.type: type = fn_type @ValueType.cpp_operator [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator: %ValueType.cpp_operator.type = struct_value () [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.6: type = fn_type @Destroy.Op.loc39_31.5 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.6: %Destroy.Op.type.790b3b.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.55f: = lookup_impl_witness %impl.elem1.b38, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.567: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1.b38) [symbolic] +// CHECK:STDOUT: %.c3e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.567, %impl.elem1.b38 [symbolic] +// CHECK:STDOUT: %impl.elem0.38e: %.c3e = impl_witness_access %Destroy.lookup_impl_witness.55f, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.3a8: = specific_impl_function %impl.elem0.38e, @Destroy.WithSelf.Op(%impl.elem1.b38) [symbolic] // CHECK:STDOUT: %MutableAndConstRange: type = class_type @MutableAndConstRange [concrete] // CHECK:STDOUT: %pattern_type.e6c: type = pattern_type %MutableAndConstRange [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %Iterator: type = class_type @Iterator.1 [concrete] // CHECK:STDOUT: %Begin.type: type = fn_type @Begin [concrete] // CHECK:STDOUT: %Begin: %Begin.type = struct_value () [concrete] // CHECK:STDOUT: %End.type: type = fn_type @End [concrete] // CHECK:STDOUT: %End: %End.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.af9: = custom_witness (%Iterator, %Iterator, %Begin, %End), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %CppRangeForIterate.facet.18a: %CppRangeForIterate.type = facet_value %MutableAndConstRange, (%custom_witness.af9) [concrete] -// CHECK:STDOUT: %Iterator.Op.type: type = fn_type @Iterator.Op [concrete] -// CHECK:STDOUT: %Iterator.Op: %Iterator.Op.type = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.481: = custom_witness (%Iterator.Op), @Destroy [concrete] -// CHECK:STDOUT: %facet_value: %CppRangeForIterate_where.type = facet_value %MutableAndConstRange, (%custom_witness.af9, %custom_witness.481) [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type.3c7: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.18a) [concrete] -// CHECK:STDOUT: %.1b5: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type.3c7, %CppRangeForIterate.facet.18a [concrete] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type.011: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet.18a) [concrete] -// CHECK:STDOUT: %.fea: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type.011, %CppRangeForIterate.facet.18a [concrete] -// CHECK:STDOUT: %Destroy.facet.5e7: %Destroy.type = facet_value %Iterator, (%custom_witness.481) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.594: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.5e7) [concrete] -// CHECK:STDOUT: %.659: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.594, %Destroy.facet.5e7 [concrete] +// CHECK:STDOUT: %Iterator.Op.type.152308.1: type = fn_type @Iterator.Op.1 [concrete] +// CHECK:STDOUT: %Iterator.Op.b8fe13.1: %Iterator.Op.type.152308.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.016: = custom_witness (%ValueType, %Iterator.Op.b8fe13.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Iterator.Op.type.152308.2: type = fn_type @Iterator.Op.2 [concrete] +// CHECK:STDOUT: %Iterator.Op.b8fe13.2: %Iterator.Op.type.152308.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.481: = custom_witness (%Iterator.Op.b8fe13.2), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.152308.3: type = fn_type @Iterator.Op.3 [concrete] +// CHECK:STDOUT: %Iterator.Op.b8fe13.3: %Iterator.Op.type.152308.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.307: = custom_witness (%Iterator.Op.b8fe13.3), @Copy [concrete] +// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] +// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] +// CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] +// CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.571: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Iterator) [concrete] +// CHECK:STDOUT: %Iterator.Op.type.152308.4: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.b8fe13.4: %Iterator.Op.type.152308.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.6de: = custom_witness (%Iterator.Op.b8fe13.4), @Inc [concrete] +// CHECK:STDOUT: %facet_value.7d8: %CppRangeForIterate_where.type = facet_value %MutableAndConstRange, (%custom_witness.031, %custom_witness.d86, %custom_witness.af9, %custom_witness.481, %custom_witness.307, %custom_witness.016, %custom_witness.571, %custom_witness.6de) [concrete] +// CHECK:STDOUT: %tuple.type.084: type = tuple_type (%Iterator, %Iterator) [concrete] +// CHECK:STDOUT: %Destroy.Op.type.790b3b.7: type = fn_type @Destroy.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.Op.2dd605.7: %Destroy.Op.type.790b3b.7 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e20f1f.7: = custom_witness (%Destroy.Op.2dd605.7), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.da4: %Destroy.type = facet_value %tuple.type.084, (%custom_witness.e20f1f.7) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.902: = impl_witness imports.%Iterate.impl_witness_table.9f0, @R.as_type.as.Iterate.impl(%facet_value.7d8) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.type.377: type = fn_type @R.as_type.as.Iterate.impl.NewCursor, @R.as_type.as.Iterate.impl(%facet_value.7d8) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.310: %R.as_type.as.Iterate.impl.NewCursor.type.377 = struct_value () [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.type.3d2: type = fn_type @R.as_type.as.Iterate.impl.Next, @R.as_type.as.Iterate.impl(%facet_value.7d8) [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.06d: %R.as_type.as.Iterate.impl.Next.type.3d2 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.227: %Iterate.type = facet_value %MutableAndConstRange, (%Iterate.impl_witness.902) [concrete] +// CHECK:STDOUT: %facet_value.8e0: %Iterate_where.type.6d9 = facet_value %MutableAndConstRange, (%Iterate.impl_witness.902) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.087: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.227) [concrete] +// CHECK:STDOUT: %.4d4: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.087, %Iterate.facet.227 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %R.as_type.as.Iterate.impl.NewCursor.310, @R.as_type.as.Iterate.impl.NewCursor(%facet_value.7d8) [concrete] +// CHECK:STDOUT: %complete_type.7b5: = complete_type_witness %tuple.type.084 [concrete] +// CHECK:STDOUT: %ptr.877: type = ptr_type %tuple.type.084 [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.f81: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.227) [concrete] +// CHECK:STDOUT: %.728: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.f81, %Iterate.facet.227 [concrete] +// CHECK:STDOUT: %R.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %R.as_type.as.Iterate.impl.Next.06d, @R.as_type.as.Iterate.impl.Next(%facet_value.7d8) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.1ee: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.da4) [concrete] +// CHECK:STDOUT: %.e5c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.1ee, %Destroy.facet.da4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.735: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] -// CHECK:STDOUT: %Core.import_ref.572: %CppRangeForIterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc3] -// CHECK:STDOUT: %Core.import_ref.213: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin.type (%CppRangeForIterate.WithSelf.Begin.type.753895.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.Begin (constants.%CppRangeForIterate.WithSelf.Begin.2b31f7.1)] -// CHECK:STDOUT: %Core.import_ref.730: @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End.type (%CppRangeForIterate.WithSelf.End.type.056be7.1) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @CppRangeForIterate.WithSelf.%CppRangeForIterate.WithSelf.End (constants.%CppRangeForIterate.WithSelf.End.a331a3.1)] +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.0b9: @Optional.%Optional.HasValue.type (%Optional.HasValue.type.498) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.HasValue (constants.%Optional.HasValue.bf8)] +// CHECK:STDOUT: %Core.import_ref.61f: @Optional.%Optional.Get.type (%Optional.Get.type.d22) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @Optional.%Optional.Get (constants.%Optional.Get.6fc)] +// CHECK:STDOUT: %Core.import_ref.2b5: type = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%DefaultOptionalStorage (constants.%DefaultOptionalStorage.f8b)] +// CHECK:STDOUT: %Core.import_ref.b0a: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None.type (%T.as_type.as.OptionalStorage.impl.None.type.ceb) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.None (constants.%T.as_type.as.OptionalStorage.impl.None.9dd)] +// CHECK:STDOUT: %Core.import_ref.3fc: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some.type (%T.as_type.as.OptionalStorage.impl.Some.type.87a) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Some (constants.%T.as_type.as.OptionalStorage.impl.Some.898)] +// CHECK:STDOUT: %Core.import_ref.986: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has.type (%T.as_type.as.OptionalStorage.impl.Has.type.0ae) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Has (constants.%T.as_type.as.OptionalStorage.impl.Has.e0f)] +// CHECK:STDOUT: %Core.import_ref.557: @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get.type (%T.as_type.as.OptionalStorage.impl.Get.type.46f) = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], loaded [symbolic = @T.as_type.as.OptionalStorage.impl.%T.as_type.as.OptionalStorage.impl.Get (constants.%T.as_type.as.OptionalStorage.impl.Get.8c2)] +// CHECK:STDOUT: %Core.import_ref.999 = import_ref Core//prelude/iterate, inst{{[0-9A-F]+}} [indirect], unloaded +// CHECK:STDOUT: %OptionalStorage.impl_witness_table.6f7 = impl_witness_table (%Core.import_ref.2b5, %Core.import_ref.b0a, %Core.import_ref.3fc, %Core.import_ref.986, %Core.import_ref.557, %Core.import_ref.999), @T.as_type.as.OptionalStorage.impl [concrete] +// CHECK:STDOUT: %N: = namespace [concrete] { +// CHECK:STDOUT: .ValueType = %ValueType.decl +// CHECK:STDOUT: .MutableAndConstRange = %MutableAndConstRange.decl +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %ValueType.decl: type = class_decl @ValueType [concrete = constants.%ValueType] {} {} +// CHECK:STDOUT: %ValueType.cpp_destructor.decl: %ValueType.cpp_destructor.type = fn_decl @ValueType.cpp_destructor [concrete = constants.%ValueType.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.89a: %facet_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%facet_value (constants.%facet_value.a30)] +// CHECK:STDOUT: %Core.import_ref.9ea: %Destroy.type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%Destroy.facet (constants.%Destroy.facet.2fe)] +// CHECK:STDOUT: %Core.import_ref.a6c: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor.type (%R.as_type.as.Iterate.impl.NewCursor.type.9b6) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.NewCursor (constants.%R.as_type.as.Iterate.impl.NewCursor.b29)] +// CHECK:STDOUT: %Core.import_ref.a02: @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next.type (%R.as_type.as.Iterate.impl.Next.type.5b5) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @R.as_type.as.Iterate.impl.%R.as_type.as.Iterate.impl.Next (constants.%R.as_type.as.Iterate.impl.Next.cd2)] +// CHECK:STDOUT: %Iterate.impl_witness_table.9f0 = impl_witness_table (%Core.import_ref.89a, %Core.import_ref.9ea, %Core.import_ref.a6c, %Core.import_ref.a02), @R.as_type.as.Iterate.impl [concrete] +// CHECK:STDOUT: %ValueType.cpp_operator.decl: %ValueType.cpp_operator.type = fn_decl @ValueType.cpp_operator [concrete = constants.%ValueType.cpp_operator] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %MutableAndConstRange.decl: type = class_decl @MutableAndConstRange [concrete = constants.%MutableAndConstRange] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Test(%R.loc32_10.2: %CppRangeForIterate_where.type) { +// CHECK:STDOUT: generic fn @Test(%R.loc35_10.2: %Iterate_where.type.6d9) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness: = lookup_impl_witness %R.loc32_10.1, @CppRangeForIterate [symbolic = %CppRangeForIterate.lookup_impl_witness (constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2)] -// CHECK:STDOUT: %CppRangeForIterate.facet: %CppRangeForIterate.type = facet_value %R.as_type.loc32_113.1, (%CppRangeForIterate.lookup_impl_witness) [symbolic = %CppRangeForIterate.facet (constants.%CppRangeForIterate.facet.0d2)] -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type: type = fn_type @CppRangeForIterate.WithSelf.Begin, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.Begin.type (constants.%CppRangeForIterate.WithSelf.Begin.type.57e)] -// CHECK:STDOUT: %.loc34_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.Begin.type, %CppRangeForIterate.facet [symbolic = %.loc34_4 (constants.%.b85)] -// CHECK:STDOUT: %impl.elem2.loc34_4.2: @Test.%.loc34_4 (%.b85) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %specific_impl_fn.loc34_4.2: = specific_impl_function %impl.elem2.loc34_4.2, @CppRangeForIterate.WithSelf.Begin(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.c0f)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc35_10.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.135)] +// CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %R.as_type.loc35_67.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet (constants.%Iterate.facet.dca)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.842)] +// CHECK:STDOUT: %.loc39_31.13: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet [symbolic = %.loc39_31.13 (constants.%.89c)] +// CHECK:STDOUT: %impl.elem2.loc39_31.2: @Test.%.loc39_31.13 (%.89c) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc39_31.2 (constants.%impl.elem2.488)] +// CHECK:STDOUT: %specific_impl_fn.loc39_31.4: = specific_impl_function %impl.elem2.loc39_31.2, @Iterate.WithSelf.NewCursor(%Iterate.facet) [symbolic = %specific_impl_fn.loc39_31.4 (constants.%specific_impl_fn.5a0)] // CHECK:STDOUT: -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type: type = fn_type @CppRangeForIterate.WithSelf.End, @CppRangeForIterate.WithSelf(%CppRangeForIterate.facet) [symbolic = %CppRangeForIterate.WithSelf.End.type (constants.%CppRangeForIterate.WithSelf.End.type.04d)] -// CHECK:STDOUT: %.loc35_4: type = fn_type_with_self_type %CppRangeForIterate.WithSelf.End.type, %CppRangeForIterate.facet [symbolic = %.loc35_4 (constants.%.b40)] -// CHECK:STDOUT: %impl.elem3.loc35_4.2: @Test.%.loc35_4 (%.b40) = impl_witness_access %CppRangeForIterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc35_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %specific_impl_fn.loc35_4.2: = specific_impl_function %impl.elem3.loc35_4.2, @CppRangeForIterate.WithSelf.End(%CppRangeForIterate.facet) [symbolic = %specific_impl_fn.loc35_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc35: = lookup_impl_witness %impl.elem1.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc35 (constants.%Destroy.lookup_impl_witness.a8f)] -// CHECK:STDOUT: %Destroy.facet.loc35: %Destroy.type = facet_value %impl.elem1.1, (%Destroy.lookup_impl_witness.loc35) [symbolic = %Destroy.facet.loc35 (constants.%Destroy.facet.543)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc35: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc35) [symbolic = %Destroy.WithSelf.Op.type.loc35 (constants.%Destroy.WithSelf.Op.type.366)] -// CHECK:STDOUT: %.loc35_9.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc35, %Destroy.facet.loc35 [symbolic = %.loc35_9.3 (constants.%.b83)] -// CHECK:STDOUT: %impl.elem0.loc35_9.2: @Test.%.loc35_9.3 (%.b83) = impl_witness_access %Destroy.lookup_impl_witness.loc35, element0 [symbolic = %impl.elem0.loc35_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %specific_impl_fn.loc35_9.2: = specific_impl_function %impl.elem0.loc35_9.2, @Destroy.WithSelf.Op(%Destroy.facet.loc35) [symbolic = %specific_impl_fn.loc35_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc34: = lookup_impl_witness %impl.elem0.1, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc34 (constants.%Destroy.lookup_impl_witness.089)] -// CHECK:STDOUT: %Destroy.facet.loc34: %Destroy.type = facet_value %impl.elem0.1, (%Destroy.lookup_impl_witness.loc34) [symbolic = %Destroy.facet.loc34 (constants.%Destroy.facet.5e8)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc34: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc34) [symbolic = %Destroy.WithSelf.Op.type.loc34 (constants.%Destroy.WithSelf.Op.type.7cb)] -// CHECK:STDOUT: %.loc34_11.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc34, %Destroy.facet.loc34 [symbolic = %.loc34_11.3 (constants.%.a68)] -// CHECK:STDOUT: %impl.elem0.loc34_11.2: @Test.%.loc34_11.3 (%.a68) = impl_witness_access %Destroy.lookup_impl_witness.loc34, element0 [symbolic = %impl.elem0.loc34_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %specific_impl_fn.loc34_11.2: = specific_impl_function %impl.elem0.loc34_11.2, @Destroy.WithSelf.Op(%Destroy.facet.loc34) [symbolic = %specific_impl_fn.loc34_11.2 (constants.%specific_impl_fn.f06)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.ce1)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.a4d)] +// CHECK:STDOUT: %.loc39_31.14: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet [symbolic = %.loc39_31.14 (constants.%.503)] +// CHECK:STDOUT: %impl.elem3.loc39_31.2: @Test.%.loc39_31.14 (%.503) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc39_31.2 (constants.%impl.elem3.3bc)] +// CHECK:STDOUT: %specific_impl_fn.loc39_31.5: = specific_impl_function %impl.elem3.loc39_31.2, @Iterate.WithSelf.Next(%Iterate.facet) [symbolic = %specific_impl_fn.loc39_31.5 (constants.%specific_impl_fn.7c6)] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.567)] +// CHECK:STDOUT: %.loc39_31.15: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc39_31.15 (constants.%.c3e)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.55f)] +// CHECK:STDOUT: %impl.elem0.loc39_31.2: @Test.%.loc39_31.15 (%.c3e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc39_31.2 (constants.%impl.elem0.38e)] +// CHECK:STDOUT: %specific_impl_fn.loc39_31.6: = specific_impl_function %impl.elem0.loc39_31.2, @Destroy.WithSelf.Op(%impl.elem1) [symbolic = %specific_impl_fn.loc39_31.6 (constants.%specific_impl_fn.3a8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%r.param: ref @Test.%R.as_type.loc32_113.1 (%R.as_type)) { +// CHECK:STDOUT: fn(%r.param: @Test.%R.as_type.loc35_67.1 (%R.as_type.e1d)) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %r.ref.loc34: ref @Test.%R.as_type.loc32_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %Begin.ref: %CppRangeForIterate.assoc_type = name_ref Begin, imports.%Core.import_ref.735 [concrete = constants.%assoc2] -// CHECK:STDOUT: %impl.elem2.loc34_4.1: @Test.%.loc34_4 (%.b85) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element2 [symbolic = %impl.elem2.loc34_4.2 (constants.%impl.elem2)] -// CHECK:STDOUT: %bound_method.loc34_4: = bound_method %r.ref.loc34, %impl.elem2.loc34_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc34_4.1: = specific_impl_function %impl.elem2.loc34_4.1, @CppRangeForIterate.WithSelf.Begin(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc34_4.2 (constants.%specific_impl_fn.c0f)] -// CHECK:STDOUT: %bound_method.loc34_11.1: = bound_method %r.ref.loc34, %specific_impl_fn.loc34_4.1 -// CHECK:STDOUT: %.loc34_11.1: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.call: init @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) to %.loc34_11.1 = call %bound_method.loc34_11.1(%r.ref.loc34) -// CHECK:STDOUT: %.loc34_11.2: ref @Test.%impl.elem0.1 (%impl.elem0.d5966e.2) = temporary %.loc34_11.1, %CppRangeForIterate.WithSelf.Begin.call -// CHECK:STDOUT: %r.ref.loc35: ref @Test.%R.as_type.loc32_113.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %End.ref: %CppRangeForIterate.assoc_type = name_ref End, imports.%Core.import_ref.572 [concrete = constants.%assoc3] -// CHECK:STDOUT: %impl.elem3.loc35_4.1: @Test.%.loc35_4 (%.b40) = impl_witness_access constants.%CppRangeForIterate.lookup_impl_witness.edd1fe.2, element3 [symbolic = %impl.elem3.loc35_4.2 (constants.%impl.elem3)] -// CHECK:STDOUT: %bound_method.loc35_4: = bound_method %r.ref.loc35, %impl.elem3.loc35_4.1 -// CHECK:STDOUT: %specific_impl_fn.loc35_4.1: = specific_impl_function %impl.elem3.loc35_4.1, @CppRangeForIterate.WithSelf.End(constants.%CppRangeForIterate.facet.0d2) [symbolic = %specific_impl_fn.loc35_4.2 (constants.%specific_impl_fn.d6a)] -// CHECK:STDOUT: %bound_method.loc35_9.1: = bound_method %r.ref.loc35, %specific_impl_fn.loc35_4.1 -// CHECK:STDOUT: %.loc35_9.1: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary_storage -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.call: init @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) to %.loc35_9.1 = call %bound_method.loc35_9.1(%r.ref.loc35) -// CHECK:STDOUT: %.loc35_9.2: ref @Test.%impl.elem1.1 (%impl.elem1.bdcd2d.2) = temporary %.loc35_9.1, %CppRangeForIterate.WithSelf.End.call -// CHECK:STDOUT: %impl.elem0.loc35_9.1: @Test.%.loc35_9.3 (%.b83) = impl_witness_access constants.%Destroy.lookup_impl_witness.a8f, element0 [symbolic = %impl.elem0.loc35_9.2 (constants.%impl.elem0.acf)] -// CHECK:STDOUT: %bound_method.loc35_9.2: = bound_method %.loc35_9.2, %impl.elem0.loc35_9.1 -// CHECK:STDOUT: %specific_impl_fn.loc35_9.1: = specific_impl_function %impl.elem0.loc35_9.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.543) [symbolic = %specific_impl_fn.loc35_9.2 (constants.%specific_impl_fn.add)] -// CHECK:STDOUT: %bound_method.loc35_9.3: = bound_method %.loc35_9.2, %specific_impl_fn.loc35_9.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc35: init %empty_tuple.type = call %bound_method.loc35_9.3(%.loc35_9.2) -// CHECK:STDOUT: %impl.elem0.loc34_11.1: @Test.%.loc34_11.3 (%.a68) = impl_witness_access constants.%Destroy.lookup_impl_witness.089, element0 [symbolic = %impl.elem0.loc34_11.2 (constants.%impl.elem0.f59)] -// CHECK:STDOUT: %bound_method.loc34_11.2: = bound_method %.loc34_11.2, %impl.elem0.loc34_11.1 -// CHECK:STDOUT: %specific_impl_fn.loc34_11.1: = specific_impl_function %impl.elem0.loc34_11.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.5e8) [symbolic = %specific_impl_fn.loc34_11.2 (constants.%specific_impl_fn.f06)] -// CHECK:STDOUT: %bound_method.loc34_11.3: = bound_method %.loc34_11.2, %specific_impl_fn.loc34_11.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34: init %empty_tuple.type = call %bound_method.loc34_11.3(%.loc34_11.2) +// CHECK:STDOUT: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %i.patt: %pattern_type.94b = value_binding_pattern i [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %r.ref: @Test.%R.as_type.loc35_67.1 (%R.as_type.e1d) = name_ref r, %r +// CHECK:STDOUT: %impl.elem2.loc39_31.1: @Test.%.loc39_31.13 (%.89c) = impl_witness_access constants.%Iterate.lookup_impl_witness.135, element2 [symbolic = %impl.elem2.loc39_31.2 (constants.%impl.elem2.488)] +// CHECK:STDOUT: %bound_method.loc39_31.1: = bound_method %r.ref, %impl.elem2.loc39_31.1 +// CHECK:STDOUT: %specific_impl_fn.loc39_31.1: = specific_impl_function %impl.elem2.loc39_31.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.dca) [symbolic = %specific_impl_fn.loc39_31.4 (constants.%specific_impl_fn.5a0)] +// CHECK:STDOUT: %bound_method.loc39_31.2: = bound_method %r.ref, %specific_impl_fn.loc39_31.1 +// CHECK:STDOUT: %var: ref @Test.%as_type (%as_type.470) = var invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @Test.%as_type (%as_type.470) to %var = call %bound_method.loc39_31.2(%r.ref) +// CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.next: +// CHECK:STDOUT: %addr.loc39: @Test.%ptr (%ptr.ce1) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc39_31.1: @Test.%.loc39_31.14 (%.503) = impl_witness_access constants.%Iterate.lookup_impl_witness.135, element3 [symbolic = %impl.elem3.loc39_31.2 (constants.%impl.elem3.3bc)] +// CHECK:STDOUT: %bound_method.loc39_31.3: = bound_method %r.ref, %impl.elem3.loc39_31.1 +// CHECK:STDOUT: %.loc39_31.1: %Destroy.type = converted constants.%as_type.470, constants.%impl.elem1.b38 [symbolic = %impl.elem1 (constants.%impl.elem1.b38)] +// CHECK:STDOUT: %specific_impl_fn.loc39_31.2: = specific_impl_function %impl.elem3.loc39_31.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.dca) [symbolic = %specific_impl_fn.loc39_31.5 (constants.%specific_impl_fn.7c6)] +// CHECK:STDOUT: %bound_method.loc39_31.4: = bound_method %r.ref, %specific_impl_fn.loc39_31.2 +// CHECK:STDOUT: %.loc39_31.2: ref %Optional.fb3 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.fb3 to %.loc39_31.2 = call %bound_method.loc39_31.4(%r.ref, %addr.loc39) +// CHECK:STDOUT: %.loc39_31.3: ref %Optional.fb3 = temporary %.loc39_31.2, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc39_31.4: %Optional.HasValue.type.475 = specific_constant imports.%Core.import_ref.0b9, @Optional(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.HasValue.c00] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.475 = name_ref HasValue, %.loc39_31.4 [concrete = constants.%Optional.HasValue.c00] +// CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc39_31.3, %HasValue.ref +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %bound_method.loc39_31.5: = bound_method %.loc39_31.3, %Optional.HasValue.specific_fn +// CHECK:STDOUT: %.loc39_31.5: %Optional.fb3 = acquire_value %.loc39_31.3 +// CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc39_31.5(%.loc39_31.5) +// CHECK:STDOUT: %.loc39_31.6: bool = value_of_initializer %Optional.HasValue.call +// CHECK:STDOUT: %.loc39_31.7: bool = converted %Optional.HasValue.call, %.loc39_31.6 +// CHECK:STDOUT: if %.loc39_31.7 br !for.body else br !for.done +// CHECK:STDOUT: +// CHECK:STDOUT: !for.body: +// CHECK:STDOUT: %.loc39_31.8: %Optional.Get.type.dd5 = specific_constant imports.%Core.import_ref.61f, @Optional(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.Get.335] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.dd5 = name_ref Get, %.loc39_31.8 [concrete = constants.%Optional.Get.335] +// CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc39_31.3, %Get.ref +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.7ac) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %bound_method.loc39_31.6: = bound_method %.loc39_31.3, %Optional.Get.specific_fn +// CHECK:STDOUT: %.loc39_31.9: ref %ValueType = temporary_storage +// CHECK:STDOUT: %.loc39_31.10: %Optional.fb3 = acquire_value %.loc39_31.3 +// CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc39_31.9 = call %bound_method.loc39_31.6(%.loc39_31.10) +// CHECK:STDOUT: %.loc39_16: type = splice_block %ValueType.ref.loc39 [concrete = constants.%ValueType] { +// CHECK:STDOUT: %Cpp.ref.loc39: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %N.ref.loc39: = name_ref N, imports.%N [concrete = imports.%N] +// CHECK:STDOUT: %ValueType.ref.loc39: type = name_ref ValueType, imports.%ValueType.decl [concrete = constants.%ValueType] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc39_31.11: ref %ValueType = temporary %.loc39_31.9, %Optional.Get.call +// CHECK:STDOUT: %.loc39_31.12: %ValueType = acquire_value %.loc39_31.11 +// CHECK:STDOUT: %i: %ValueType = value_binding i, %.loc39_31.12 +// CHECK:STDOUT: %sum.ref: ref %ValueType = name_ref sum, %sum +// CHECK:STDOUT: %i.ref: %ValueType = name_ref i, %i +// CHECK:STDOUT: %ValueType.cpp_operator.bound: = bound_method %sum.ref, imports.%ValueType.cpp_operator.decl +// CHECK:STDOUT: %.loc40_12: ref %ValueType = value_as_ref %i.ref +// CHECK:STDOUT: %addr.loc40: %ptr.fed = addr_of %.loc40_12 +// CHECK:STDOUT: %.loc40_9.1: %ptr.140 = as_compatible %addr.loc40 +// CHECK:STDOUT: %.loc40_9.2: %ptr.140 = converted %addr.loc40, %.loc40_9.1 +// CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc40_9.2) +// CHECK:STDOUT: br !for.next +// CHECK:STDOUT: +// CHECK:STDOUT: !for.done: +// CHECK:STDOUT: %ValueType.Op.bound.loc39: = bound_method %.loc39_31.11, constants.%ValueType.Op.1edc3c.1 +// CHECK:STDOUT: %Op.ref.loc39: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] +// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc39: = bound_method %.loc39_31.11, %Op.ref.loc39 +// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc39: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc39(%.loc39_31.11) +// CHECK:STDOUT: %Destroy.Op.bound: = bound_method %.loc39_31.3, constants.%Destroy.Op.2dd605.6 +// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc39_31.3) +// CHECK:STDOUT: %impl.elem0.loc39_31.1: @Test.%.loc39_31.15 (%.c3e) = impl_witness_access constants.%Destroy.lookup_impl_witness.55f, element0 [symbolic = %impl.elem0.loc39_31.2 (constants.%impl.elem0.38e)] +// CHECK:STDOUT: %bound_method.loc39_31.7: = bound_method %var, %impl.elem0.loc39_31.1 +// CHECK:STDOUT: %specific_impl_fn.loc39_31.3: = specific_impl_function %impl.elem0.loc39_31.1, @Destroy.WithSelf.Op(constants.%impl.elem1.b38) [symbolic = %specific_impl_fn.loc39_31.6 (constants.%specific_impl_fn.3a8)] +// CHECK:STDOUT: %bound_method.loc39_31.8: = bound_method %var, %specific_impl_fn.loc39_31.3 +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc39_31.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%R) { -// CHECK:STDOUT: %R.loc32_10.1 => constants.%R -// CHECK:STDOUT: %R.as_type.loc32_113.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.26c6ea.2 +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.1(%self.param: ref %MaybeUnformed.d14) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%facet_value) { -// CHECK:STDOUT: %R.loc32_10.1 => constants.%facet_value -// CHECK:STDOUT: %R.as_type.loc32_113.1 => constants.%MutableAndConstRange +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.2(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.3(%self.param: ref %struct_type.value.has_value.330) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.4(%self.param: ref %DefaultOptionalStorage.046) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.Op.loc39_31.5(%self.param: ref %Optional.fb3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%R.bd8) { +// CHECK:STDOUT: %R.loc35_10.1 => constants.%R.bd8 +// CHECK:STDOUT: %R.as_type.loc35_67.1 => constants.%R.as_type.e1d +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.b93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Test(constants.%facet_value.8e0) { +// CHECK:STDOUT: %R.loc35_10.1 => constants.%facet_value.8e0 +// CHECK:STDOUT: %R.as_type.loc35_67.1 => constants.%MutableAndConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e6c // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete.loc32 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.lookup_impl_witness => constants.%custom_witness.af9 -// CHECK:STDOUT: %CppRangeForIterate.facet => constants.%CppRangeForIterate.facet.18a -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.Begin.type => constants.%CppRangeForIterate.WithSelf.Begin.type.3c7 -// CHECK:STDOUT: %.loc34_4 => constants.%.1b5 -// CHECK:STDOUT: %impl.elem2.loc34_4.2 => constants.%Begin -// CHECK:STDOUT: %specific_impl_fn.loc34_4.2 => constants.%Begin -// CHECK:STDOUT: %impl.elem0.1 => constants.%Iterator -// CHECK:STDOUT: %require_complete.1 => constants.%complete_type -// CHECK:STDOUT: %CppRangeForIterate.WithSelf.End.type => constants.%CppRangeForIterate.WithSelf.End.type.011 -// CHECK:STDOUT: %.loc35_4 => constants.%.fea -// CHECK:STDOUT: %impl.elem3.loc35_4.2 => constants.%End -// CHECK:STDOUT: %specific_impl_fn.loc35_4.2 => constants.%End -// CHECK:STDOUT: %impl.elem1.1 => constants.%Iterator -// CHECK:STDOUT: %require_complete.2 => constants.%complete_type -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc35 => constants.%custom_witness.481 -// CHECK:STDOUT: %Destroy.facet.loc35 => constants.%Destroy.facet.5e7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc35 => constants.%Destroy.WithSelf.Op.type.594 -// CHECK:STDOUT: %.loc35_9.3 => constants.%.659 -// CHECK:STDOUT: %impl.elem0.loc35_9.2 => constants.%Iterator.Op -// CHECK:STDOUT: %specific_impl_fn.loc35_9.2 => constants.%Iterator.Op -// CHECK:STDOUT: %Destroy.lookup_impl_witness.loc34 => constants.%custom_witness.481 -// CHECK:STDOUT: %Destroy.facet.loc34 => constants.%Destroy.facet.5e7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc34 => constants.%Destroy.WithSelf.Op.type.594 -// CHECK:STDOUT: %.loc34_11.3 => constants.%.659 -// CHECK:STDOUT: %impl.elem0.loc34_11.2 => constants.%Iterator.Op -// CHECK:STDOUT: %specific_impl_fn.loc34_11.2 => constants.%Iterator.Op +// CHECK:STDOUT: %require_complete.loc35 => constants.%complete_type.357 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.902 +// CHECK:STDOUT: %Iterate.facet => constants.%Iterate.facet.227 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.087 +// CHECK:STDOUT: %.loc39_31.13 => constants.%.4d4 +// CHECK:STDOUT: %impl.elem2.loc39_31.2 => constants.%R.as_type.as.Iterate.impl.NewCursor.310 +// CHECK:STDOUT: %specific_impl_fn.loc39_31.4 => constants.%R.as_type.as.Iterate.impl.NewCursor.specific_fn +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.da4 +// CHECK:STDOUT: %as_type => constants.%tuple.type.084 +// CHECK:STDOUT: %require_complete.1 => constants.%complete_type.7b5 +// CHECK:STDOUT: %ptr => constants.%ptr.877 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.f81 +// CHECK:STDOUT: %.loc39_31.14 => constants.%.728 +// CHECK:STDOUT: %impl.elem3.loc39_31.2 => constants.%R.as_type.as.Iterate.impl.Next.06d +// CHECK:STDOUT: %specific_impl_fn.loc39_31.5 => constants.%R.as_type.as.Iterate.impl.Next.specific_fn +// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.1ee +// CHECK:STDOUT: %.loc39_31.15 => constants.%.e5c +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e20f1f.7 +// CHECK:STDOUT: %impl.elem0.loc39_31.2 => constants.%Destroy.Op.2dd605.7 +// CHECK:STDOUT: %specific_impl_fn.loc39_31.6 => constants.%Destroy.Op.2dd605.7 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index 37216bb398ff..85abbb3a7432 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -275,7 +275,7 @@ fn For() { // CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !23 = !{!24} // CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !18, type: !22) -// CHECK:STDOUT: !25 = !DILocation(line: 24, column: 65, scope: !18) +// CHECK:STDOUT: !25 = !DILocation(line: 24, column: 39, scope: !18) // CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bc4985fcac159a9a:core.Destroy.Core", scope: null, file: !3, line: 20, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !27) // CHECK:STDOUT: !27 = !{!28} // CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !22) diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index 91a40ff4970c..91f9835d8501 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -259,7 +259,7 @@ fn For() { // CHECK:STDOUT: !18 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !19 = !{!20} // CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !14, type: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 65, scope: !14) +// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 39, scope: !14) // CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bc4985fcac159a9a:core.Destroy.Core", scope: null, file: !3, line: 21, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23) // CHECK:STDOUT: !23 = !{!24} // CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !18)