diff --git a/core/prelude/iterate.carbon b/core/prelude/iterate.carbon index 859aa140d0a0..4f595aabf450 100644 --- a/core/prelude/iterate.carbon +++ b/core/prelude/iterate.carbon @@ -14,17 +14,17 @@ interface Iterate { let ElementType: Copy & Destroy; let CursorType: Destroy; fn NewCursor(self) -> CursorType; - fn Next(self, cursor: CursorType*) -> Optional(ElementType); + fn Next(self, ref cursor: CursorType) -> Optional(ElementType); } impl forall [T: Copy & Destroy, N: IntLiteral] array(T, N) as Iterate where .ElementType = T and .CursorType = i32 { fn NewCursor(unused self) -> i32 { return 0; } - fn Next(self, cursor: i32*) -> Optional(T) { - if (*cursor < N) { - ++*cursor; - return Optional(T).Some(self[*cursor - 1]); + fn Next(self, ref cursor: i32) -> Optional(T) { + if (cursor < N) { + ++cursor; + return Optional(T).Some(self[cursor - 1]); } else { return Optional(T).None(); } @@ -71,10 +71,10 @@ impl forall [T: CppRange where .ValueType impls Copy] return (self.Begin(), self.End()); } - fn Next(unused self, cursor: CursorType*) -> Optional(ElementType) { - if (cursor->0 != cursor->1) { - returned var result: Optional(ElementType) = cursor->0.(CppUnsafeDeref.Op)(); - ++cursor->0; + fn Next(unused self, ref cursor: CursorType) -> Optional(ElementType) { + if (cursor.0 != cursor.1) { + returned var result: Optional(ElementType) = cursor.0.(CppUnsafeDeref.Op)(); + ++cursor.0; return var; } return Optional(ElementType).None(); diff --git a/core/prelude/range.carbon b/core/prelude/range.carbon index 70b69e5bea03..a79b2a04f49e 100644 --- a/core/prelude/range.carbon +++ b/core/prelude/range.carbon @@ -17,10 +17,10 @@ class IntRange(N: IntLiteral) { impl as Iterate where .CursorType = Int(N) and .ElementType = Int(N) { fn NewCursor(self) -> Int(N) { return self.start; } - fn Next(self, cursor: Int(N)*) -> Optional(Int(N)) { - var value: Int(N) = *cursor; + fn Next(self, ref cursor: Int(N)) -> Optional(Int(N)) { + var value: Int(N) = cursor; if (value < self.end) { - ++*cursor; + ++cursor; return Optional(Int(N)).Some(value); } else { return Optional(Int(N)).None(); diff --git a/docs/design/control_flow/loops.md b/docs/design/control_flow/loops.md index 72b5dac4f469..19d78118c183 100644 --- a/docs/design/control_flow/loops.md +++ b/docs/design/control_flow/loops.md @@ -14,7 +14,8 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - [Details](#details) - [`while`](#while) - [`for`](#for) - - [Ranged-for for user-defined types](#ranged-for-for-user-defined-types) + - [`Iterate` interface](#iterate-interface) + - [Loop desugaring](#loop-desugaring) - [`break`](#break) - [`continue`](#continue) - [Alternatives considered](#alternatives-considered) @@ -54,9 +55,6 @@ is: > `for (` _pattern_ `in` _expression_ `) {` _statements_ `}` -For consistency with function parameters and other pattern matching contexts, -the pattern defaults to value (immutable) bindings, like `let`. - For example, this prints all names in `names`: ```carbon @@ -65,47 +63,73 @@ for (name: strbuf in names) { } ``` -This default can be overridden by adding the `var` keyword: +> **Note:** A name binding in the pattern of a `for` loop is a value binding by +> default. If a mutable loop variable is desired, the pattern can use `var`. For +> example: `for (var x: T in range)`. -```carbon -for (var name: strbuf in names) { - // `name` can be modified, but this will not modify the underlying `names` container. -} -``` +To support iterating over user-defined types, the `for` loop is defined in terms +of the `Core.Iterate` interface. A container type can implement the +`Core.Iterate` interface to make it iterable with `for`. -Temporary entities on the right-hand side of `in` remain alive during the -execution of the `for` loop to prevent invalid memory access. +#### `Iterate` interface -#### Ranged-for for user-defined types - -User types can enable support for ranged-for loops by implementing the `Iterate` -interface: +The `Core.Iterate` interface is defined as: ```carbon interface Iterate { - let ElementType: type; - let CursorType: type; + let ElementType: Copy & Destroy; + let CursorType: Destroy; fn NewCursor(self) -> CursorType; fn Next(self, ref cursor: CursorType) -> Optional(ElementType); } ``` -The cursor tracks progression, and the `Next` method advances the cursor and -returns an `Optional` value. An empty `Optional` indicates that we have reached -the end. +- **`CursorType`**: A type that represents the current position in the + iteration. +- **`ElementType`**: The type of the elements returned by the iteration. +- **`NewCursor`**: Returns a new cursor initialized to the start of iteration. +- **`Next`**: Advances the cursor and returns the next element, or `None` if + the end of iteration has been reached. It takes the cursor by reference + (`ref cursor: CursorType`), allowing the method to modify the cursor + in-place. -A `for` loop on a container of a type that implements `Iterate` behaves -conceptually as (though an API for `Optional` has not been approved): +> **TODO:** Update this interface to be extended type generic once suitable +> language facilities exist. + +#### Loop desugaring + +A `for` loop of the form: ```carbon -var cursor: range.(Iterate.CursorType) = range.(Iterate.NewCursor)(); -var iter: Optional(range.(Iterate.ElementType)) = range.(Iterate.Next)(&cursor); -while (iter.HasValue()) { - ExecuteForBlock(iter.Get()); - iter = container.(Iterate.Next)(ref cursor); +for ( in ) { + } ``` +is desugared to a loop that manages the cursor and checks the optional return +values: + +```carbon +{ + let range:? auto = ; + var cursor: auto = range.(Iterate.NewCursor)(); + while (true) { + match (range.(Iterate.Next)(cursor)) { + case .Some() => { } + default => { break; } + } + } +} +``` + +> **TODO:** The above uses the deduced extended type syntax `:? auto` from +> in-progress proposal +> [#5389](https://github.com/carbon-language/carbon-lang/pull/5389), and should +> be updated to match the final state of that proposal. + +> **Note:** Any temporaries in `` will remain live until the end of the +> loop. + ### `break` The `break` statement immediately ends a `while` or `for` loop. Execution will @@ -173,3 +197,5 @@ while (!f.EOF()) { [#623: Require braces](https://github.com/carbon-language/carbon-lang/pull/623) - Proposal [#1885: `for` statement and user types](https://github.com/carbon-language/carbon-lang/pull/1885) +- Proposal + [#7381: Adopt `ref` in `Core.Iterate.Next`](https://github.com/carbon-language/carbon-lang/pull/7381) diff --git a/proposals/p007381-adopt-ref-in-core-iterate-next.md b/proposals/p007381-adopt-ref-in-core-iterate-next.md new file mode 100644 index 000000000000..cacb6f228acf --- /dev/null +++ b/proposals/p007381-adopt-ref-in-core-iterate-next.md @@ -0,0 +1,79 @@ +# Adopt `ref` in `Core.Iterate.Next` + + + +[Pull request](https://github.com/carbon-language/carbon-lang/pull/7381) + + + +## Table of contents + +- [Abstract](#abstract) +- [Problem](#problem) +- [Background](#background) +- [Proposal](#proposal) +- [Rationale](#rationale) +- [Future work](#future-work) +- [Alternatives considered](#alternatives-considered) + + + +## Abstract + +Change the `cursor` parameter in `Core.Iterate.Next` to be a `ref` parameter +instead of a pointer parameter. + +## Problem + +According to [p001885](p001885-for-statement-and-user-types.md), +`Core.Iterate.Next` is declared as follows: + +```carbon + fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); +``` + +Aside from the old `self` syntax, this uses pass-by-pointer to pass a mutable +reference. This stopped being idiomatic Carbon when `ref` patterns were added, +but we still require it when interacting with this core language feature. + +## Background + +Proposal [p001885](p001885-for-statement-and-user-types.md) added the `Iterate` +interface. + +Proposal [p002006](p002006-values-variables-pointers-and-references.md) affirmed +that Carbon does not have reference _types_, but does have reference +_expressions_. + +Proposal [p005434](p005434-ref-parameters-arguments-returns-and-val-returns.md) +added support for `ref` _patterns_ to match reference expressions. These +replaced pass-by-pointer as the idiomatic way to pass a handle to a mutable +object into a function. + +## Proposal + +Change the declaration of `Core.Iterate.Next` to: + +```carbon + fn Next(self, ref cursor: CursorType) -> Optional(ElementType); +``` + +## Rationale + +- [Code that is easy to read, understand, and write](/docs/project/goals.md#code-that-is-easy-to-read-understand-and-write) + - Makes the `Iterate` interface, and user-defined `impl`s of it, more + consistent with the rest of the language. + +## Future work + +We should consider making `Core.Iterate` a form-generic interface, and making +the `ElementType` instead be an associated form, with a suitable change to +return a form-generic `Optional`. + +## Alternatives considered + +None. diff --git a/toolchain/check/handle_loop_statement.cpp b/toolchain/check/handle_loop_statement.cpp index 0737b2890ae2..e13bf4ab5e90 100644 --- a/toolchain/check/handle_loop_statement.cpp +++ b/toolchain/check/handle_loop_statement.cpp @@ -222,20 +222,15 @@ auto HandleParseNode(Context& context, Parse::ForHeaderId node_id) -> bool { auto loop_header_id = StartLoopHeader(context, start_node_id); auto continue_depth = context.scope_stack().ambient_cleanup_scope_depth(); - // Call `.(Iterate.Next)(&cursor)`. - auto cursor_type_inst_id = context.types().GetTypeInstId(cursor_type_id); - auto cursor_addr_id = AddInst( - context, node_id, - {.type_id = GetPointerType(context, cursor_type_inst_id), - .lvalue_id = cursor_var_id}); - // A range that implements neither fails both lookups; reporting the second - // would say the same thing about the same expression a second time. + // Call `.(Iterate.Next)(ref cursor)`. + // Don't diagnose if the call to `Iterate.NewCursor` failed, since this call + // will likely also fail for the same reason. // TODO: We should only perform the impl lookup once. auto element_id = BuildBinaryOperator(context, node_id, {.interface_name = CoreIdentifier::Iterate, .op_name = CoreIdentifier::Next}, - range_id, cursor_addr_id, + range_id, cursor_var_id, /*diagnose=*/cursor_id != SemIR::ErrorInst::InstId); // We need to convert away from an initializing expression in order to call // `HasValue` and then separately pattern-match against the element. diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index 918be89ef0be..5c0b61bfea91 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -22,10 +22,10 @@ class IntRange(N: Core.IntLiteral) { impl as Core.Iterate where .CursorType = Core.Int(N) and .ElementType = Core.Int(N) { fn NewCursor(self) -> Core.Int(N) { return self.start; } - fn Next(self, cursor: Core.Int(N)*) -> Core.Optional(Core.Int(N)) { - var value: Core.Int(N) = *cursor; + fn Next(self, ref cursor: Core.Int(N)) -> Core.Optional(Core.Int(N)) { + var value: Core.Int(N) = cursor; if (value < self.end) { - ++*cursor; + ++cursor; return Core.Optional(Core.Int(N)).Some(value); } else { return Core.Optional(Core.Int(N)).None(); @@ -118,10 +118,8 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %return.patt.434: %pattern_type.142cb7.1 = return_slot_pattern %return.param_patt.5a2679.1, %Int.67af24.1 [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.41e: type = ptr_type %Int.67af24.1 [symbolic] -// CHECK:STDOUT: %pattern_type.833: type = pattern_type %ptr.41e [symbolic] -// CHECK:STDOUT: %cursor.param_patt.328: %pattern_type.833 = value_param_pattern [symbolic] -// CHECK:STDOUT: %cursor.patt.15e: %pattern_type.833 = wrapper_binding_pattern cursor, %cursor.param_patt.328 [symbolic] +// CHECK:STDOUT: %cursor.param_patt.ce4: %pattern_type.142cb7.1 = ref_param_pattern [symbolic] +// CHECK:STDOUT: %cursor.patt.ed4: %pattern_type.142cb7.1 = wrapper_binding_pattern cursor, %cursor.param_patt.ce4 [symbolic] // CHECK:STDOUT: %OptionalStorage.lookup_impl_witness.a32: = lookup_impl_witness %Int.67af24.1, @OptionalStorage [symbolic] // CHECK:STDOUT: %.368: require_specific_def_type = require_specific_def @T.as_type.as.OptionalStorage.impl(%facet_value) [symbolic] // CHECK:STDOUT: %OptionalStorage.facet.b99: %OptionalStorage.type = facet_value %Int.67af24.1, (%OptionalStorage.lookup_impl_witness.a32) [symbolic] @@ -141,7 +139,6 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %.c60: type = fn_type_with_self_type %Copy.WithSelf.Op.type.b83, %Copy.facet.f12 [symbolic] // CHECK:STDOUT: %impl.elem0.284: %.c60 = impl_witness_access %Copy.lookup_impl_witness.df6, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.f9f: = specific_impl_function %impl.elem0.284, @Copy.WithSelf.Op(%Copy.facet.f12) [symbolic] -// CHECK:STDOUT: %require_complete.f79: = require_complete_type %ptr.41e [symbolic] // CHECK:STDOUT: %Optional.None.type.2aa: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet.b99) [symbolic] // CHECK:STDOUT: %Optional.None.fb7: %Optional.None.type.2aa = struct_value () [symbolic] // CHECK:STDOUT: %Optional.Some.type.422: type = fn_type @Optional.Some, @Optional(%OptionalStorage.facet.b99) [symbolic] @@ -359,38 +356,37 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %IntRange.as.Iterate.impl.Next.decl: @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.Next.type (%IntRange.as.Iterate.impl.Next.type) = fn_decl @IntRange.as.Iterate.impl.Next [symbolic = @IntRange.as.Iterate.impl.%IntRange.as.Iterate.impl.Next (constants.%IntRange.as.Iterate.impl.Next)] { // CHECK:STDOUT: %self.param_patt.loc11_13.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.1ea) = value_param_pattern [symbolic = %self.param_patt.loc11_13.2 (constants.%self.param_patt.5cc)] // CHECK:STDOUT: %self.patt.loc11_13.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.1ea) = wrapper_binding_pattern self, %self.param_patt.loc11_13.1 [symbolic = %self.patt.loc11_13.2 (constants.%self.patt.b4c)] -// CHECK:STDOUT: %cursor.param_patt.loc11_25.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.833) = value_param_pattern [symbolic = %cursor.param_patt.loc11_25.2 (constants.%cursor.param_patt.328)] -// CHECK:STDOUT: %cursor.patt.loc11_25.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.833) = wrapper_binding_pattern cursor, %cursor.param_patt.loc11_25.1 [symbolic = %cursor.patt.loc11_25.2 (constants.%cursor.patt.15e)] -// CHECK:STDOUT: %return.param_patt.loc11_69.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_69 (%pattern_type.b38) = out_param_pattern [symbolic = %return.param_patt.loc11_69.2 (constants.%return.param_patt.4bb)] -// CHECK:STDOUT: %return.patt.loc11_41.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_69 (%pattern_type.b38) = return_slot_pattern %return.param_patt.loc11_69.1, %Optional.loc11_69.2 [symbolic = %return.patt.loc11_41.2 (constants.%return.patt.427)] +// CHECK:STDOUT: %cursor.param_patt.loc11_29.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = ref_param_pattern [symbolic = %cursor.param_patt.loc11_29.2 (constants.%cursor.param_patt.ce4)] +// CHECK:STDOUT: %cursor.patt.loc11_29.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = wrapper_binding_pattern cursor, %cursor.param_patt.loc11_29.1 [symbolic = %cursor.patt.loc11_29.2 (constants.%cursor.patt.ed4)] +// CHECK:STDOUT: %return.param_patt.loc11_72.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_72 (%pattern_type.b38) = out_param_pattern [symbolic = %return.param_patt.loc11_72.2 (constants.%return.param_patt.4bb)] +// CHECK:STDOUT: %return.patt.loc11_44.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_72 (%pattern_type.b38) = return_slot_pattern %return.param_patt.loc11_72.1, %Optional.loc11_72.2 [symbolic = %return.patt.loc11_44.2 (constants.%return.patt.427)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc11_44: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Core.ref.loc11_47: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Optional.ref.loc11: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic] -// CHECK:STDOUT: %Core.ref.loc11_58: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %Int.ref.loc11_62: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] -// CHECK:STDOUT: %N.ref.loc11_67: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc11_68: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %OptionalStorage.facet.loc11_69.2: %OptionalStorage.type = facet_value %Int.loc11_68, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc11_69.5: %OptionalStorage.type = converted %Int.loc11_68, %OptionalStorage.facet.loc11_69.2 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc11_69.2: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] -// CHECK:STDOUT: %.loc11_69.6: Core.Form = init_form %Optional.loc11_69.2 [symbolic = %.loc11_69.4 (constants.%.3f3)] +// CHECK:STDOUT: %Core.ref.loc11_61: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Int.ref.loc11_65: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] +// CHECK:STDOUT: %N.ref.loc11_70: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %Int.loc11_71: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %OptionalStorage.facet.loc11_72.2: %OptionalStorage.type = facet_value %Int.loc11_71, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc11_72.5: %OptionalStorage.type = converted %Int.loc11_71, %OptionalStorage.facet.loc11_72.2 [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc11_72.2: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_72.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %.loc11_72.6: Core.Form = init_form %Optional.loc11_72.2 [symbolic = %.loc11_72.4 (constants.%.3f3)] // CHECK:STDOUT: %self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4) = value_param call_param0 // CHECK:STDOUT: %.loc11_13.1: type = splice_block %Self.ref [symbolic = %IntRange (constants.%IntRange.2c4)] { // CHECK:STDOUT: %.loc11_13.2: type = specific_constant constants.%IntRange.2c4, @IntRange(constants.%N) [symbolic = %IntRange (constants.%IntRange.2c4)] // CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc11_13.2 [symbolic = %IntRange (constants.%IntRange.2c4)] // CHECK:STDOUT: } // CHECK:STDOUT: %self: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4) = wrapper_binding self, %self.param -// CHECK:STDOUT: %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = value_param call_param1 -// CHECK:STDOUT: %.loc11_38: type = splice_block %ptr.loc11_38.2 [symbolic = %ptr.loc11_38.1 (constants.%ptr.41e)] { -// CHECK:STDOUT: %Core.ref.loc11_27: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %Int.ref.loc11_31: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] -// CHECK:STDOUT: %N.ref.loc11_36: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc11_37.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %ptr.loc11_38.2: type = ptr_type %Int.loc11_37.2 [symbolic = %ptr.loc11_38.1 (constants.%ptr.41e)] +// CHECK:STDOUT: %cursor.param: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = ref_param call_param1 +// CHECK:STDOUT: %.loc11_41: type = splice_block %Int.loc11_41.2 [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] { +// CHECK:STDOUT: %Core.ref.loc11_31: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %Int.ref.loc11_35: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] +// CHECK:STDOUT: %N.ref.loc11_40: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] +// CHECK:STDOUT: %Int.loc11_41.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %cursor: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = wrapper_binding cursor, %cursor.param -// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = out_param call_param2 -// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = return_slot %return.param +// CHECK:STDOUT: %cursor: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = wrapper_binding cursor, %cursor.param +// CHECK:STDOUT: %return.param: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_72.1 (%Optional.5ec) = out_param call_param2 +// CHECK:STDOUT: %return: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_72.1 (%Optional.5ec) = return_slot %return.param // 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)] @@ -624,101 +620,97 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %pattern_type.loc11_13: type = pattern_type %IntRange [symbolic = %pattern_type.loc11_13 (constants.%pattern_type.1ea)] // CHECK:STDOUT: %self.param_patt.loc11_13.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.1ea) = value_param_pattern [symbolic = %self.param_patt.loc11_13.2 (constants.%self.param_patt.5cc)] // CHECK:STDOUT: %self.patt.loc11_13.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_13 (%pattern_type.1ea) = wrapper_binding_pattern self, %self.param_patt.loc11_13.2 [symbolic = %self.patt.loc11_13.2 (constants.%self.patt.b4c)] -// CHECK:STDOUT: %Int.loc11_37.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %ptr.loc11_38.1: type = ptr_type %Int.loc11_37.1 [symbolic = %ptr.loc11_38.1 (constants.%ptr.41e)] -// CHECK:STDOUT: %pattern_type.loc11_25: type = pattern_type %ptr.loc11_38.1 [symbolic = %pattern_type.loc11_25 (constants.%pattern_type.833)] -// CHECK:STDOUT: %cursor.param_patt.loc11_25.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.833) = value_param_pattern [symbolic = %cursor.param_patt.loc11_25.2 (constants.%cursor.param_patt.328)] -// CHECK:STDOUT: %cursor.patt.loc11_25.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_25 (%pattern_type.833) = wrapper_binding_pattern cursor, %cursor.param_patt.loc11_25.2 [symbolic = %cursor.patt.loc11_25.2 (constants.%cursor.patt.15e)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.173)] -// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.df6)] -// CHECK:STDOUT: %facet_value: %facet_type.f48 = facet_value %Int.loc11_37.1, (%Destroy.lookup_impl_witness, %Copy.lookup_impl_witness) [symbolic = %facet_value (constants.%facet_value)] -// CHECK:STDOUT: %.loc11_69.3: require_specific_def_type = require_specific_def @T.as_type.as.OptionalStorage.impl(%facet_value) [symbolic = %.loc11_69.3 (constants.%.368)] -// CHECK:STDOUT: %OptionalStorage.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @OptionalStorage [symbolic = %OptionalStorage.lookup_impl_witness (constants.%OptionalStorage.lookup_impl_witness.a32)] -// CHECK:STDOUT: %OptionalStorage.facet.loc11_69.1: %OptionalStorage.type = facet_value %Int.loc11_37.1, (%OptionalStorage.lookup_impl_witness) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc11_69.1: type = class_type @Optional, @Optional(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] -// CHECK:STDOUT: %.loc11_69.4: Core.Form = init_form %Optional.loc11_69.1 [symbolic = %.loc11_69.4 (constants.%.3f3)] -// CHECK:STDOUT: %pattern_type.loc11_69: type = pattern_type %Optional.loc11_69.1 [symbolic = %pattern_type.loc11_69 (constants.%pattern_type.b38)] -// CHECK:STDOUT: %return.param_patt.loc11_69.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_69 (%pattern_type.b38) = out_param_pattern [symbolic = %return.param_patt.loc11_69.2 (constants.%return.param_patt.4bb)] -// CHECK:STDOUT: %return.patt.loc11_41.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_69 (%pattern_type.b38) = return_slot_pattern %return.param_patt.loc11_69.2, %Optional.loc11_69.1 [symbolic = %return.patt.loc11_41.2 (constants.%return.patt.427)] +// CHECK:STDOUT: %Int.loc11_41.1: type = class_type @Int, @Int(%N) [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %pattern_type.loc11_29: type = pattern_type %Int.loc11_41.1 [symbolic = %pattern_type.loc11_29 (constants.%pattern_type.142cb7.1)] +// CHECK:STDOUT: %cursor.param_patt.loc11_29.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = ref_param_pattern [symbolic = %cursor.param_patt.loc11_29.2 (constants.%cursor.param_patt.ce4)] +// CHECK:STDOUT: %cursor.patt.loc11_29.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = wrapper_binding_pattern cursor, %cursor.param_patt.loc11_29.2 [symbolic = %cursor.patt.loc11_29.2 (constants.%cursor.patt.ed4)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_41.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.173)] +// CHECK:STDOUT: %Copy.lookup_impl_witness: = lookup_impl_witness %Int.loc11_41.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.df6)] +// CHECK:STDOUT: %facet_value: %facet_type.f48 = facet_value %Int.loc11_41.1, (%Destroy.lookup_impl_witness, %Copy.lookup_impl_witness) [symbolic = %facet_value (constants.%facet_value)] +// CHECK:STDOUT: %.loc11_72.3: require_specific_def_type = require_specific_def @T.as_type.as.OptionalStorage.impl(%facet_value) [symbolic = %.loc11_72.3 (constants.%.368)] +// CHECK:STDOUT: %OptionalStorage.lookup_impl_witness: = lookup_impl_witness %Int.loc11_41.1, @OptionalStorage [symbolic = %OptionalStorage.lookup_impl_witness (constants.%OptionalStorage.lookup_impl_witness.a32)] +// CHECK:STDOUT: %OptionalStorage.facet.loc11_72.1: %OptionalStorage.type = facet_value %Int.loc11_41.1, (%OptionalStorage.lookup_impl_witness) [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc11_72.1: type = class_type @Optional, @Optional(%OptionalStorage.facet.loc11_72.1) [symbolic = %Optional.loc11_72.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %.loc11_72.4: Core.Form = init_form %Optional.loc11_72.1 [symbolic = %.loc11_72.4 (constants.%.3f3)] +// CHECK:STDOUT: %pattern_type.loc11_72: type = pattern_type %Optional.loc11_72.1 [symbolic = %pattern_type.loc11_72 (constants.%pattern_type.b38)] +// CHECK:STDOUT: %return.param_patt.loc11_72.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_72 (%pattern_type.b38) = out_param_pattern [symbolic = %return.param_patt.loc11_72.2 (constants.%return.param_patt.4bb)] +// CHECK:STDOUT: %return.patt.loc11_44.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_72 (%pattern_type.b38) = return_slot_pattern %return.param_patt.loc11_72.2, %Optional.loc11_72.1 [symbolic = %return.patt.loc11_44.2 (constants.%return.patt.427)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc11_13: = require_complete_type %IntRange [symbolic = %require_complete.loc11_13 (constants.%require_complete.5d9)] -// CHECK:STDOUT: %require_complete.loc11_25: = require_complete_type %ptr.loc11_38.1 [symbolic = %require_complete.loc11_25 (constants.%require_complete.f79)] -// CHECK:STDOUT: %require_complete.loc11_41: = require_complete_type %Optional.loc11_69.1 [symbolic = %require_complete.loc11_41 (constants.%require_complete.63c)] -// CHECK:STDOUT: %require_complete.loc12: = require_complete_type %Int.loc11_37.1 [symbolic = %require_complete.loc12 (constants.%require_complete.4dfb92.1)] -// CHECK:STDOUT: %pattern_type.loc12: type = pattern_type %Int.loc11_37.1 [symbolic = %pattern_type.loc12 (constants.%pattern_type.142cb7.1)] -// CHECK:STDOUT: %value.patt.loc12_16.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.142cb7.1) = ref_binding_pattern value [symbolic = %value.patt.loc12_16.2 (constants.%value.patt.505)] -// CHECK:STDOUT: %value.var_patt.loc12_7.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.142cb7.1) = var_pattern %value.patt.loc12_16.2 [symbolic = %value.var_patt.loc12_7.2 (constants.%value.var_patt)] -// CHECK:STDOUT: %.loc12_32.5: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc12_32.5 (constants.%.a53)] -// CHECK:STDOUT: %Copy.facet.loc12_32.3: %Copy.type = facet_value %Int.loc11_37.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %require_complete.loc11_29: = require_complete_type %Int.loc11_41.1 [symbolic = %require_complete.loc11_29 (constants.%require_complete.4dfb92.1)] +// CHECK:STDOUT: %require_complete.loc11_44: = require_complete_type %Optional.loc11_72.1 [symbolic = %require_complete.loc11_44 (constants.%require_complete.63c)] +// CHECK:STDOUT: %value.patt.loc12_16.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = ref_binding_pattern value [symbolic = %value.patt.loc12_16.2 (constants.%value.patt.505)] +// CHECK:STDOUT: %value.var_patt.loc12_7.2: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = var_pattern %value.patt.loc12_16.2 [symbolic = %value.var_patt.loc12_7.2 (constants.%value.var_patt)] +// CHECK:STDOUT: %.loc12_32.4: require_specific_def_type = require_specific_def @Int.as.Copy.impl(%N) [symbolic = %.loc12_32.4 (constants.%.a53)] +// CHECK:STDOUT: %Copy.facet.loc12_32.3: %Copy.type = facet_value %Int.loc11_41.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] // CHECK:STDOUT: %Copy.WithSelf.Op.type: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.loc12_32.3) [symbolic = %Copy.WithSelf.Op.type (constants.%Copy.WithSelf.Op.type.b83)] -// CHECK:STDOUT: %.loc12_32.6: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc12_32.3 [symbolic = %.loc12_32.6 (constants.%.c60)] -// CHECK:STDOUT: %impl.elem0.loc12_32.2: @IntRange.as.Iterate.impl.Next.%.loc12_32.6 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %.loc12_32.5: type = fn_type_with_self_type %Copy.WithSelf.Op.type, %Copy.facet.loc12_32.3 [symbolic = %.loc12_32.5 (constants.%.c60)] +// CHECK:STDOUT: %impl.elem0.loc12_32.2: @IntRange.as.Iterate.impl.Next.%.loc12_32.5 (%.c60) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] // CHECK:STDOUT: %specific_impl_fn.loc12_32.2: = specific_impl_function %impl.elem0.loc12_32.2, @Copy.WithSelf.Op(%Copy.facet.loc12_32.3) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.f9f)] -// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc11_37.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.bed)] -// CHECK:STDOUT: %OrderedWith.type.loc13_17.2: type = facet_type <@OrderedWith, @OrderedWith(%Int.loc11_37.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.6f8)] +// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc11_41.1 [symbolic = %IntRange.elem (constants.%IntRange.elem.bed)] +// CHECK:STDOUT: %OrderedWith.type.loc13_17.2: type = facet_type <@OrderedWith, @OrderedWith(%Int.loc11_41.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.6f8)] // CHECK:STDOUT: %require_complete.loc13: = require_complete_type %OrderedWith.type.loc13_17.2 [symbolic = %require_complete.loc13 (constants.%require_complete.4c8)] -// CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith, @OrderedWith(%Int.loc11_37.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.e6d)] +// CHECK:STDOUT: %OrderedWith.assoc_type: type = assoc_entity_type @OrderedWith, @OrderedWith(%Int.loc11_41.1) [symbolic = %OrderedWith.assoc_type (constants.%OrderedWith.assoc_type.e6d)] // CHECK:STDOUT: %assoc0: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.e6d) = assoc_entity element0, imports.%Core.import_ref.e7a [symbolic = %assoc0 (constants.%assoc0.ebc)] // CHECK:STDOUT: %.loc13_17.2: require_specific_def_type = require_specific_def @Int.as.OrderedWith.impl.ab3(%N, %N) [symbolic = %.loc13_17.2 (constants.%.4a8)] // CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness imports.%OrderedWith.impl_witness_table.087, @Int.as.OrderedWith.impl.ab3(%N, %N) [symbolic = %OrderedWith.impl_witness (constants.%OrderedWith.impl_witness.4b7)] -// CHECK:STDOUT: %OrderedWith.facet: @IntRange.as.Iterate.impl.Next.%OrderedWith.type.loc13_17.2 (%OrderedWith.type.6f8) = facet_value %Int.loc11_37.1, (%OrderedWith.impl_witness) [symbolic = %OrderedWith.facet (constants.%OrderedWith.facet.9a0)] -// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Int.loc11_37.1, %OrderedWith.facet) [symbolic = %OrderedWith.WithSelf.Less.type (constants.%OrderedWith.WithSelf.Less.type.5fd)] +// CHECK:STDOUT: %OrderedWith.facet: @IntRange.as.Iterate.impl.Next.%OrderedWith.type.loc13_17.2 (%OrderedWith.type.6f8) = facet_value %Int.loc11_41.1, (%OrderedWith.impl_witness) [symbolic = %OrderedWith.facet (constants.%OrderedWith.facet.9a0)] +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.type: type = fn_type @OrderedWith.WithSelf.Less, @OrderedWith.WithSelf(%Int.loc11_41.1, %OrderedWith.facet) [symbolic = %OrderedWith.WithSelf.Less.type (constants.%OrderedWith.WithSelf.Less.type.5fd)] // CHECK:STDOUT: %.loc13_17.3: type = fn_type_with_self_type %OrderedWith.WithSelf.Less.type, %OrderedWith.facet [symbolic = %.loc13_17.3 (constants.%.01a)] // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.type: type = fn_type @Int.as.OrderedWith.impl.Less.1, @Int.as.OrderedWith.impl.ab3(%N, %N) [symbolic = %Int.as.OrderedWith.impl.Less.type (constants.%Int.as.OrderedWith.impl.Less.type.f5c)] // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less: @IntRange.as.Iterate.impl.Next.%Int.as.OrderedWith.impl.Less.type (%Int.as.OrderedWith.impl.Less.type.f5c) = struct_value () [symbolic = %Int.as.OrderedWith.impl.Less (constants.%Int.as.OrderedWith.impl.Less.13c)] // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.specific_fn: = specific_function %Int.as.OrderedWith.impl.Less, @Int.as.OrderedWith.impl.Less.1(%N, %N) [symbolic = %Int.as.OrderedWith.impl.Less.specific_fn (constants.%Int.as.OrderedWith.impl.Less.specific_fn.6ce)] // CHECK:STDOUT: %.loc14_9.3: require_specific_def_type = require_specific_def @Int.as.Inc.impl(%N) [symbolic = %.loc14_9.3 (constants.%.f62)] -// CHECK:STDOUT: %Inc.lookup_impl_witness: = lookup_impl_witness %Int.loc11_37.1, @Inc [symbolic = %Inc.lookup_impl_witness (constants.%Inc.lookup_impl_witness)] -// CHECK:STDOUT: %Inc.facet.loc14_9.3: %Inc.type = facet_value %Int.loc11_37.1, (%Inc.lookup_impl_witness) [symbolic = %Inc.facet.loc14_9.3 (constants.%Inc.facet)] +// CHECK:STDOUT: %Inc.lookup_impl_witness: = lookup_impl_witness %Int.loc11_41.1, @Inc [symbolic = %Inc.lookup_impl_witness (constants.%Inc.lookup_impl_witness)] +// CHECK:STDOUT: %Inc.facet.loc14_9.3: %Inc.type = facet_value %Int.loc11_41.1, (%Inc.lookup_impl_witness) [symbolic = %Inc.facet.loc14_9.3 (constants.%Inc.facet)] // CHECK:STDOUT: %Inc.WithSelf.Op.type: type = fn_type @Inc.WithSelf.Op, @Inc.WithSelf(%Inc.facet.loc14_9.3) [symbolic = %Inc.WithSelf.Op.type (constants.%Inc.WithSelf.Op.type.36a)] // CHECK:STDOUT: %.loc14_9.4: type = fn_type_with_self_type %Inc.WithSelf.Op.type, %Inc.facet.loc14_9.3 [symbolic = %.loc14_9.4 (constants.%.952)] // CHECK:STDOUT: %impl.elem0.loc14_9.2: @IntRange.as.Iterate.impl.Next.%.loc14_9.4 (%.952) = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.7b5)] // CHECK:STDOUT: %specific_impl_fn.loc14_9.2: = specific_impl_function %impl.elem0.loc14_9.2, @Inc.WithSelf.Op(%Inc.facet.loc14_9.3) [symbolic = %specific_impl_fn.loc14_9.2 (constants.%specific_impl_fn.ed1)] -// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.422)] +// CHECK:STDOUT: %Optional.Some.type: type = fn_type @Optional.Some, @Optional(%OptionalStorage.facet.loc11_72.1) [symbolic = %Optional.Some.type (constants.%Optional.Some.type.422)] // CHECK:STDOUT: %Optional.Some: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.422) = struct_value () [symbolic = %Optional.Some (constants.%Optional.Some.bcf)] -// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] -// CHECK:STDOUT: %Destroy.facet.loc12_7.5: %Destroy.type = facet_value %Int.loc11_37.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] +// CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%OptionalStorage.facet.loc11_72.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] +// CHECK:STDOUT: %Destroy.facet.loc12_7.5: %Destroy.type = facet_value %Int.loc11_41.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc12_7.5) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.6fa)] // CHECK:STDOUT: %.loc12_7.5: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc12_7.5 [symbolic = %.loc12_7.5 (constants.%.b53)] // CHECK:STDOUT: %impl.elem2.loc12_7.3: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.b53) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc12_7.3 (constants.%impl.elem2.9bd)] // CHECK:STDOUT: %specific_impl_fn.loc12_7.3: = specific_impl_function %impl.elem2.loc12_7.3, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc12_7.5) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.1ce)] -// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.2aa)] +// CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet.loc11_72.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.2aa)] // CHECK:STDOUT: %Optional.None: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.2aa) = struct_value () [symbolic = %Optional.None (constants.%Optional.None.fb7)] -// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] +// CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%OptionalStorage.facet.loc11_72.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4), %cursor.param: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e)) -> out %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) { +// CHECK:STDOUT: fn(%self.param: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4), %cursor.param: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1)) -> out %return.param: @IntRange.as.Iterate.impl.Next.%Optional.loc11_72.1 (%Optional.5ec) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %value.var: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = var_storage %value.var_patt.loc12_7.1 -// CHECK:STDOUT: %cursor.ref.loc12: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = name_ref cursor, %cursor -// CHECK:STDOUT: %.loc12_32.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = deref %cursor.ref.loc12 -// CHECK:STDOUT: %.loc12_32.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %.loc12_32.1 -// CHECK:STDOUT: %impl.elem0.loc12_32.1: @IntRange.as.Iterate.impl.Next.%.loc12_32.6 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] -// CHECK:STDOUT: %bound_method.loc12_32.1: = bound_method %.loc12_32.2, %impl.elem0.loc12_32.1 +// CHECK:STDOUT: %value.var: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = var_storage %value.var_patt.loc12_7.1 +// CHECK:STDOUT: %cursor.ref.loc12: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = name_ref cursor, %cursor +// CHECK:STDOUT: %.loc12_32.1: @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = acquire_value %cursor.ref.loc12 +// CHECK:STDOUT: %impl.elem0.loc12_32.1: @IntRange.as.Iterate.impl.Next.%.loc12_32.5 (%.c60) = impl_witness_access constants.%Copy.lookup_impl_witness.df6, element0 [symbolic = %impl.elem0.loc12_32.2 (constants.%impl.elem0.284)] +// CHECK:STDOUT: %bound_method.loc12_32.1: = bound_method %.loc12_32.1, %impl.elem0.loc12_32.1 // CHECK:STDOUT: %Copy.facet.loc12_32.1: %Copy.type = facet_value constants.%Int.67af24.1, (constants.%Copy.lookup_impl_witness.df6) [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] -// CHECK:STDOUT: %.loc12_32.3: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc12_32.1 [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %.loc12_32.2: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc12_32.1 [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] // CHECK:STDOUT: %Copy.facet.loc12_32.2: %Copy.type = facet_value constants.%Int.67af24.1, (constants.%Copy.lookup_impl_witness.df6) [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] -// CHECK:STDOUT: %.loc12_32.4: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc12_32.2 [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] +// CHECK:STDOUT: %.loc12_32.3: %Copy.type = converted constants.%Int.67af24.1, %Copy.facet.loc12_32.2 [symbolic = %Copy.facet.loc12_32.3 (constants.%Copy.facet.f12)] // CHECK:STDOUT: %specific_impl_fn.loc12_32.1: = specific_impl_function %impl.elem0.loc12_32.1, @Copy.WithSelf.Op(constants.%Copy.facet.f12) [symbolic = %specific_impl_fn.loc12_32.2 (constants.%specific_impl_fn.f9f)] -// CHECK:STDOUT: %bound_method.loc12_32.2: = bound_method %.loc12_32.2, %specific_impl_fn.loc12_32.1 -// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = call %bound_method.loc12_32.2(%.loc12_32.2) +// CHECK:STDOUT: %bound_method.loc12_32.2: = bound_method %.loc12_32.1, %specific_impl_fn.loc12_32.1 +// CHECK:STDOUT: %Copy.WithSelf.Op.call: init @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = call %bound_method.loc12_32.2(%.loc12_32.1) // CHECK:STDOUT: assign %value.var, %Copy.WithSelf.Op.call -// CHECK:STDOUT: %.loc12_28: type = splice_block %Int.loc12 [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] { +// CHECK:STDOUT: %.loc12_28: type = splice_block %Int.loc12 [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] { // CHECK:STDOUT: %Core.ref.loc12: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc12: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc12: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc12: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %Int.loc12: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %value: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = wrapper_binding value, %value.var +// CHECK:STDOUT: %value: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = wrapper_binding value, %value.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %value.patt.loc12_16.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.142cb7.1) = ref_binding_pattern value [symbolic = %value.patt.loc12_16.2 (constants.%value.patt.505)] -// CHECK:STDOUT: %value.var_patt.loc12_7.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc12 (%pattern_type.142cb7.1) = var_pattern %value.patt.loc12_16.1 [symbolic = %value.var_patt.loc12_7.2 (constants.%value.var_patt)] +// CHECK:STDOUT: %value.patt.loc12_16.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = ref_binding_pattern value [symbolic = %value.patt.loc12_16.2 (constants.%value.patt.505)] +// CHECK:STDOUT: %value.var_patt.loc12_7.1: @IntRange.as.Iterate.impl.Next.%pattern_type.loc11_29 (%pattern_type.142cb7.1) = var_pattern %value.patt.loc12_16.1 [symbolic = %value.var_patt.loc12_7.2 (constants.%value.var_patt)] // CHECK:STDOUT: } -// CHECK:STDOUT: %value.ref.loc13: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = name_ref value, %value +// CHECK:STDOUT: %value.ref.loc13: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = name_ref value, %value // CHECK:STDOUT: %self.ref: @IntRange.as.Iterate.impl.Next.%IntRange (%IntRange.2c4) = name_ref self, %self // CHECK:STDOUT: %end.ref: @IntRange.as.Iterate.impl.Next.%IntRange.elem (%IntRange.elem.bed) = name_ref end, @IntRange.%field_decl.loc23 [concrete = @IntRange.%field_decl.loc23] -// CHECK:STDOUT: %.loc13_23.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = class_element_access %self.ref, element1 -// CHECK:STDOUT: %.loc13_23.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %.loc13_23.1 +// CHECK:STDOUT: %.loc13_23.1: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = class_element_access %self.ref, element1 +// CHECK:STDOUT: %.loc13_23.2: @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = acquire_value %.loc13_23.1 // CHECK:STDOUT: %OrderedWith.type.loc13_17.1: type = facet_type <@OrderedWith, @OrderedWith(constants.%Int.67af24.1)> [symbolic = %OrderedWith.type.loc13_17.2 (constants.%OrderedWith.type.6f8)] // CHECK:STDOUT: %.loc13_17.1: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.e6d) = specific_constant imports.%Core.import_ref.ef7, @OrderedWith.WithSelf(constants.%Int.67af24.1, constants.%Self.7df) [symbolic = %assoc0 (constants.%assoc0.ebc)] // CHECK:STDOUT: %Less.ref: @IntRange.as.Iterate.impl.Next.%OrderedWith.assoc_type (%OrderedWith.assoc_type.e6d) = name_ref Less, %.loc13_17.1 [symbolic = %assoc0 (constants.%assoc0.ebc)] @@ -726,44 +718,43 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %bound_method.loc13_17.1: = bound_method %value.ref.loc13, %impl.elem0.loc13 // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc13, @Int.as.OrderedWith.impl.Less.1(constants.%N, constants.%N) [symbolic = %Int.as.OrderedWith.impl.Less.specific_fn (constants.%Int.as.OrderedWith.impl.Less.specific_fn.6ce)] // CHECK:STDOUT: %bound_method.loc13_17.2: = bound_method %value.ref.loc13, %specific_fn -// CHECK:STDOUT: %.loc13_11: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %value.ref.loc13 +// CHECK:STDOUT: %.loc13_11: @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = acquire_value %value.ref.loc13 // CHECK:STDOUT: %Int.as.OrderedWith.impl.Less.call: init bool = call %bound_method.loc13_17.2(%.loc13_11, %.loc13_23.2) // CHECK:STDOUT: %.loc13_27.1: bool = value_of_initializer %Int.as.OrderedWith.impl.Less.call // CHECK:STDOUT: %.loc13_27.2: bool = converted %Int.as.OrderedWith.impl.Less.call, %.loc13_27.1 // CHECK:STDOUT: if %.loc13_27.2 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: -// CHECK:STDOUT: %cursor.ref.loc14: @IntRange.as.Iterate.impl.Next.%ptr.loc11_38.1 (%ptr.41e) = name_ref cursor, %cursor -// CHECK:STDOUT: %.loc14_11: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = deref %cursor.ref.loc14 +// CHECK:STDOUT: %cursor.ref.loc14: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = name_ref cursor, %cursor // CHECK:STDOUT: %impl.elem0.loc14_9.1: @IntRange.as.Iterate.impl.Next.%.loc14_9.4 (%.952) = impl_witness_access constants.%Inc.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_9.2 (constants.%impl.elem0.7b5)] -// CHECK:STDOUT: %bound_method.loc14_9.1: = bound_method %.loc14_11, %impl.elem0.loc14_9.1 +// CHECK:STDOUT: %bound_method.loc14_9.1: = bound_method %cursor.ref.loc14, %impl.elem0.loc14_9.1 // CHECK:STDOUT: %Inc.facet.loc14_9.1: %Inc.type = facet_value constants.%Int.67af24.1, (constants.%Inc.lookup_impl_witness) [symbolic = %Inc.facet.loc14_9.3 (constants.%Inc.facet)] // CHECK:STDOUT: %.loc14_9.1: %Inc.type = converted constants.%Int.67af24.1, %Inc.facet.loc14_9.1 [symbolic = %Inc.facet.loc14_9.3 (constants.%Inc.facet)] // CHECK:STDOUT: %Inc.facet.loc14_9.2: %Inc.type = facet_value constants.%Int.67af24.1, (constants.%Inc.lookup_impl_witness) [symbolic = %Inc.facet.loc14_9.3 (constants.%Inc.facet)] // CHECK:STDOUT: %.loc14_9.2: %Inc.type = converted constants.%Int.67af24.1, %Inc.facet.loc14_9.2 [symbolic = %Inc.facet.loc14_9.3 (constants.%Inc.facet)] // CHECK:STDOUT: %specific_impl_fn.loc14_9.1: = specific_impl_function %impl.elem0.loc14_9.1, @Inc.WithSelf.Op(constants.%Inc.facet) [symbolic = %specific_impl_fn.loc14_9.2 (constants.%specific_impl_fn.ed1)] -// CHECK:STDOUT: %bound_method.loc14_9.2: = bound_method %.loc14_11, %specific_impl_fn.loc14_9.1 -// CHECK:STDOUT: %Inc.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc14_9.2(%.loc14_11) +// CHECK:STDOUT: %bound_method.loc14_9.2: = bound_method %cursor.ref.loc14, %specific_impl_fn.loc14_9.1 +// CHECK:STDOUT: %Inc.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc14_9.2(%cursor.ref.loc14) // CHECK:STDOUT: %Core.ref.loc15_16: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Optional.ref.loc15: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic] // CHECK:STDOUT: %Core.ref.loc15_30: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc15: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc15: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc15: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %OptionalStorage.facet.loc15_41: %OptionalStorage.type = facet_value %Int.loc15, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc15_41: %OptionalStorage.type = converted %Int.loc15, %OptionalStorage.facet.loc15_41 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %Int.loc15: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %OptionalStorage.facet.loc15_41: %OptionalStorage.type = facet_value %Int.loc15, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc15_41: %OptionalStorage.type = converted %Int.loc15, %OptionalStorage.facet.loc15_41 [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc15: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_72.1 (constants.%Optional.5ec)] // CHECK:STDOUT: %.loc15_42: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.422) = specific_constant imports.%Core.import_ref.84b, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.Some (constants.%Optional.Some.bcf)] // CHECK:STDOUT: %Some.ref: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.422) = name_ref Some, %.loc15_42 [symbolic = %Optional.Some (constants.%Optional.Some.bcf)] -// CHECK:STDOUT: %value.ref.loc15: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = name_ref value, %value -// CHECK:STDOUT: %OptionalStorage.facet.loc15_53.1: %OptionalStorage.type = facet_value constants.%Int.67af24.1, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc15_53.1: %OptionalStorage.type = converted constants.%Int.67af24.1, %OptionalStorage.facet.loc15_53.1 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %OptionalStorage.facet.loc15_53.2: %OptionalStorage.type = facet_value constants.%Int.67af24.1, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc15_53.2: %OptionalStorage.type = converted constants.%Int.67af24.1, %OptionalStorage.facet.loc15_53.2 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %value.ref.loc15: ref @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = name_ref value, %value +// CHECK:STDOUT: %OptionalStorage.facet.loc15_53.1: %OptionalStorage.type = facet_value constants.%Int.67af24.1, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc15_53.1: %OptionalStorage.type = converted constants.%Int.67af24.1, %OptionalStorage.facet.loc15_53.1 [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %OptionalStorage.facet.loc15_53.2: %OptionalStorage.type = facet_value constants.%Int.67af24.1, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc15_53.2: %OptionalStorage.type = converted constants.%Int.67af24.1, %OptionalStorage.facet.loc15_53.2 [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] // CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.1: = specific_function %Some.ref, @Optional.Some(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] -// CHECK:STDOUT: %.loc11_69.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = splice_block %return.param {} -// CHECK:STDOUT: %.loc15_48: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %value.ref.loc15 -// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) to %.loc11_69.1 = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) +// CHECK:STDOUT: %.loc11_72.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_72.1 (%Optional.5ec) = splice_block %return.param {} +// CHECK:STDOUT: %.loc15_48: @IntRange.as.Iterate.impl.Next.%Int.loc11_41.1 (%Int.67af24.1) = acquire_value %value.ref.loc15 +// CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_72.1 (%Optional.5ec) to %.loc11_72.1 = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) // CHECK:STDOUT: %impl.elem2.loc12_7.1: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.b53) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element2 [symbolic = %impl.elem2.loc12_7.3 (constants.%impl.elem2.9bd)] // CHECK:STDOUT: %bound_method.loc12_7.1: = bound_method %value.var, %impl.elem2.loc12_7.1 // CHECK:STDOUT: %Destroy.facet.loc12_7.1: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] @@ -781,15 +772,15 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %Core.ref.loc17_30: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref.loc17: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc17: Core.IntLiteral = name_ref N, @IntRange.%N.loc4_17.2 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %Int.loc17: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_37.1 (constants.%Int.67af24.1)] -// CHECK:STDOUT: %OptionalStorage.facet.loc17: %OptionalStorage.type = facet_value %Int.loc17, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %.loc17_41: %OptionalStorage.type = converted %Int.loc17, %OptionalStorage.facet.loc17 [symbolic = %OptionalStorage.facet.loc11_69.1 (constants.%OptionalStorage.facet.b99)] -// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_69.1 (constants.%Optional.5ec)] +// CHECK:STDOUT: %Int.loc17: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc11_41.1 (constants.%Int.67af24.1)] +// CHECK:STDOUT: %OptionalStorage.facet.loc17: %OptionalStorage.type = facet_value %Int.loc17, (constants.%OptionalStorage.lookup_impl_witness.a32) [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %.loc17_41: %OptionalStorage.type = converted %Int.loc17, %OptionalStorage.facet.loc17 [symbolic = %OptionalStorage.facet.loc11_72.1 (constants.%OptionalStorage.facet.b99)] +// CHECK:STDOUT: %Optional.loc17: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.loc11_72.1 (constants.%Optional.5ec)] // CHECK:STDOUT: %.loc17_42: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.2aa) = specific_constant imports.%Core.import_ref.6e4, @Optional(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.None (constants.%Optional.None.fb7)] // CHECK:STDOUT: %None.ref: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.2aa) = name_ref None, %.loc17_42 [symbolic = %Optional.None (constants.%Optional.None.fb7)] // CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.1: = specific_function %None.ref, @Optional.None(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] -// CHECK:STDOUT: %.loc11_69.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = splice_block %return.param {} -// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) to %.loc11_69.2 = call %Optional.None.specific_fn.loc17_42.1() +// CHECK:STDOUT: %.loc11_72.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_72.1 (%Optional.5ec) = splice_block %return.param {} +// CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_72.1 (%Optional.5ec) to %.loc11_72.2 = call %Optional.None.specific_fn.loc17_42.1() // CHECK:STDOUT: %impl.elem2.loc12_7.2: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.b53) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element2 [symbolic = %impl.elem2.loc12_7.3 (constants.%impl.elem2.9bd)] // CHECK:STDOUT: %bound_method.loc12_7.3: = bound_method %value.var, %impl.elem2.loc12_7.2 // CHECK:STDOUT: %Destroy.facet.loc12_7.3: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] @@ -894,22 +885,21 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %pattern_type.loc11_13 => constants.%pattern_type.1ea // CHECK:STDOUT: %self.param_patt.loc11_13.2 => constants.%self.param_patt.5cc // CHECK:STDOUT: %self.patt.loc11_13.2 => constants.%self.patt.b4c -// CHECK:STDOUT: %Int.loc11_37.1 => constants.%Int.67af24.1 -// CHECK:STDOUT: %ptr.loc11_38.1 => constants.%ptr.41e -// CHECK:STDOUT: %pattern_type.loc11_25 => constants.%pattern_type.833 -// CHECK:STDOUT: %cursor.param_patt.loc11_25.2 => constants.%cursor.param_patt.328 -// CHECK:STDOUT: %cursor.patt.loc11_25.2 => constants.%cursor.patt.15e +// CHECK:STDOUT: %Int.loc11_41.1 => constants.%Int.67af24.1 +// CHECK:STDOUT: %pattern_type.loc11_29 => constants.%pattern_type.142cb7.1 +// CHECK:STDOUT: %cursor.param_patt.loc11_29.2 => constants.%cursor.param_patt.ce4 +// CHECK:STDOUT: %cursor.patt.loc11_29.2 => constants.%cursor.patt.ed4 // CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%Destroy.lookup_impl_witness.173 // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.df6 // CHECK:STDOUT: %facet_value => constants.%facet_value -// CHECK:STDOUT: %.loc11_69.3 => constants.%.368 +// CHECK:STDOUT: %.loc11_72.3 => constants.%.368 // CHECK:STDOUT: %OptionalStorage.lookup_impl_witness => constants.%OptionalStorage.lookup_impl_witness.a32 -// CHECK:STDOUT: %OptionalStorage.facet.loc11_69.1 => constants.%OptionalStorage.facet.b99 -// CHECK:STDOUT: %Optional.loc11_69.1 => constants.%Optional.5ec -// CHECK:STDOUT: %.loc11_69.4 => constants.%.3f3 -// CHECK:STDOUT: %pattern_type.loc11_69 => constants.%pattern_type.b38 -// CHECK:STDOUT: %return.param_patt.loc11_69.2 => constants.%return.param_patt.4bb -// CHECK:STDOUT: %return.patt.loc11_41.2 => constants.%return.patt.427 +// CHECK:STDOUT: %OptionalStorage.facet.loc11_72.1 => constants.%OptionalStorage.facet.b99 +// CHECK:STDOUT: %Optional.loc11_72.1 => constants.%Optional.5ec +// CHECK:STDOUT: %.loc11_72.4 => constants.%.3f3 +// CHECK:STDOUT: %pattern_type.loc11_72 => constants.%pattern_type.b38 +// CHECK:STDOUT: %return.param_patt.loc11_72.2 => constants.%return.param_patt.4bb +// CHECK:STDOUT: %return.patt.loc11_44.2 => constants.%return.patt.427 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @IntRange(constants.%int_32) { diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 40243c22d970..37f365dd4933 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -31,7 +31,7 @@ library "[[@TEST_NAME]]"; class TrivialRange { impl as Core.Iterate where .CursorType = () and .ElementType = () { fn NewCursor(unused self) {} - fn Next(unused self, unused cursor: ()*) -> Core.Optional(()) { + fn Next(unused self, unused ref cursor: ()) -> Core.Optional(()) { return Core.Optional(()).None(); } } @@ -75,7 +75,7 @@ fn Run() { // CHECK:STDOUT: %pattern_type.d81: type = pattern_type %TrivialRange [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_31.1 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.93de00.1: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %Optional.0cb: type = class_type @Optional, @Optional(%Copy.facet) [concrete] // CHECK:STDOUT: %pattern_type.236: type = pattern_type %Optional.0cb [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.type: type = fn_type @TrivialRange.as.Iterate.impl.Next [concrete] @@ -83,7 +83,6 @@ fn Run() { // CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %TrivialRange, (%Iterate.impl_witness) [concrete] // CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.f14: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet) [concrete] // CHECK:STDOUT: %Iterate.WithSelf.Next.type.8fe: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet) [concrete] -// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.2: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_31.2 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.93de00.2: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.2 = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -282,12 +281,11 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: %ptr.843 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.98d = impl_witness_access constants.%Iterate.impl_witness, element3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next] // CHECK:STDOUT: %bound_method.loc18_35.2: = bound_method %.loc18_20.2, %impl.elem3 [concrete = constants.%TrivialRange.as.Iterate.impl.Next.bound] // CHECK:STDOUT: %.loc18_35.1: ref %Optional.0cb = temporary_storage // CHECK:STDOUT: %.loc18_20.4: %TrivialRange = acquire_value %.loc18_20.2 [concrete = constants.%TrivialRange.val] -// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.0cb to %.loc18_35.1 = call %bound_method.loc18_35.2(%.loc18_20.4, %addr) +// CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.call: init %Optional.0cb to %.loc18_35.1 = call %bound_method.loc18_35.2(%.loc18_20.4, %var) // CHECK:STDOUT: %.loc18_35.2: ref %Optional.0cb = temporary %.loc18_35.1, %TrivialRange.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc18_35.3: %Optional.HasValue.type.a09 = specific_constant imports.%Core.import_ref.1db, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.3ad] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.a09 = name_ref HasValue, %.loc18_35.3 [concrete = constants.%Optional.HasValue.3ad] diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index c89f5338a127..d63a75d3ef6d 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -21,7 +21,7 @@ class EmptyRange(T: Core.Copy) { fn NewCursor(unused self) -> {} { return {}; } - fn Next(unused self, unused cursor: {}*) -> Core.Optional(T) { + fn Next(unused self, unused ref cursor: {}) -> Core.Optional(T) { return Core.Optional(T).None(); } } @@ -128,7 +128,6 @@ fn Run() { // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] -// CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %c.patt.aa8: %pattern_type.98b = value_binding_pattern c [concrete] // CHECK:STDOUT: %EmptyRange.type: type = generic_class_type @EmptyRange [concrete] // CHECK:STDOUT: %EmptyRange.generic: %EmptyRange.type = struct_value () [concrete] @@ -245,7 +244,7 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.b6b: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.561) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.31b)] -// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] +// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_69, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Core.import_ref.127 = import_ref Core//prelude/parts/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %field_decl.c67: @Optional.%Optional.elem.2 (%Optional.elem.2ae) = field_decl value, element1, %Core.import_ref.127 in [concrete] {} @@ -367,14 +366,13 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: %ptr.c28 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.1d5 = impl_witness_access constants.%Iterate.impl_witness.3a0, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.795] // CHECK:STDOUT: %bound_method.loc10_36.3: = bound_method %.loc10_35.2, %impl.elem3 // CHECK:STDOUT: %specific_fn.loc10_36.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_36.4: = bound_method %.loc10_35.2, %specific_fn.loc10_36.2 // CHECK:STDOUT: %.loc10_36.1: ref %Optional.0e3 = temporary_storage // CHECK:STDOUT: %.loc10_35.4: %EmptyRange.b10 = acquire_value %.loc10_35.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.0e3 to %.loc10_36.1 = call %bound_method.loc10_36.4(%.loc10_35.4, %addr) +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.0e3 to %.loc10_36.1 = call %bound_method.loc10_36.4(%.loc10_35.4, %var) // CHECK:STDOUT: %.loc10_36.2: ref %Optional.0e3 = temporary %.loc10_36.1, %EmptyRange.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc10_36.3: %Optional.HasValue.type.383 = specific_constant imports.%Core.import_ref.1db, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.45e] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.383 = name_ref HasValue, %.loc10_36.3 [concrete = constants.%Optional.HasValue.45e] @@ -515,7 +513,6 @@ fn Run() { // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] -// CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %c.patt.dd0: %pattern_type.98b = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt.dd0 [concrete] @@ -634,7 +631,7 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.b6b: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.561) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.31b)] -// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] +// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_69, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Core.import_ref.127 = import_ref Core//prelude/parts/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %field_decl.c67: @Optional.%Optional.elem.2 (%Optional.elem.2ae) = field_decl value, element1, %Core.import_ref.127 in [concrete] {} @@ -758,14 +755,13 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc10: %ptr.c28 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.1d5 = impl_witness_access constants.%Iterate.impl_witness.3a0, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.795] // CHECK:STDOUT: %bound_method.loc10_40.3: = bound_method %.loc10_39.2, %impl.elem3 // CHECK:STDOUT: %specific_fn.loc10_40.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_40.4: = bound_method %.loc10_39.2, %specific_fn.loc10_40.2 // CHECK:STDOUT: %.loc10_40.1: ref %Optional.0e3 = temporary_storage // CHECK:STDOUT: %.loc10_39.4: %EmptyRange.b10 = acquire_value %.loc10_39.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.0e3 to %.loc10_40.1 = call %bound_method.loc10_40.4(%.loc10_39.4, %addr.loc10) +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.0e3 to %.loc10_40.1 = call %bound_method.loc10_40.4(%.loc10_39.4, %var) // CHECK:STDOUT: %.loc10_40.2: ref %Optional.0e3 = temporary %.loc10_40.1, %EmptyRange.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc10_40.3: %Optional.HasValue.type.383 = specific_constant imports.%Core.import_ref.1db, @Optional(constants.%Copy.facet) [concrete = constants.%Optional.HasValue.45e] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.383 = name_ref HasValue, %.loc10_40.3 [concrete = constants.%Optional.HasValue.45e] @@ -792,8 +788,8 @@ fn Run() { // CHECK:STDOUT: %c: ref %C = wrapper_binding c, %c.var // CHECK:STDOUT: %Body.ref: %Body.type = name_ref Body, file.%Body.decl [concrete = constants.%Body] // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %addr.loc11: %ptr.6b6 = addr_of %c.ref -// CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%addr.loc11) +// CHECK:STDOUT: %addr: %ptr.6b6 = addr_of %c.ref +// CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%addr) // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_40.1: = bound_method %.loc10_40.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_40.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_40.1(%.loc10_40.2) // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_8.1: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 @@ -931,7 +927,6 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.d81: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.701) [concrete] // CHECK:STDOUT: %EmptyRange.Make.type.059: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.701) [concrete] // CHECK:STDOUT: %EmptyRange.Make.787: %EmptyRange.Make.type.059 = struct_value () [concrete] -// CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.886: type = pattern_type %EmptyRange.d81 [concrete] // CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.787, @EmptyRange.Make(%Copy.facet.701) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] @@ -1037,7 +1032,7 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.b6b: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.561) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.31b)] -// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] +// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_69, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Core.import_ref.127 = import_ref Core//prelude/parts/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %field_decl.c67: @Optional.%Optional.elem.2 (%Optional.elem.2ae) = field_decl value, element1, %Core.import_ref.127 in [concrete] {} @@ -1163,14 +1158,13 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: %ptr.c28 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.a85 = impl_witness_access constants.%Iterate.impl_witness.65f, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.3fd] // CHECK:STDOUT: %bound_method.loc10_61.3: = bound_method %.loc10_60.2, %impl.elem3 // CHECK:STDOUT: %specific_fn.loc10_61.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.701) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_61.4: = bound_method %.loc10_60.2, %specific_fn.loc10_61.2 // CHECK:STDOUT: %.loc10_61.1: ref %Optional.4d1 = temporary_storage // CHECK:STDOUT: %.loc10_60.4: %EmptyRange.d81 = acquire_value %.loc10_60.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.4d1 to %.loc10_61.1 = call %bound_method.loc10_61.4(%.loc10_60.4, %addr) +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.4d1 to %.loc10_61.1 = call %bound_method.loc10_61.4(%.loc10_60.4, %var) // CHECK:STDOUT: %.loc10_61.2: ref %Optional.4d1 = temporary %.loc10_61.1, %EmptyRange.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc10_61.3: %Optional.HasValue.type.34e = specific_constant imports.%Core.import_ref.1db, @Optional(constants.%Copy.facet.701) [concrete = constants.%Optional.HasValue.55e] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.34e = name_ref HasValue, %.loc10_61.3 [concrete = constants.%Optional.HasValue.55e] @@ -1328,7 +1322,6 @@ fn Run() { // CHECK:STDOUT: %Body.type: type = fn_type @Body [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Body: %Body.type = struct_value () [concrete] -// CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] // CHECK:STDOUT: %a.patt.1ad: %pattern_type.98b = value_binding_pattern a [concrete] // CHECK:STDOUT: %b.patt.29b: %pattern_type.98b = value_binding_pattern b [concrete] // CHECK:STDOUT: %tuple.type.748: type = tuple_type (%C, %C) [concrete] @@ -1468,7 +1461,7 @@ fn Run() { // CHECK:STDOUT: %Main.import_ref.71a = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.999 = import_ref Main//empty_range, loc7_68, unloaded // CHECK:STDOUT: %Main.import_ref.b6b: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor.type (%EmptyRange.as.Iterate.impl.NewCursor.type.561) = import_ref Main//empty_range, loc8_37, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.NewCursor (constants.%EmptyRange.as.Iterate.impl.NewCursor.31b)] -// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_66, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] +// CHECK:STDOUT: %Main.import_ref.b499: @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next.type (%EmptyRange.as.Iterate.impl.Next.type.c04) = import_ref Main//empty_range, loc11_69, loaded [symbolic = @EmptyRange.as.Iterate.impl.%EmptyRange.as.Iterate.impl.Next (constants.%EmptyRange.as.Iterate.impl.Next.cdc)] // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: %Core.import_ref.127 = import_ref Core//prelude/parts/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %field_decl.c67: @Optional.%Optional.elem.2 (%Optional.elem.2ae) = field_decl value, element1, %Core.import_ref.127 in [concrete] {} @@ -1608,14 +1601,13 @@ fn Run() { // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: %ptr.c28 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.f09 = impl_witness_access constants.%Iterate.impl_witness.28e, element3 [concrete = constants.%EmptyRange.as.Iterate.impl.Next.e7f] // CHECK:STDOUT: %bound_method.loc10_49.3: = bound_method %.loc10_48.2, %impl.elem3 // CHECK:STDOUT: %specific_fn.loc10_49.2: = specific_function %impl.elem3, @EmptyRange.as.Iterate.impl.Next(constants.%Copy.facet.38c) [concrete = constants.%EmptyRange.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc10_49.4: = bound_method %.loc10_48.2, %specific_fn.loc10_49.2 // CHECK:STDOUT: %.loc10_49.1: ref %Optional.992 = temporary_storage // CHECK:STDOUT: %.loc10_48.4: %EmptyRange.8d3 = acquire_value %.loc10_48.2 -// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.992 to %.loc10_49.1 = call %bound_method.loc10_49.4(%.loc10_48.4, %addr) +// CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.call: init %Optional.992 to %.loc10_49.1 = call %bound_method.loc10_49.4(%.loc10_48.4, %var) // CHECK:STDOUT: %.loc10_49.2: ref %Optional.992 = temporary %.loc10_49.1, %EmptyRange.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc10_49.3: %Optional.HasValue.type.e1b = specific_constant imports.%Core.import_ref.1db, @Optional(constants.%Copy.facet.38c) [concrete = constants.%Optional.HasValue.b06] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.e1b = name_ref HasValue, %.loc10_49.3 [concrete = constants.%Optional.HasValue.b06] diff --git a/toolchain/check/testdata/interop/cpp/range_for.carbon b/toolchain/check/testdata/interop/cpp/range_for.carbon index dafa095f6df5..ee1b955fceac 100644 --- a/toolchain/check/testdata/interop/cpp/range_for.carbon +++ b/toolchain/check/testdata/interop/cpp/range_for.carbon @@ -887,7 +887,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.a11: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.462, element1 [symbolic] // CHECK:STDOUT: %as_type.f79: type = facet_access_type %impl.elem1.a11 [symbolic] // CHECK:STDOUT: %specific_impl_fn.a09: = specific_impl_function %impl.elem2.3eb, @Iterate.WithSelf.NewCursor(%Iterate.facet.e5e) [symbolic] -// CHECK:STDOUT: %ptr.b18: type = ptr_type %as_type.f79 [symbolic] // CHECK:STDOUT: %.218: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.6c3, %Iterate.facet.e5e [symbolic] // CHECK:STDOUT: %impl.elem3.b50: %.218 = impl_witness_access %Iterate.lookup_impl_witness.462, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.9f1: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.178) [concrete] @@ -1079,7 +1078,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.713: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.854) [concrete] // CHECK:STDOUT: %.cad: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.4e8, %Iterate.facet.854 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac2: = specific_function %T.as_type.as.Iterate.impl.NewCursor.e00, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.474) [concrete] -// CHECK:STDOUT: %ptr.45c: type = ptr_type %tuple.type.508 [concrete] // CHECK:STDOUT: %.640: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.713, %Iterate.facet.854 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.b01: = specific_function %T.as_type.as.Iterate.impl.Next.311, @T.as_type.as.Iterate.impl.Next(%facet_value.474) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.471: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.0fe) [concrete] @@ -1088,7 +1086,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.aee: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.7d1) [concrete] // CHECK:STDOUT: %.312: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.488, %Iterate.facet.7d1 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.91a: = specific_function %T.as_type.as.Iterate.impl.NewCursor.19e, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.3e1) [concrete] -// CHECK:STDOUT: %ptr.c5c: type = ptr_type %tuple.type.69f [concrete] // CHECK:STDOUT: %.5b5: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.aee, %Iterate.facet.7d1 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.5ef: = specific_function %T.as_type.as.Iterate.impl.Next.372, @T.as_type.as.Iterate.impl.Next(%facet_value.3e1) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c53: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.c6d) [concrete] @@ -1229,7 +1226,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc34_19.3: @TestIterate.%.loc34_19.19 (%.1a4) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_19.3 (constants.%impl.elem2.3eb)] // CHECK:STDOUT: %specific_impl_fn.loc34_19.4: = specific_impl_function %impl.elem2.loc34_19.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc34_19.5) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.a09)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.b18)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc34_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.6c3)] // CHECK:STDOUT: %.loc34_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc34_19.5 [symbolic = %.loc34_19.20 (constants.%.218)] // CHECK:STDOUT: %impl.elem3.loc34_19.2: @TestIterate.%.loc34_19.20 (%.218) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.b50)] @@ -1261,7 +1257,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.b18) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc34_19.1: @TestIterate.%.loc34_19.20 (%.218) = impl_witness_access constants.%Iterate.lookup_impl_witness.462, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.b50)] // CHECK:STDOUT: %bound_method.loc34_19.3: = bound_method %r.ref, %impl.elem3.loc34_19.1 // CHECK:STDOUT: %Iterate.facet.loc34_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.462) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] @@ -1273,7 +1268,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc34_19.2: = specific_impl_function %impl.elem3.loc34_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.e5e) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.598)] // CHECK:STDOUT: %bound_method.loc34_19.4: = bound_method %r.ref, %specific_impl_fn.loc34_19.2 // CHECK:STDOUT: %.loc34_19.7: ref %Optional.0ac = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.0ac to %.loc34_19.7 = call %bound_method.loc34_19.4(%r.ref, %addr) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.0ac to %.loc34_19.7 = call %bound_method.loc34_19.4(%r.ref, %var) // CHECK:STDOUT: %.loc34_19.8: ref %Optional.0ac = temporary %.loc34_19.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc34_19.9: %Optional.HasValue.type.dbd = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.ed9] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.dbd = name_ref HasValue, %.loc34_19.9 [concrete = constants.%Optional.HasValue.ed9] @@ -1439,7 +1434,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next.loc49 // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc49: -// CHECK:STDOUT: %addr.loc49: %ptr.45c = addr_of %var.loc49 // CHECK:STDOUT: %impl.elem3.loc49: %.640 = impl_witness_access constants.%Iterate.impl_witness.2bb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.311] // CHECK:STDOUT: %bound_method.loc49_19.3: = bound_method %m.ref, %impl.elem3.loc49 // CHECK:STDOUT: %facet_value.loc49_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.8e1, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.474] @@ -1450,7 +1444,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %bound_method.loc49_19.4: = bound_method %m.ref, %specific_fn.loc49_19.2 // CHECK:STDOUT: %.loc49_19.5: ref %Optional.0ac = temporary_storage // CHECK:STDOUT: %.loc49_18.2: %MutableRange = acquire_value %m.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc49: init %Optional.0ac to %.loc49_19.5 = call %bound_method.loc49_19.4(%.loc49_18.2, %addr.loc49) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc49: init %Optional.0ac to %.loc49_19.5 = call %bound_method.loc49_19.4(%.loc49_18.2, %var.loc49) // CHECK:STDOUT: %.loc49_19.6: ref %Optional.0ac = temporary %.loc49_19.5, %T.as_type.as.Iterate.impl.Next.call.loc49 // CHECK:STDOUT: %.loc49_19.7: %Optional.HasValue.type.dbd = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.ed9] // CHECK:STDOUT: %HasValue.ref.loc49: %Optional.HasValue.type.dbd = name_ref HasValue, %.loc49_19.7 [concrete = constants.%Optional.HasValue.ed9] @@ -1514,7 +1508,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next.loc55 // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc55: -// CHECK:STDOUT: %addr.loc55: %ptr.c5c = addr_of %var.loc55 // CHECK:STDOUT: %impl.elem3.loc55: %.5b5 = impl_witness_access constants.%Iterate.impl_witness.1a6, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.372] // CHECK:STDOUT: %bound_method.loc55_19.3: = bound_method %c.ref, %impl.elem3.loc55 // CHECK:STDOUT: %facet_value.loc55_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.0f3, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.3e1] @@ -1524,7 +1517,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc55_19.2: = specific_function %impl.elem3.loc55, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.3e1) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.5ef] // CHECK:STDOUT: %bound_method.loc55_19.4: = bound_method %c.ref, %specific_fn.loc55_19.2 // CHECK:STDOUT: %.loc55_19.5: ref %Optional.0ac = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc55: init %Optional.0ac to %.loc55_19.5 = call %bound_method.loc55_19.4(%c.ref, %addr.loc55) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc55: init %Optional.0ac to %.loc55_19.5 = call %bound_method.loc55_19.4(%c.ref, %var.loc55) // CHECK:STDOUT: %.loc55_19.6: ref %Optional.0ac = temporary %.loc55_19.5, %T.as_type.as.Iterate.impl.Next.call.loc55 // CHECK:STDOUT: %.loc55_19.7: %Optional.HasValue.type.dbd = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.ed9] // CHECK:STDOUT: %HasValue.ref.loc55: %Optional.HasValue.type.dbd = name_ref HasValue, %.loc55_19.7 [concrete = constants.%Optional.HasValue.ed9] @@ -1601,7 +1594,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.0fe // CHECK:STDOUT: %as_type => constants.%tuple.type.508 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.c28 -// CHECK:STDOUT: %ptr => constants.%ptr.45c // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.713 // CHECK:STDOUT: %.loc34_19.20 => constants.%.640 // CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.Next.311 @@ -1632,7 +1624,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.c6d // CHECK:STDOUT: %as_type => constants.%tuple.type.69f // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.8d5 -// CHECK:STDOUT: %ptr => constants.%ptr.c5c // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.aee // CHECK:STDOUT: %.loc34_19.20 => constants.%.5b5 // CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.Next.372 @@ -1737,7 +1728,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.fbc: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.d00, element1 [symbolic] // CHECK:STDOUT: %as_type.389: type = facet_access_type %impl.elem1.fbc [symbolic] // CHECK:STDOUT: %specific_impl_fn.1c3: = specific_impl_function %impl.elem2.7d0, @Iterate.WithSelf.NewCursor(%Iterate.facet.f03) [symbolic] -// CHECK:STDOUT: %ptr.02d: type = ptr_type %as_type.389 [symbolic] // CHECK:STDOUT: %.89f: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.e6f, %Iterate.facet.f03 [symbolic] // CHECK:STDOUT: %impl.elem3.73e: %.89f = impl_witness_access %Iterate.lookup_impl_witness.d00, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.9a0: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.cca) [concrete] @@ -1921,7 +1911,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.37e: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.9e0) [concrete] // CHECK:STDOUT: %.ae2: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.d66, %Iterate.facet.9e0 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.210: = specific_function %T.as_type.as.Iterate.impl.NewCursor.755, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.39a) [concrete] -// CHECK:STDOUT: %ptr.3ce: type = ptr_type %tuple.type.b18 [concrete] // CHECK:STDOUT: %.0f5: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.37e, %Iterate.facet.9e0 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.f32: = specific_function %T.as_type.as.Iterate.impl.Next.8e7, @T.as_type.as.Iterate.impl.Next(%facet_value.39a) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.690: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.645) [concrete] @@ -1930,7 +1919,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.b3c: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.873) [concrete] // CHECK:STDOUT: %.88e: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.7e8, %Iterate.facet.873 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac7: = specific_function %T.as_type.as.Iterate.impl.NewCursor.094, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.9a7) [concrete] -// CHECK:STDOUT: %ptr.310: type = ptr_type %tuple.type.df5 [concrete] // CHECK:STDOUT: %.0fb: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.b3c, %Iterate.facet.873 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.53e: = specific_function %T.as_type.as.Iterate.impl.Next.33b, @T.as_type.as.Iterate.impl.Next(%facet_value.9a7) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.8c6: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.206) [concrete] @@ -2075,7 +2063,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc44_33.3: @TestIterate.%.loc44_33.20 (%.c20) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_33.3 (constants.%impl.elem2.7d0)] // CHECK:STDOUT: %specific_impl_fn.loc44_33.4: = specific_impl_function %impl.elem2.loc44_33.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc44_33.5) [symbolic = %specific_impl_fn.loc44_33.4 (constants.%specific_impl_fn.1c3)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.02d)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc44_33.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.e6f)] // CHECK:STDOUT: %.loc44_33.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc44_33.5 [symbolic = %.loc44_33.21 (constants.%.89f)] // CHECK:STDOUT: %impl.elem3.loc44_33.2: @TestIterate.%.loc44_33.21 (%.89f) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc44_33.2 (constants.%impl.elem3.73e)] @@ -2108,7 +2095,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc44: @TestIterate.%ptr (%ptr.02d) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc44_33.1: @TestIterate.%.loc44_33.21 (%.89f) = impl_witness_access constants.%Iterate.lookup_impl_witness.d00, element3 [symbolic = %impl.elem3.loc44_33.2 (constants.%impl.elem3.73e)] // CHECK:STDOUT: %bound_method.loc44_33.3: = bound_method %r.ref, %impl.elem3.loc44_33.1 // CHECK:STDOUT: %Iterate.facet.loc44_33.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.d00) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] @@ -2121,7 +2107,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %bound_method.loc44_33.4: = bound_method %r.ref, %specific_impl_fn.loc44_33.2 // CHECK:STDOUT: %.loc44_33.7: ref %Optional.d06 = temporary_storage // CHECK:STDOUT: %.loc44_32.2: @TestIterate.%R.as_type.loc40_79.1 (%R.as_type) = acquire_value %r.ref -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.d06 to %.loc44_33.7 = call %bound_method.loc44_33.4(%.loc44_32.2, %addr.loc44) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.d06 to %.loc44_33.7 = call %bound_method.loc44_33.4(%.loc44_32.2, %var) // CHECK:STDOUT: %.loc44_33.8: ref %Optional.d06 = temporary %.loc44_33.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc44_33.9: %Optional.HasValue.type.821 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.960] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.821 = name_ref HasValue, %.loc44_33.9 [concrete = constants.%Optional.HasValue.960] @@ -2288,7 +2274,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next.loc59 // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc59: -// CHECK:STDOUT: %addr.loc59: %ptr.3ce = addr_of %var.loc59 // CHECK:STDOUT: %impl.elem3.loc59: %.0f5 = impl_witness_access constants.%Iterate.impl_witness.dbb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.8e7] // CHECK:STDOUT: %bound_method.loc59_33.3: = bound_method %m.ref, %impl.elem3.loc59 // CHECK:STDOUT: %facet_value.loc59_33.3: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.db9baa.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.db9baa.2) [concrete = constants.%facet_value.39a] @@ -2299,7 +2284,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %bound_method.loc59_33.4: = bound_method %m.ref, %specific_fn.loc59_33.2 // CHECK:STDOUT: %.loc59_33.5: ref %Optional.d06 = temporary_storage // CHECK:STDOUT: %.loc59_32.2: %DiffMutableRange = acquire_value %m.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc59: init %Optional.d06 to %.loc59_33.5 = call %bound_method.loc59_33.4(%.loc59_32.2, %addr.loc59) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc59: init %Optional.d06 to %.loc59_33.5 = call %bound_method.loc59_33.4(%.loc59_32.2, %var.loc59) // CHECK:STDOUT: %.loc59_33.6: ref %Optional.d06 = temporary %.loc59_33.5, %T.as_type.as.Iterate.impl.Next.call.loc59 // CHECK:STDOUT: %.loc59_33.7: %Optional.HasValue.type.821 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.960] // CHECK:STDOUT: %HasValue.ref.loc59: %Optional.HasValue.type.821 = name_ref HasValue, %.loc59_33.7 [concrete = constants.%Optional.HasValue.960] @@ -2364,7 +2349,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next.loc63 // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc63: -// CHECK:STDOUT: %addr.loc63: %ptr.310 = addr_of %var.loc63 // CHECK:STDOUT: %impl.elem3.loc63: %.0fb = impl_witness_access constants.%Iterate.impl_witness.1bb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.33b] // CHECK:STDOUT: %bound_method.loc63_33.3: = bound_method %c.ref, %impl.elem3.loc63 // CHECK:STDOUT: %facet_value.loc63_33.3: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.48b6e9.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.48b6e9.2) [concrete = constants.%facet_value.9a7] @@ -2374,7 +2358,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc63_33.2: = specific_function %impl.elem3.loc63, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.9a7) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.53e] // CHECK:STDOUT: %bound_method.loc63_33.4: = bound_method %c.ref, %specific_fn.loc63_33.2 // CHECK:STDOUT: %.loc63_33.5: ref %Optional.d06 = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc63: init %Optional.d06 to %.loc63_33.5 = call %bound_method.loc63_33.4(%c.ref, %addr.loc63) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc63: init %Optional.d06 to %.loc63_33.5 = call %bound_method.loc63_33.4(%c.ref, %var.loc63) // CHECK:STDOUT: %.loc63_33.6: ref %Optional.d06 = temporary %.loc63_33.5, %T.as_type.as.Iterate.impl.Next.call.loc63 // CHECK:STDOUT: %.loc63_33.7: %Optional.HasValue.type.821 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.960] // CHECK:STDOUT: %HasValue.ref.loc63: %Optional.HasValue.type.821 = name_ref HasValue, %.loc63_33.7 [concrete = constants.%Optional.HasValue.960] @@ -2452,7 +2436,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.645 // CHECK:STDOUT: %as_type => constants.%tuple.type.b18 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.bfe -// CHECK:STDOUT: %ptr => constants.%ptr.3ce // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.37e // CHECK:STDOUT: %.loc44_33.21 => constants.%.0f5 // CHECK:STDOUT: %impl.elem3.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.Next.8e7 @@ -2483,7 +2466,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.206 // CHECK:STDOUT: %as_type => constants.%tuple.type.df5 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.ad6 -// CHECK:STDOUT: %ptr => constants.%ptr.310 // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.b3c // CHECK:STDOUT: %.loc44_33.21 => constants.%.0fb // CHECK:STDOUT: %impl.elem3.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.Next.33b @@ -2585,7 +2567,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.0e3: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.e07, element1 [symbolic] // CHECK:STDOUT: %as_type.400: type = facet_access_type %impl.elem1.0e3 [symbolic] // CHECK:STDOUT: %specific_impl_fn.e06: = specific_impl_function %impl.elem2.348, @Iterate.WithSelf.NewCursor(%Iterate.facet.8b0) [symbolic] -// CHECK:STDOUT: %ptr.196: type = ptr_type %as_type.400 [symbolic] // CHECK:STDOUT: %.fd2: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.627, %Iterate.facet.8b0 [symbolic] // CHECK:STDOUT: %impl.elem3.bb6: %.fd2 = impl_witness_access %Iterate.lookup_impl_witness.e07, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.fbc: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.8be) [concrete] @@ -2706,7 +2687,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.4f7: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.726) [concrete] // CHECK:STDOUT: %.b72: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.292, %Iterate.facet.726 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.8fd, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.670) [concrete] -// CHECK:STDOUT: %ptr.b18: type = ptr_type %tuple.type.9ef [concrete] // CHECK:STDOUT: %.0c0: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.4f7, %Iterate.facet.726 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.4cb, @T.as_type.as.Iterate.impl.Next(%facet_value.670) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.6ef: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.c69) [concrete] @@ -2843,7 +2823,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc27_37.3: @TestIterate.%.loc27_37.20 (%.489) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc27_37.3 (constants.%impl.elem2.348)] // CHECK:STDOUT: %specific_impl_fn.loc27_37.4: = specific_impl_function %impl.elem2.loc27_37.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc27_37.5) [symbolic = %specific_impl_fn.loc27_37.4 (constants.%specific_impl_fn.e06)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.196)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc27_37.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.627)] // CHECK:STDOUT: %.loc27_37.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc27_37.5 [symbolic = %.loc27_37.21 (constants.%.fd2)] // CHECK:STDOUT: %impl.elem3.loc27_37.2: @TestIterate.%.loc27_37.21 (%.fd2) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc27_37.2 (constants.%impl.elem3.bb6)] @@ -2875,7 +2854,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.196) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc27_37.1: @TestIterate.%.loc27_37.21 (%.fd2) = impl_witness_access constants.%Iterate.lookup_impl_witness.e07, element3 [symbolic = %impl.elem3.loc27_37.2 (constants.%impl.elem3.bb6)] // CHECK:STDOUT: %bound_method.loc27_37.3: = bound_method %r.ref, %impl.elem3.loc27_37.1 // CHECK:STDOUT: %Iterate.facet.loc27_37.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.e07) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] @@ -2888,7 +2866,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %bound_method.loc27_37.4: = bound_method %r.ref, %specific_impl_fn.loc27_37.2 // CHECK:STDOUT: %.loc27_37.7: ref %Optional.cb9 = temporary_storage // CHECK:STDOUT: %.loc27_36.2: @TestIterate.%R.as_type.loc25_83.1 (%R.as_type) = acquire_value %r.ref -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.cb9 to %.loc27_37.7 = call %bound_method.loc27_37.4(%.loc27_36.2, %addr) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.cb9 to %.loc27_37.7 = call %bound_method.loc27_37.4(%.loc27_36.2, %var) // CHECK:STDOUT: %.loc27_37.8: ref %Optional.cb9 = temporary %.loc27_37.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc27_37.9: %Optional.HasValue.type.800 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.HasValue.ab3] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.800 = name_ref HasValue, %.loc27_37.9 [concrete = constants.%Optional.HasValue.ab3] @@ -3047,7 +3025,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: %ptr.b18 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.0c0 = impl_witness_access constants.%Iterate.impl_witness.24f, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.4cb] // CHECK:STDOUT: %bound_method.loc37_37.3: = bound_method %r.ref, %impl.elem3 // CHECK:STDOUT: %facet_value.loc37_37.3: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.eaa, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.670] @@ -3058,7 +3035,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %bound_method.loc37_37.4: = bound_method %r.ref, %specific_fn.loc37_37.2 // CHECK:STDOUT: %.loc37_37.5: ref %Optional.cb9 = temporary_storage // CHECK:STDOUT: %.loc37_36.2: %Range = acquire_value %r.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.cb9 to %.loc37_37.5 = call %bound_method.loc37_37.4(%.loc37_36.2, %addr) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.cb9 to %.loc37_37.5 = call %bound_method.loc37_37.4(%.loc37_36.2, %var) // CHECK:STDOUT: %.loc37_37.6: ref %Optional.cb9 = temporary %.loc37_37.5, %T.as_type.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc37_37.7: %Optional.HasValue.type.800 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.HasValue.ab3] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.800 = name_ref HasValue, %.loc37_37.7 [concrete = constants.%Optional.HasValue.ab3] @@ -3129,7 +3106,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.c69 // CHECK:STDOUT: %as_type => constants.%tuple.type.9ef // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.e35 -// CHECK:STDOUT: %ptr => constants.%ptr.b18 // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.4f7 // CHECK:STDOUT: %.loc27_37.21 => constants.%.0c0 // CHECK:STDOUT: %impl.elem3.loc27_37.2 => constants.%T.as_type.as.Iterate.impl.Next.4cb @@ -3231,7 +3207,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.0cf: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.9e0, element1 [symbolic] // CHECK:STDOUT: %as_type.ce3: type = facet_access_type %impl.elem1.0cf [symbolic] // CHECK:STDOUT: %specific_impl_fn.999: = specific_impl_function %impl.elem2.895, @Iterate.WithSelf.NewCursor(%Iterate.facet.f88) [symbolic] -// CHECK:STDOUT: %ptr.44a: type = ptr_type %as_type.ce3 [symbolic] // CHECK:STDOUT: %.b00: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.160, %Iterate.facet.f88 [symbolic] // CHECK:STDOUT: %impl.elem3.c16: %.b00 = impl_witness_access %Iterate.lookup_impl_witness.9e0, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.3e2: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.b6e) [concrete] @@ -3364,7 +3339,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.44e: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.e86) [concrete] // CHECK:STDOUT: %.3f0: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.bcd, %Iterate.facet.e86 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.c9a, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.e81) [concrete] -// CHECK:STDOUT: %ptr.d1a: type = ptr_type %tuple.type.005 [concrete] // CHECK:STDOUT: %.343: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.44e, %Iterate.facet.e86 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.751, @T.as_type.as.Iterate.impl.Next(%facet_value.e81) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.873: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.362) [concrete] @@ -3498,7 +3472,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc24_19.3: @TestIterate.%.loc24_19.19 (%.afc) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc24_19.3 (constants.%impl.elem2.895)] // CHECK:STDOUT: %specific_impl_fn.loc24_19.4: = specific_impl_function %impl.elem2.loc24_19.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc24_19.5) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.999)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.44a)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc24_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.160)] // CHECK:STDOUT: %.loc24_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc24_19.5 [symbolic = %.loc24_19.20 (constants.%.b00)] // CHECK:STDOUT: %impl.elem3.loc24_19.2: @TestIterate.%.loc24_19.20 (%.b00) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.c16)] @@ -3530,7 +3503,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.44a) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc24_19.1: @TestIterate.%.loc24_19.20 (%.b00) = impl_witness_access constants.%Iterate.lookup_impl_witness.9e0, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.c16)] // CHECK:STDOUT: %bound_method.loc24_19.3: = bound_method %r.ref, %impl.elem3.loc24_19.1 // CHECK:STDOUT: %Iterate.facet.loc24_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] @@ -3542,7 +3514,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc24_19.2: = specific_impl_function %impl.elem3.loc24_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.f88) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.b6b)] // CHECK:STDOUT: %bound_method.loc24_19.4: = bound_method %r.ref, %specific_impl_fn.loc24_19.2 // CHECK:STDOUT: %.loc24_19.7: ref %Optional.049 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.049 to %.loc24_19.7 = call %bound_method.loc24_19.4(%r.ref, %addr) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.049 to %.loc24_19.7 = call %bound_method.loc24_19.4(%r.ref, %var) // CHECK:STDOUT: %.loc24_19.8: ref %Optional.049 = temporary %.loc24_19.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc24_19.9: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc24_19.9 [concrete = constants.%Optional.HasValue.776] @@ -3702,7 +3674,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: %ptr.d1a = addr_of %var // CHECK:STDOUT: %impl.elem3: %.343 = impl_witness_access constants.%Iterate.impl_witness.2d1, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.751] // CHECK:STDOUT: %bound_method.loc38_19.3: = bound_method %c.ref, %impl.elem3 // CHECK:STDOUT: %facet_value.loc38_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.2, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.b76, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.e81] @@ -3712,7 +3683,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc38_19.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.e81) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc38_19.4: = bound_method %c.ref, %specific_fn.loc38_19.2 // CHECK:STDOUT: %.loc38_19.5: ref %Optional.049 = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.049 to %.loc38_19.5 = call %bound_method.loc38_19.4(%c.ref, %addr) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.049 to %.loc38_19.5 = call %bound_method.loc38_19.4(%c.ref, %var) // CHECK:STDOUT: %.loc38_19.6: ref %Optional.049 = temporary %.loc38_19.5, %T.as_type.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc38_19.7: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc38_19.7 [concrete = constants.%Optional.HasValue.776] @@ -3784,7 +3755,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.362 // CHECK:STDOUT: %as_type => constants.%tuple.type.005 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.320 -// CHECK:STDOUT: %ptr => constants.%ptr.d1a // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.44e // CHECK:STDOUT: %.loc24_19.20 => constants.%.343 // CHECK:STDOUT: %impl.elem3.loc24_19.2 => constants.%T.as_type.as.Iterate.impl.Next.751 @@ -3886,7 +3856,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.0cf: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.9e0, element1 [symbolic] // CHECK:STDOUT: %as_type.ce3: type = facet_access_type %impl.elem1.0cf [symbolic] // CHECK:STDOUT: %specific_impl_fn.999: = specific_impl_function %impl.elem2.895, @Iterate.WithSelf.NewCursor(%Iterate.facet.f88) [symbolic] -// CHECK:STDOUT: %ptr.44a: type = ptr_type %as_type.ce3 [symbolic] // CHECK:STDOUT: %.b00: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.160, %Iterate.facet.f88 [symbolic] // CHECK:STDOUT: %impl.elem3.c16: %.b00 = impl_witness_access %Iterate.lookup_impl_witness.9e0, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.3e2: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.b6e) [concrete] @@ -4019,7 +3988,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.7af: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.d07) [concrete] // CHECK:STDOUT: %.698: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.0ef, %Iterate.facet.d07 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.fcd, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.efd) [concrete] -// CHECK:STDOUT: %ptr.a4f: type = ptr_type %tuple.type.dd0 [concrete] // CHECK:STDOUT: %.782: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.7af, %Iterate.facet.d07 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.c88, @T.as_type.as.Iterate.impl.Next(%facet_value.efd) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.e6e: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.f0b) [concrete] @@ -4153,7 +4121,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc26_19.3: @TestIterate.%.loc26_19.19 (%.afc) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc26_19.3 (constants.%impl.elem2.895)] // CHECK:STDOUT: %specific_impl_fn.loc26_19.4: = specific_impl_function %impl.elem2.loc26_19.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc26_19.5) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.999)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.44a)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc26_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.160)] // CHECK:STDOUT: %.loc26_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc26_19.5 [symbolic = %.loc26_19.20 (constants.%.b00)] // CHECK:STDOUT: %impl.elem3.loc26_19.2: @TestIterate.%.loc26_19.20 (%.b00) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.c16)] @@ -4185,7 +4152,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.44a) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc26_19.1: @TestIterate.%.loc26_19.20 (%.b00) = impl_witness_access constants.%Iterate.lookup_impl_witness.9e0, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.c16)] // CHECK:STDOUT: %bound_method.loc26_19.3: = bound_method %r.ref, %impl.elem3.loc26_19.1 // CHECK:STDOUT: %Iterate.facet.loc26_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] @@ -4197,7 +4163,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc26_19.2: = specific_impl_function %impl.elem3.loc26_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.f88) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.b6b)] // CHECK:STDOUT: %bound_method.loc26_19.4: = bound_method %r.ref, %specific_impl_fn.loc26_19.2 // CHECK:STDOUT: %.loc26_19.7: ref %Optional.049 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.049 to %.loc26_19.7 = call %bound_method.loc26_19.4(%r.ref, %addr) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.049 to %.loc26_19.7 = call %bound_method.loc26_19.4(%r.ref, %var) // CHECK:STDOUT: %.loc26_19.8: ref %Optional.049 = temporary %.loc26_19.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc26_19.9: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc26_19.9 [concrete = constants.%Optional.HasValue.776] @@ -4358,7 +4324,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: %ptr.a4f = addr_of %var // CHECK:STDOUT: %impl.elem3: %.782 = impl_witness_access constants.%Iterate.impl_witness.6cb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.c88] // CHECK:STDOUT: %bound_method.loc68_19.3: = bound_method %m.ref, %impl.elem3 // CHECK:STDOUT: %facet_value.loc68_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.2, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.e74, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.efd] @@ -4369,7 +4334,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %bound_method.loc68_19.4: = bound_method %m.ref, %specific_fn.loc68_19.2 // CHECK:STDOUT: %.loc68_19.5: ref %Optional.049 = temporary_storage // CHECK:STDOUT: %.loc68_18.2: %MutableRange = acquire_value %m.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.049 to %.loc68_19.5 = call %bound_method.loc68_19.4(%.loc68_18.2, %addr) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.049 to %.loc68_19.5 = call %bound_method.loc68_19.4(%.loc68_18.2, %var) // CHECK:STDOUT: %.loc68_19.6: ref %Optional.049 = temporary %.loc68_19.5, %T.as_type.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc68_19.7: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc68_19.7 [concrete = constants.%Optional.HasValue.776] @@ -4441,7 +4406,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.f0b // CHECK:STDOUT: %as_type => constants.%tuple.type.dd0 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.843 -// CHECK:STDOUT: %ptr => constants.%ptr.a4f // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.7af // CHECK:STDOUT: %.loc26_19.20 => constants.%.782 // CHECK:STDOUT: %impl.elem3.loc26_19.2 => constants.%T.as_type.as.Iterate.impl.Next.c88 @@ -4546,7 +4510,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.d56: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.01e, element1 [symbolic] // CHECK:STDOUT: %as_type.db9: type = facet_access_type %impl.elem1.d56 [symbolic] // CHECK:STDOUT: %specific_impl_fn.2f4: = specific_impl_function %impl.elem2.b2a, @Iterate.WithSelf.NewCursor(%Iterate.facet.467) [symbolic] -// CHECK:STDOUT: %ptr.eca: type = ptr_type %as_type.db9 [symbolic] // CHECK:STDOUT: %.2d6: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.bb3, %Iterate.facet.467 [symbolic] // CHECK:STDOUT: %impl.elem3.c97: %.2d6 = impl_witness_access %Iterate.lookup_impl_witness.01e, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.53f: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.978) [concrete] @@ -4677,7 +4640,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.5e6: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.80d) [concrete] // CHECK:STDOUT: %.182: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.c59, %Iterate.facet.80d [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.fa5, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.e8b) [concrete] -// CHECK:STDOUT: %ptr.d33: type = ptr_type %tuple.type.7a6 [concrete] // CHECK:STDOUT: %.883: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.5e6, %Iterate.facet.80d [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.e9b, @T.as_type.as.Iterate.impl.Next(%facet_value.e8b) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.036: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.d83) [concrete] @@ -4823,7 +4785,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc31_37.3: @TestIterate.%.loc31_37.20 (%.9d7) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_37.3 (constants.%impl.elem2.b2a)] // CHECK:STDOUT: %specific_impl_fn.loc31_37.4: = specific_impl_function %impl.elem2.loc31_37.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc31_37.5) [symbolic = %specific_impl_fn.loc31_37.4 (constants.%specific_impl_fn.2f4)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.eca)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc31_37.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.bb3)] // CHECK:STDOUT: %.loc31_37.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc31_37.5 [symbolic = %.loc31_37.21 (constants.%.2d6)] // CHECK:STDOUT: %impl.elem3.loc31_37.2: @TestIterate.%.loc31_37.21 (%.2d6) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_37.2 (constants.%impl.elem3.c97)] @@ -4855,7 +4816,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc31: @TestIterate.%ptr (%ptr.eca) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc31_37.1: @TestIterate.%.loc31_37.21 (%.2d6) = impl_witness_access constants.%Iterate.lookup_impl_witness.01e, element3 [symbolic = %impl.elem3.loc31_37.2 (constants.%impl.elem3.c97)] // CHECK:STDOUT: %bound_method.loc31_37.3: = bound_method %r.ref, %impl.elem3.loc31_37.1 // CHECK:STDOUT: %Iterate.facet.loc31_37.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.01e) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] @@ -4867,7 +4827,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc31_37.2: = specific_impl_function %impl.elem3.loc31_37.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.467) [symbolic = %specific_impl_fn.loc31_37.5 (constants.%specific_impl_fn.5ea)] // CHECK:STDOUT: %bound_method.loc31_37.4: = bound_method %r.ref, %specific_impl_fn.loc31_37.2 // CHECK:STDOUT: %.loc31_37.7: ref %Optional.e69 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.e69 to %.loc31_37.7 = call %bound_method.loc31_37.4(%r.ref, %addr.loc31) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.e69 to %.loc31_37.7 = call %bound_method.loc31_37.4(%r.ref, %var) // CHECK:STDOUT: %.loc31_37.8: ref %Optional.e69 = temporary %.loc31_37.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc31_37.9: %Optional.HasValue.type.c61 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.HasValue.ba9d] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c61 = name_ref HasValue, %.loc31_37.9 [concrete = constants.%Optional.HasValue.ba9d] @@ -5034,7 +4994,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc45: %ptr.d33 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.883 = impl_witness_access constants.%Iterate.impl_witness.6b0, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.e9b] // CHECK:STDOUT: %bound_method.loc45_37.3: = bound_method %c.ref, %impl.elem3 // CHECK:STDOUT: %facet_value.loc45_37.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.226, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.429ac1.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.429ac1.2) [concrete = constants.%facet_value.e8b] @@ -5044,7 +5003,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc45_37.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.e8b) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc45_37.4: = bound_method %c.ref, %specific_fn.loc45_37.2 // CHECK:STDOUT: %.loc45_37.5: ref %Optional.e69 = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.e69 to %.loc45_37.5 = call %bound_method.loc45_37.4(%c.ref, %addr.loc45) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.e69 to %.loc45_37.5 = call %bound_method.loc45_37.4(%c.ref, %var) // CHECK:STDOUT: %.loc45_37.6: ref %Optional.e69 = temporary %.loc45_37.5, %T.as_type.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc45_37.7: %Optional.HasValue.type.c61 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.HasValue.ba9d] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c61 = name_ref HasValue, %.loc45_37.7 [concrete = constants.%Optional.HasValue.ba9d] @@ -5123,7 +5082,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.d83 // CHECK:STDOUT: %as_type => constants.%tuple.type.7a6 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.cf0 -// CHECK:STDOUT: %ptr => constants.%ptr.d33 // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.5e6 // CHECK:STDOUT: %.loc31_37.21 => constants.%.883 // CHECK:STDOUT: %impl.elem3.loc31_37.2 => constants.%T.as_type.as.Iterate.impl.Next.e9b @@ -5199,7 +5157,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.0e0: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.711, element1 [symbolic] // CHECK:STDOUT: %as_type.b30: type = facet_access_type %impl.elem1.0e0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.d24: = specific_impl_function %impl.elem2.bf8, @Iterate.WithSelf.NewCursor(%Iterate.facet.04e) [symbolic] -// CHECK:STDOUT: %ptr.46a: type = ptr_type %as_type.b30 [symbolic] // CHECK:STDOUT: %.b83: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.9d6, %Iterate.facet.04e [symbolic] // CHECK:STDOUT: %impl.elem3.351: %.b83 = impl_witness_access %Iterate.lookup_impl_witness.711, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.6f8: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.14c) [concrete] @@ -5409,7 +5366,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc31_44.3: @TestIterate.%.loc31_44.20 (%.d1d) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_44.3 (constants.%impl.elem2.bf8)] // CHECK:STDOUT: %specific_impl_fn.loc31_44.4: = specific_impl_function %impl.elem2.loc31_44.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc31_44.5) [symbolic = %specific_impl_fn.loc31_44.4 (constants.%specific_impl_fn.d24)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.46a)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc31_44.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.9d6)] // CHECK:STDOUT: %.loc31_44.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc31_44.5 [symbolic = %.loc31_44.21 (constants.%.b83)] // CHECK:STDOUT: %impl.elem3.loc31_44.2: @TestIterate.%.loc31_44.21 (%.b83) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_44.2 (constants.%impl.elem3.351)] @@ -5441,7 +5397,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc31: @TestIterate.%ptr (%ptr.46a) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc31_44.1: @TestIterate.%.loc31_44.21 (%.b83) = impl_witness_access constants.%Iterate.lookup_impl_witness.711, element3 [symbolic = %impl.elem3.loc31_44.2 (constants.%impl.elem3.351)] // CHECK:STDOUT: %bound_method.loc31_44.3: = bound_method %r.ref, %impl.elem3.loc31_44.1 // CHECK:STDOUT: %Iterate.facet.loc31_44.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.711) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] @@ -5453,7 +5408,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc31_44.2: = specific_impl_function %impl.elem3.loc31_44.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.04e) [symbolic = %specific_impl_fn.loc31_44.5 (constants.%specific_impl_fn.946)] // CHECK:STDOUT: %bound_method.loc31_44.4: = bound_method %r.ref, %specific_impl_fn.loc31_44.2 // CHECK:STDOUT: %.loc31_44.7: ref %Optional.59e = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.59e to %.loc31_44.7 = call %bound_method.loc31_44.4(%r.ref, %addr.loc31) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.59e to %.loc31_44.7 = call %bound_method.loc31_44.4(%r.ref, %var) // CHECK:STDOUT: %.loc31_44.8: ref %Optional.59e = temporary %.loc31_44.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc31_44.9: %Optional.HasValue.type.22f = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.864) [concrete = constants.%Optional.HasValue.c86] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.22f = name_ref HasValue, %.loc31_44.9 [concrete = constants.%Optional.HasValue.c86] @@ -5611,7 +5566,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc94: = addr_of [concrete = ] // CHECK:STDOUT: %HasValue.ref: = name_ref HasValue, [concrete = ] // CHECK:STDOUT: if br !for.body else br !for.done // CHECK:STDOUT: @@ -5733,7 +5687,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1.751: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.a99, element1 [symbolic] // CHECK:STDOUT: %as_type.733: type = facet_access_type %impl.elem1.751 [symbolic] // CHECK:STDOUT: %specific_impl_fn.986: = specific_impl_function %impl.elem2.51b, @Iterate.WithSelf.NewCursor(%Iterate.facet.c55) [symbolic] -// CHECK:STDOUT: %ptr.696: type = ptr_type %as_type.733 [symbolic] // CHECK:STDOUT: %.c1e: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.cd7, %Iterate.facet.c55 [symbolic] // CHECK:STDOUT: %impl.elem3.576: %.c1e = impl_witness_access %Iterate.lookup_impl_witness.a99, element3 [symbolic] // CHECK:STDOUT: %DefaultOptionalStorage.58e: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.36a) [concrete] @@ -5856,7 +5809,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterate.WithSelf.Next.type.c27: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.c14) [concrete] // CHECK:STDOUT: %.c8f: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.e77, %Iterate.facet.c14 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.4ab, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.cc4) [concrete] -// CHECK:STDOUT: %ptr.b95: type = ptr_type %tuple.type.de6 [concrete] // CHECK:STDOUT: %.d7e: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.c27, %Iterate.facet.c14 [concrete] // CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.214, @T.as_type.as.Iterate.impl.Next(%facet_value.cc4) [concrete] // CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c7c: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.c9a) [concrete] @@ -6002,7 +5954,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem2.loc38_41.3: @TestIterate.%.loc38_41.20 (%.57a) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc38_41.3 (constants.%impl.elem2.51b)] // CHECK:STDOUT: %specific_impl_fn.loc38_41.4: = specific_impl_function %impl.elem2.loc38_41.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc38_41.5) [symbolic = %specific_impl_fn.loc38_41.4 (constants.%specific_impl_fn.986)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.696)] // CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc38_41.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.cd7)] // CHECK:STDOUT: %.loc38_41.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc38_41.5 [symbolic = %.loc38_41.21 (constants.%.c1e)] // CHECK:STDOUT: %impl.elem3.loc38_41.2: @TestIterate.%.loc38_41.21 (%.c1e) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc38_41.2 (constants.%impl.elem3.576)] @@ -6034,7 +5985,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc38: @TestIterate.%ptr (%ptr.696) = addr_of %var // CHECK:STDOUT: %impl.elem3.loc38_41.1: @TestIterate.%.loc38_41.21 (%.c1e) = impl_witness_access constants.%Iterate.lookup_impl_witness.a99, element3 [symbolic = %impl.elem3.loc38_41.2 (constants.%impl.elem3.576)] // CHECK:STDOUT: %bound_method.loc38_41.3: = bound_method %r.ref, %impl.elem3.loc38_41.1 // CHECK:STDOUT: %Iterate.facet.loc38_41.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.a99) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] @@ -6046,7 +5996,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_impl_fn.loc38_41.2: = specific_impl_function %impl.elem3.loc38_41.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.c55) [symbolic = %specific_impl_fn.loc38_41.5 (constants.%specific_impl_fn.1db)] // CHECK:STDOUT: %bound_method.loc38_41.4: = bound_method %r.ref, %specific_impl_fn.loc38_41.2 // CHECK:STDOUT: %.loc38_41.7: ref %Optional.70f = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.70f to %.loc38_41.7 = call %bound_method.loc38_41.4(%r.ref, %addr.loc38) +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.70f to %.loc38_41.7 = call %bound_method.loc38_41.4(%r.ref, %var) // CHECK:STDOUT: %.loc38_41.8: ref %Optional.70f = temporary %.loc38_41.7, %Iterate.WithSelf.Next.call // CHECK:STDOUT: %.loc38_41.9: %Optional.HasValue.type.74b = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.HasValue.f75] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.74b = name_ref HasValue, %.loc38_41.9 [concrete = constants.%Optional.HasValue.f75] @@ -6214,7 +6164,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc80: %ptr.b95 = addr_of %var // CHECK:STDOUT: %impl.elem3: %.d7e = impl_witness_access constants.%Iterate.impl_witness.42b, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.214] // CHECK:STDOUT: %bound_method.loc80_42.3: = bound_method %mc.ref, %impl.elem3 // CHECK:STDOUT: %facet_value.loc80_42.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.dc3, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.809, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.cc4] @@ -6225,7 +6174,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %bound_method.loc80_42.4: = bound_method %mc.ref, %specific_fn.loc80_42.2 // CHECK:STDOUT: %.loc80_42.5: ref %Optional.70f = temporary_storage // CHECK:STDOUT: %.loc80_40.2: %MutableAndConstRange = acquire_value %mc.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.70f to %.loc80_42.5 = call %bound_method.loc80_42.4(%.loc80_40.2, %addr.loc80) +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.70f to %.loc80_42.5 = call %bound_method.loc80_42.4(%.loc80_40.2, %var) // CHECK:STDOUT: %.loc80_42.6: ref %Optional.70f = temporary %.loc80_42.5, %T.as_type.as.Iterate.impl.Next.call // CHECK:STDOUT: %.loc80_42.7: %Optional.HasValue.type.74b = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.HasValue.f75] // CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.74b = name_ref HasValue, %.loc80_42.7 [concrete = constants.%Optional.HasValue.f75] @@ -6304,7 +6253,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.c9a // CHECK:STDOUT: %as_type => constants.%tuple.type.de6 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.95d -// CHECK:STDOUT: %ptr => constants.%ptr.b95 // CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.c27 // CHECK:STDOUT: %.loc38_41.21 => constants.%.d7e // CHECK:STDOUT: %impl.elem3.loc38_41.2 => constants.%T.as_type.as.Iterate.impl.Next.214 diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index 5ad01553440a..4ca1b774ca24 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -167,103 +167,103 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define linkonce_odr void @"_CNext.Array.e6a7e802f5bda6f1.Core:Iterate.Core.64c6854216281bef"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !83 { -// CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !91 -// CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !91 -// CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !92 +// CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !90 +// CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !90 +// CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !91 // CHECK:STDOUT: // CHECK:STDOUT: 3: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !95 -// CHECK:STDOUT: %4 = load i32, ptr %cursor, align 4, !dbg !98 -// CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !98 -// CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !96 -// CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !96 -// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %6), !dbg !99 -// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !93 +// CHECK:STDOUT: %4 = load i32, ptr %cursor, align 4, !dbg !95 +// CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !95 +// CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !94 +// CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !94 +// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %6), !dbg !96 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !103 -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !100 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !109 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !115 -// CHECK:STDOUT: ret i1 %1, !dbg !116 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !106 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !112 +// CHECK:STDOUT: ret i1 %1, !dbg !113 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !118 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !124 -// CHECK:STDOUT: ret i32 %1, !dbg !125 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !121 +// CHECK:STDOUT: ret i32 %1, !dbg !122 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !128 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !131 -// CHECK:STDOUT: ret void, !dbg !134 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !125 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !128 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !136 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !141 -// CHECK:STDOUT: ret void, !dbg !142 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !133 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !138 +// CHECK:STDOUT: ret void, !dbg !139 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !144 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !147 -// CHECK:STDOUT: ret void, !dbg !148 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !141 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !149 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !154 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !154 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !154 -// CHECK:STDOUT: ret i1 %2, !dbg !155 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !146 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !151 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !151 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !151 +// CHECK:STDOUT: ret i1 %2, !dbg !152 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !157 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !162 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !162 -// CHECK:STDOUT: ret i32 %1, !dbg !163 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !154 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !159 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !159 +// CHECK:STDOUT: ret i32 %1, !dbg !160 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !165 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !168 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !169 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !169 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !169 -// CHECK:STDOUT: ret void, !dbg !169 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !162 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !165 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !166 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !166 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !166 +// CHECK:STDOUT: ret void, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !173 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !182 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !182 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !184 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !184 -// CHECK:STDOUT: ret void, !dbg !185 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !170 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !179 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !179 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !181 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !181 +// CHECK:STDOUT: ret void, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !187 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !194 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !194 -// CHECK:STDOUT: ret void, !dbg !195 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !184 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !191 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !191 +// CHECK:STDOUT: ret void, !dbg !192 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !196 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !201 -// CHECK:STDOUT: ret i32 %1, !dbg !203 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !193 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !198 +// CHECK:STDOUT: ret i32 %1, !dbg !200 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !205 { -// CHECK:STDOUT: ret i32 %self, !dbg !211 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !202 { +// CHECK:STDOUT: ret i32 %self, !dbg !208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -294,7 +294,7 @@ fn F() { // CHECK:STDOUT: !20 = !DILocation(line: 17, column: 7, scope: !14) // CHECK:STDOUT: !21 = !{!6, !11} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !23 = !{!11, !11, !11} +// CHECK:STDOUT: !23 = !{!11, !11, !6} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) // CHECK:STDOUT: !25 = !{!11, !11} // CHECK:STDOUT: !26 = !DISubroutineType(types: !25) @@ -350,84 +350,84 @@ fn F() { // CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !11) // CHECK:STDOUT: !81 = !DILocation(line: 23, column: 38, scope: !76) // CHECK:STDOUT: !82 = !{!77} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.Array.e6a7e802f5bda6f1.Core:Iterate.Core.64c6854216281bef", scope: null, file: !75, line: 24, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !107) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.Array.e6a7e802f5bda6f1.Core:Iterate.Core.64c6854216281bef", scope: null, file: !75, line: 24, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !104) // CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !11) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 2, scope: !83, type: !11) -// CHECK:STDOUT: !91 = !DILocation(line: 25, column: 9, scope: !83) -// CHECK:STDOUT: !92 = !DILocation(line: 25, column: 8, scope: !83) -// CHECK:STDOUT: !95 = !DILocation(line: 26, column: 7, scope: !83) -// CHECK:STDOUT: !96 = !DILocation(line: 27, column: 31, scope: !83) -// CHECK:STDOUT: !98 = !DILocation(line: 27, column: 36, scope: !83) -// CHECK:STDOUT: !99 = !DILocation(line: 27, column: 14, scope: !83) -// CHECK:STDOUT: !100 = !{!11, !6} -// CHECK:STDOUT: !101 = !DISubroutineType(types: !100) -// CHECK:STDOUT: !102 = !DILocation(line: 27, column: 7, scope: !83) -// CHECK:STDOUT: !103 = !DILocation(line: 29, column: 14, scope: !83) -// CHECK:STDOUT: !104 = !{!11} -// CHECK:STDOUT: !105 = !DISubroutineType(types: !104) -// CHECK:STDOUT: !106 = !DILocation(line: 29, column: 7, scope: !83) -// CHECK:STDOUT: !107 = !{!84, !85} -// CHECK:STDOUT: !108 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !108, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !117) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !11) -// CHECK:STDOUT: !115 = !DILocation(line: 37, column: 12, scope: !109) -// CHECK:STDOUT: !116 = !DILocation(line: 37, column: 5, scope: !109) -// CHECK:STDOUT: !117 = !{!110} -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !108, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !126) -// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !11) -// CHECK:STDOUT: !124 = !DILocation(line: 40, column: 12, scope: !118) -// CHECK:STDOUT: !125 = !DILocation(line: 40, column: 5, scope: !118) -// CHECK:STDOUT: !126 = !{!119} -// CHECK:STDOUT: !127 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !127, line: 396, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !135) -// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !6) -// CHECK:STDOUT: !131 = !DILocation(line: 398, column: 5, scope: !128) -// CHECK:STDOUT: !132 = !{null, !6, !6} -// CHECK:STDOUT: !133 = !DISubroutineType(types: !132) -// CHECK:STDOUT: !134 = !DILocation(line: 396, column: 3, scope: !128) -// CHECK:STDOUT: !135 = !{!129} -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !108, line: 33, type: !101, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !6) -// CHECK:STDOUT: !141 = !DILocation(line: 34, column: 12, scope: !136) -// CHECK:STDOUT: !142 = !DILocation(line: 34, column: 5, scope: !136) -// CHECK:STDOUT: !143 = !{!137} -// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !108, line: 30, type: !105, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !147 = !DILocation(line: 31, column: 12, scope: !144) -// CHECK:STDOUT: !148 = !DILocation(line: 31, column: 5, scope: !144) -// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !108, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !156) -// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !11) -// CHECK:STDOUT: !154 = !DILocation(line: 142, column: 12, scope: !149) -// CHECK:STDOUT: !155 = !DILocation(line: 142, column: 5, scope: !149) -// CHECK:STDOUT: !156 = !{!150} -// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !108, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !164) -// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !11) -// CHECK:STDOUT: !162 = !DILocation(line: 145, column: 12, scope: !157) -// CHECK:STDOUT: !163 = !DILocation(line: 145, column: 5, scope: !157) -// CHECK:STDOUT: !164 = !{!158} -// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !127, line: 331, type: !133, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !172) -// CHECK:STDOUT: !166 = !DILocalVariable(arg: 1, scope: !165, type: !6) -// CHECK:STDOUT: !167 = !DILocalVariable(arg: 2, scope: !165, type: !6) -// CHECK:STDOUT: !168 = !DILocation(line: 0, scope: !165) -// CHECK:STDOUT: !169 = !DILocation(line: 331, column: 3, scope: !165) -// CHECK:STDOUT: !170 = !{!6, !6} -// CHECK:STDOUT: !171 = !DISubroutineType(types: !170) -// CHECK:STDOUT: !172 = !{!166, !167} -// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !108, line: 131, type: !101, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !186) -// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !6) -// CHECK:STDOUT: !182 = !DILocation(line: 137, column: 5, scope: !173) -// CHECK:STDOUT: !184 = !DILocation(line: 138, column: 5, scope: !173) -// CHECK:STDOUT: !185 = !DILocation(line: 139, column: 5, scope: !173) -// CHECK:STDOUT: !186 = !{!174} -// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !108, line: 125, type: !105, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !194 = !DILocation(line: 128, column: 5, scope: !187) -// CHECK:STDOUT: !195 = !DILocation(line: 129, column: 5, scope: !187) -// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !127, line: 64, type: !171, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !204) -// CHECK:STDOUT: !197 = !DILocalVariable(arg: 1, scope: !196, type: !6) -// CHECK:STDOUT: !201 = !DILocation(line: 66, column: 17, scope: !196) -// CHECK:STDOUT: !203 = !DILocation(line: 66, column: 5, scope: !196) -// CHECK:STDOUT: !204 = !{!197} -// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !127, line: 59, type: !171, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !212) -// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !205, type: !6) -// CHECK:STDOUT: !211 = !DILocation(line: 59, column: 28, scope: !205) -// CHECK:STDOUT: !212 = !{!206} +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 2, scope: !83, type: !6) +// CHECK:STDOUT: !90 = !DILocation(line: 25, column: 9, scope: !83) +// CHECK:STDOUT: !91 = !DILocation(line: 25, column: 8, scope: !83) +// CHECK:STDOUT: !93 = !DILocation(line: 26, column: 7, scope: !83) +// CHECK:STDOUT: !94 = !DILocation(line: 27, column: 31, scope: !83) +// CHECK:STDOUT: !95 = !DILocation(line: 27, column: 36, scope: !83) +// CHECK:STDOUT: !96 = !DILocation(line: 27, column: 14, scope: !83) +// CHECK:STDOUT: !97 = !{!11, !6} +// CHECK:STDOUT: !98 = !DISubroutineType(types: !97) +// CHECK:STDOUT: !99 = !DILocation(line: 27, column: 7, scope: !83) +// CHECK:STDOUT: !100 = !DILocation(line: 29, column: 14, scope: !83) +// CHECK:STDOUT: !101 = !{!11} +// CHECK:STDOUT: !102 = !DISubroutineType(types: !101) +// CHECK:STDOUT: !103 = !DILocation(line: 29, column: 7, scope: !83) +// CHECK:STDOUT: !104 = !{!84, !85} +// CHECK:STDOUT: !105 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !105, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !114) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !11) +// CHECK:STDOUT: !112 = !DILocation(line: 37, column: 12, scope: !106) +// CHECK:STDOUT: !113 = !DILocation(line: 37, column: 5, scope: !106) +// CHECK:STDOUT: !114 = !{!107} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !105, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !123) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !11) +// CHECK:STDOUT: !121 = !DILocation(line: 40, column: 12, scope: !115) +// CHECK:STDOUT: !122 = !DILocation(line: 40, column: 5, scope: !115) +// CHECK:STDOUT: !123 = !{!116} +// CHECK:STDOUT: !124 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !124, line: 396, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !132) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !6) +// CHECK:STDOUT: !128 = !DILocation(line: 398, column: 5, scope: !125) +// CHECK:STDOUT: !129 = !{null, !6, !6} +// CHECK:STDOUT: !130 = !DISubroutineType(types: !129) +// CHECK:STDOUT: !131 = !DILocation(line: 396, column: 3, scope: !125) +// CHECK:STDOUT: !132 = !{!126} +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !105, line: 33, type: !98, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !140) +// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !133, type: !6) +// CHECK:STDOUT: !138 = !DILocation(line: 34, column: 12, scope: !133) +// CHECK:STDOUT: !139 = !DILocation(line: 34, column: 5, scope: !133) +// CHECK:STDOUT: !140 = !{!134} +// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !105, line: 30, type: !102, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !144 = !DILocation(line: 31, column: 12, scope: !141) +// CHECK:STDOUT: !145 = !DILocation(line: 31, column: 5, scope: !141) +// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !105, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !153) +// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !11) +// CHECK:STDOUT: !151 = !DILocation(line: 142, column: 12, scope: !146) +// CHECK:STDOUT: !152 = !DILocation(line: 142, column: 5, scope: !146) +// CHECK:STDOUT: !153 = !{!147} +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !105, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !161) +// CHECK:STDOUT: !155 = !DILocalVariable(arg: 1, scope: !154, type: !11) +// CHECK:STDOUT: !159 = !DILocation(line: 145, column: 12, scope: !154) +// CHECK:STDOUT: !160 = !DILocation(line: 145, column: 5, scope: !154) +// CHECK:STDOUT: !161 = !{!155} +// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !124, line: 331, type: !130, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !169) +// CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !162, type: !6) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 2, scope: !162, type: !6) +// CHECK:STDOUT: !165 = !DILocation(line: 0, scope: !162) +// CHECK:STDOUT: !166 = !DILocation(line: 331, column: 3, scope: !162) +// CHECK:STDOUT: !167 = !{!6, !6} +// CHECK:STDOUT: !168 = !DISubroutineType(types: !167) +// CHECK:STDOUT: !169 = !{!163, !164} +// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !105, line: 131, type: !98, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !183) +// CHECK:STDOUT: !171 = !DILocalVariable(arg: 1, scope: !170, type: !6) +// CHECK:STDOUT: !179 = !DILocation(line: 137, column: 5, scope: !170) +// CHECK:STDOUT: !181 = !DILocation(line: 138, column: 5, scope: !170) +// CHECK:STDOUT: !182 = !DILocation(line: 139, column: 5, scope: !170) +// CHECK:STDOUT: !183 = !{!171} +// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !105, line: 125, type: !102, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !191 = !DILocation(line: 128, column: 5, scope: !184) +// CHECK:STDOUT: !192 = !DILocation(line: 129, column: 5, scope: !184) +// CHECK:STDOUT: !193 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !124, line: 64, type: !168, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !201) +// CHECK:STDOUT: !194 = !DILocalVariable(arg: 1, scope: !193, type: !6) +// CHECK:STDOUT: !198 = !DILocation(line: 66, column: 17, scope: !193) +// CHECK:STDOUT: !200 = !DILocation(line: 66, column: 5, scope: !193) +// CHECK:STDOUT: !201 = !{!194} +// CHECK:STDOUT: !202 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !124, line: 59, type: !168, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !209) +// CHECK:STDOUT: !203 = !DILocalVariable(arg: 1, scope: !202, type: !6) +// CHECK:STDOUT: !208 = !DILocation(line: 59, column: 28, scope: !202) +// CHECK:STDOUT: !209 = !{!203} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index 28d66c55e549..5667c95aa2a0 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -15,7 +15,7 @@ class EmptyRange(T: Core.Copy & Core.Destroy) { fn NewCursor(unused self) -> {} { return {}; } - fn Next(unused self, _: {}*) -> Core.Optional(T) { + fn Next(unused self, ref _: {}) -> Core.Optional(T) { return Core.Optional(T).None(); } } diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index 5a2647317001..46c6e537b3d3 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -196,108 +196,108 @@ fn For() { // CHECK:STDOUT: define linkonce_odr void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !100 { // CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !107 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !107 -// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !109 +// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !108 // CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !107 -// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !112 -// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !112 -// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !111 -// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !111 -// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !113 +// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !111 +// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !111 +// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !110 +// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !110 +// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !112 // CHECK:STDOUT: // CHECK:STDOUT: 6: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !116 -// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !117 -// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %7), !dbg !118 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !114 +// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !115 +// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %7), !dbg !116 // CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !107 -// CHECK:STDOUT: ret void, !dbg !119 +// CHECK:STDOUT: ret void, !dbg !117 // CHECK:STDOUT: // CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !120 +// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !118 // CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !107 -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: ret void, !dbg !119 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !124 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !130 -// CHECK:STDOUT: ret i1 %1, !dbg !131 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !122 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !128 +// CHECK:STDOUT: ret i1 %1, !dbg !129 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !133 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !139 -// CHECK:STDOUT: ret i32 %1, !dbg !140 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !131 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !137 +// CHECK:STDOUT: ret i32 %1, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CInclusiveRange.Core(ptr sret({ i32, i32 }), i32, i32) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !143 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !146 -// CHECK:STDOUT: ret void, !dbg !149 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !141 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !147 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !151 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !156 -// CHECK:STDOUT: ret void, !dbg !157 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !149 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !154 +// CHECK:STDOUT: ret void, !dbg !155 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !159 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !162 -// CHECK:STDOUT: ret void, !dbg !163 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !157 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !160 +// CHECK:STDOUT: ret void, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !164 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !169 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !169 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !169 -// CHECK:STDOUT: ret i1 %2, !dbg !170 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !162 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !167 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !167 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !167 +// CHECK:STDOUT: ret i1 %2, !dbg !168 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !172 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !177 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !177 -// CHECK:STDOUT: ret i32 %1, !dbg !178 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !170 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !175 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !175 +// CHECK:STDOUT: ret i32 %1, !dbg !176 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !180 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !183 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !184 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !184 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !184 -// CHECK:STDOUT: ret void, !dbg !184 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !178 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !181 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !182 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !182 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !182 +// CHECK:STDOUT: ret void, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !188 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !197 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !197 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !199 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !199 -// CHECK:STDOUT: ret void, !dbg !200 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !186 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !195 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !195 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !197 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !197 +// CHECK:STDOUT: ret void, !dbg !198 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !202 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !209 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !209 -// CHECK:STDOUT: ret void, !dbg !210 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !200 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !207 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !207 +// CHECK:STDOUT: ret void, !dbg !208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !211 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !216 -// CHECK:STDOUT: ret i32 %1, !dbg !218 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !209 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !214 +// CHECK:STDOUT: ret i32 %1, !dbg !216 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !220 { -// CHECK:STDOUT: ret i32 %self, !dbg !226 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !218 { +// CHECK:STDOUT: ret i32 %self, !dbg !224 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -332,7 +332,7 @@ fn For() { // CHECK:STDOUT: !21 = !DILocation(line: 18, column: 7, scope: !18) // CHECK:STDOUT: !22 = !{!6, !7} // CHECK:STDOUT: !23 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !24 = !{!7, !7, !7} +// CHECK:STDOUT: !24 = !{!7, !7, !6} // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{!7, !7} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) @@ -403,82 +403,82 @@ fn For() { // CHECK:STDOUT: !97 = !DILocation(line: 19, column: 43, scope: !92) // CHECK:STDOUT: !98 = !DILocation(line: 19, column: 36, scope: !92) // CHECK:STDOUT: !99 = !{!93} -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !91, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !122) +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !91, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !120) // CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !7) -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 2, scope: !100, type: !7) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 2, scope: !100, type: !6) // CHECK:STDOUT: !107 = !DILocation(line: 21, column: 7, scope: !100) -// CHECK:STDOUT: !109 = !DILocation(line: 21, column: 27, scope: !100) -// CHECK:STDOUT: !111 = !DILocation(line: 22, column: 11, scope: !100) -// CHECK:STDOUT: !112 = !DILocation(line: 22, column: 19, scope: !100) -// CHECK:STDOUT: !113 = !DILocation(line: 22, column: 10, scope: !100) -// CHECK:STDOUT: !116 = !DILocation(line: 23, column: 9, scope: !100) -// CHECK:STDOUT: !117 = !DILocation(line: 24, column: 38, scope: !100) -// CHECK:STDOUT: !118 = !DILocation(line: 24, column: 16, scope: !100) -// CHECK:STDOUT: !119 = !DILocation(line: 24, column: 9, scope: !100) -// CHECK:STDOUT: !120 = !DILocation(line: 26, column: 16, scope: !100) -// CHECK:STDOUT: !121 = !DILocation(line: 26, column: 9, scope: !100) -// CHECK:STDOUT: !122 = !{!101, !102} -// CHECK:STDOUT: !123 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !123, line: 36, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !132) -// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !7) -// CHECK:STDOUT: !130 = !DILocation(line: 37, column: 12, scope: !124) -// CHECK:STDOUT: !131 = !DILocation(line: 37, column: 5, scope: !124) -// CHECK:STDOUT: !132 = !{!125} -// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !123, line: 39, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !141) -// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !133, type: !7) -// CHECK:STDOUT: !139 = !DILocation(line: 40, column: 12, scope: !133) -// CHECK:STDOUT: !140 = !DILocation(line: 40, column: 5, scope: !133) -// CHECK:STDOUT: !141 = !{!134} -// CHECK:STDOUT: !142 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !142, line: 396, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !150) -// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !6) -// CHECK:STDOUT: !146 = !DILocation(line: 398, column: 5, scope: !143) -// CHECK:STDOUT: !147 = !{null, !6, !6} -// CHECK:STDOUT: !148 = !DISubroutineType(types: !147) -// CHECK:STDOUT: !149 = !DILocation(line: 396, column: 3, scope: !143) -// CHECK:STDOUT: !150 = !{!144} -// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !123, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !158) -// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !6) -// CHECK:STDOUT: !156 = !DILocation(line: 34, column: 12, scope: !151) -// CHECK:STDOUT: !157 = !DILocation(line: 34, column: 5, scope: !151) -// CHECK:STDOUT: !158 = !{!152} -// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !123, line: 30, type: !9, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !162 = !DILocation(line: 31, column: 12, scope: !159) -// CHECK:STDOUT: !163 = !DILocation(line: 31, column: 5, scope: !159) -// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !123, line: 141, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !171) -// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !7) -// CHECK:STDOUT: !169 = !DILocation(line: 142, column: 12, scope: !164) -// CHECK:STDOUT: !170 = !DILocation(line: 142, column: 5, scope: !164) -// CHECK:STDOUT: !171 = !{!165} -// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !123, line: 144, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !179) -// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !7) -// CHECK:STDOUT: !177 = !DILocation(line: 145, column: 12, scope: !172) -// CHECK:STDOUT: !178 = !DILocation(line: 145, column: 5, scope: !172) -// CHECK:STDOUT: !179 = !{!173} -// CHECK:STDOUT: !180 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !142, line: 331, type: !148, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !187) -// CHECK:STDOUT: !181 = !DILocalVariable(arg: 1, scope: !180, type: !6) -// CHECK:STDOUT: !182 = !DILocalVariable(arg: 2, scope: !180, type: !6) -// CHECK:STDOUT: !183 = !DILocation(line: 0, scope: !180) -// CHECK:STDOUT: !184 = !DILocation(line: 331, column: 3, scope: !180) -// CHECK:STDOUT: !185 = !{!6, !6} -// CHECK:STDOUT: !186 = !DISubroutineType(types: !185) -// CHECK:STDOUT: !187 = !{!181, !182} -// CHECK:STDOUT: !188 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !123, line: 131, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !201) -// CHECK:STDOUT: !189 = !DILocalVariable(arg: 1, scope: !188, type: !6) -// CHECK:STDOUT: !197 = !DILocation(line: 137, column: 5, scope: !188) -// CHECK:STDOUT: !199 = !DILocation(line: 138, column: 5, scope: !188) -// CHECK:STDOUT: !200 = !DILocation(line: 139, column: 5, scope: !188) -// CHECK:STDOUT: !201 = !{!189} -// CHECK:STDOUT: !202 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !123, line: 125, type: !9, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !209 = !DILocation(line: 128, column: 5, scope: !202) -// CHECK:STDOUT: !210 = !DILocation(line: 129, column: 5, scope: !202) -// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !142, line: 64, type: !186, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !219) -// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !6) -// CHECK:STDOUT: !216 = !DILocation(line: 66, column: 17, scope: !211) -// CHECK:STDOUT: !218 = !DILocation(line: 66, column: 5, scope: !211) -// CHECK:STDOUT: !219 = !{!212} -// CHECK:STDOUT: !220 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !142, line: 59, type: !186, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !227) -// CHECK:STDOUT: !221 = !DILocalVariable(arg: 1, scope: !220, type: !6) -// CHECK:STDOUT: !226 = !DILocation(line: 59, column: 28, scope: !220) -// CHECK:STDOUT: !227 = !{!221} +// CHECK:STDOUT: !108 = !DILocation(line: 21, column: 27, scope: !100) +// CHECK:STDOUT: !110 = !DILocation(line: 22, column: 11, scope: !100) +// CHECK:STDOUT: !111 = !DILocation(line: 22, column: 19, scope: !100) +// CHECK:STDOUT: !112 = !DILocation(line: 22, column: 10, scope: !100) +// CHECK:STDOUT: !114 = !DILocation(line: 23, column: 9, scope: !100) +// CHECK:STDOUT: !115 = !DILocation(line: 24, column: 38, scope: !100) +// CHECK:STDOUT: !116 = !DILocation(line: 24, column: 16, scope: !100) +// CHECK:STDOUT: !117 = !DILocation(line: 24, column: 9, scope: !100) +// CHECK:STDOUT: !118 = !DILocation(line: 26, column: 16, scope: !100) +// CHECK:STDOUT: !119 = !DILocation(line: 26, column: 9, scope: !100) +// CHECK:STDOUT: !120 = !{!101, !102} +// CHECK:STDOUT: !121 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !121, line: 36, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !130) +// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !7) +// CHECK:STDOUT: !128 = !DILocation(line: 37, column: 12, scope: !122) +// CHECK:STDOUT: !129 = !DILocation(line: 37, column: 5, scope: !122) +// CHECK:STDOUT: !130 = !{!123} +// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !121, line: 39, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !139) +// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !7) +// CHECK:STDOUT: !137 = !DILocation(line: 40, column: 12, scope: !131) +// CHECK:STDOUT: !138 = !DILocation(line: 40, column: 5, scope: !131) +// CHECK:STDOUT: !139 = !{!132} +// CHECK:STDOUT: !140 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !140, line: 396, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !148) +// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !6) +// CHECK:STDOUT: !144 = !DILocation(line: 398, column: 5, scope: !141) +// CHECK:STDOUT: !145 = !{null, !6, !6} +// CHECK:STDOUT: !146 = !DISubroutineType(types: !145) +// CHECK:STDOUT: !147 = !DILocation(line: 396, column: 3, scope: !141) +// CHECK:STDOUT: !148 = !{!142} +// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !121, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !156) +// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !6) +// CHECK:STDOUT: !154 = !DILocation(line: 34, column: 12, scope: !149) +// CHECK:STDOUT: !155 = !DILocation(line: 34, column: 5, scope: !149) +// CHECK:STDOUT: !156 = !{!150} +// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !121, line: 30, type: !9, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !160 = !DILocation(line: 31, column: 12, scope: !157) +// CHECK:STDOUT: !161 = !DILocation(line: 31, column: 5, scope: !157) +// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !121, line: 141, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !169) +// CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !162, type: !7) +// CHECK:STDOUT: !167 = !DILocation(line: 142, column: 12, scope: !162) +// CHECK:STDOUT: !168 = !DILocation(line: 142, column: 5, scope: !162) +// CHECK:STDOUT: !169 = !{!163} +// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !121, line: 144, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !177) +// CHECK:STDOUT: !171 = !DILocalVariable(arg: 1, scope: !170, type: !7) +// CHECK:STDOUT: !175 = !DILocation(line: 145, column: 12, scope: !170) +// CHECK:STDOUT: !176 = !DILocation(line: 145, column: 5, scope: !170) +// CHECK:STDOUT: !177 = !{!171} +// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !140, line: 331, type: !146, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185) +// CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !6) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 2, scope: !178, type: !6) +// CHECK:STDOUT: !181 = !DILocation(line: 0, scope: !178) +// CHECK:STDOUT: !182 = !DILocation(line: 331, column: 3, scope: !178) +// CHECK:STDOUT: !183 = !{!6, !6} +// CHECK:STDOUT: !184 = !DISubroutineType(types: !183) +// CHECK:STDOUT: !185 = !{!179, !180} +// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !121, line: 131, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !199) +// CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !6) +// CHECK:STDOUT: !195 = !DILocation(line: 137, column: 5, scope: !186) +// CHECK:STDOUT: !197 = !DILocation(line: 138, column: 5, scope: !186) +// CHECK:STDOUT: !198 = !DILocation(line: 139, column: 5, scope: !186) +// CHECK:STDOUT: !199 = !{!187} +// CHECK:STDOUT: !200 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !121, line: 125, type: !9, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !207 = !DILocation(line: 128, column: 5, scope: !200) +// CHECK:STDOUT: !208 = !DILocation(line: 129, column: 5, scope: !200) +// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !140, line: 64, type: !184, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !217) +// CHECK:STDOUT: !210 = !DILocalVariable(arg: 1, scope: !209, type: !6) +// CHECK:STDOUT: !214 = !DILocation(line: 66, column: 17, scope: !209) +// CHECK:STDOUT: !216 = !DILocation(line: 66, column: 5, scope: !209) +// CHECK:STDOUT: !217 = !{!210} +// CHECK:STDOUT: !218 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !140, line: 59, type: !184, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !225) +// CHECK:STDOUT: !219 = !DILocalVariable(arg: 1, scope: !218, type: !6) +// CHECK:STDOUT: !224 = !DILocation(line: 59, column: 28, scope: !218) +// CHECK:STDOUT: !225 = !{!219} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index 64864c4effc9..9e6049c4fb50 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -183,108 +183,108 @@ fn For() { // CHECK:STDOUT: define linkonce_odr void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !94 { // CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !101 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !101 -// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !103 +// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !102 // CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !101 -// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !106 -// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !106 -// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !105 -// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !105 -// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !107 +// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !105 +// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !105 +// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !104 +// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !104 +// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !106 // CHECK:STDOUT: // CHECK:STDOUT: 6: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !110 -// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !111 -// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %7), !dbg !112 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !108 +// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !109 +// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %7), !dbg !110 // CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: ret void, !dbg !111 // CHECK:STDOUT: // CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !114 +// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !112 // CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !120 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !126 -// CHECK:STDOUT: ret i1 %1, !dbg !127 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !118 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !124 +// CHECK:STDOUT: ret i1 %1, !dbg !125 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !129 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !135 -// CHECK:STDOUT: ret i32 %1, !dbg !136 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !127 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !133 +// CHECK:STDOUT: ret i32 %1, !dbg !134 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CInclusiveRange.Core(ptr sret({ i32, i32 }), i32, i32) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !139 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !145 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !137 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !140 +// CHECK:STDOUT: ret void, !dbg !143 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !147 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !152 -// CHECK:STDOUT: ret void, !dbg !153 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !145 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !150 +// CHECK:STDOUT: ret void, !dbg !151 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !155 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !158 -// CHECK:STDOUT: ret void, !dbg !159 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !153 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !156 +// CHECK:STDOUT: ret void, !dbg !157 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !160 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !165 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !165 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !165 -// CHECK:STDOUT: ret i1 %2, !dbg !166 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !158 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !163 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !163 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !163 +// CHECK:STDOUT: ret i1 %2, !dbg !164 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !168 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !173 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !173 -// CHECK:STDOUT: ret i32 %1, !dbg !174 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !166 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !171 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !171 +// CHECK:STDOUT: ret i32 %1, !dbg !172 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !176 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !179 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !180 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !180 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !180 -// CHECK:STDOUT: ret void, !dbg !180 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !174 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !177 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !178 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !178 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !178 +// CHECK:STDOUT: ret void, !dbg !178 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !184 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !193 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !193 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !195 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !195 -// CHECK:STDOUT: ret void, !dbg !196 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !182 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !191 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !191 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !193 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !193 +// CHECK:STDOUT: ret void, !dbg !194 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !198 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !205 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !205 -// CHECK:STDOUT: ret void, !dbg !206 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !196 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !203 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !203 +// CHECK:STDOUT: ret void, !dbg !204 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !207 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !212 -// CHECK:STDOUT: ret i32 %1, !dbg !214 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !205 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !210 +// CHECK:STDOUT: ret i32 %1, !dbg !212 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !216 { -// CHECK:STDOUT: ret i32 %self, !dbg !222 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !214 { +// CHECK:STDOUT: ret i32 %self, !dbg !220 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -318,7 +318,7 @@ fn For() { // CHECK:STDOUT: !20 = !DILocation(line: 19, column: 7, scope: !16) // CHECK:STDOUT: !21 = !{!6, !9} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !23 = !{!9, !9, !9} +// CHECK:STDOUT: !23 = !{!9, !9, !6} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) // CHECK:STDOUT: !25 = !{!9, !9} // CHECK:STDOUT: !26 = !DISubroutineType(types: !25) @@ -384,84 +384,84 @@ fn For() { // CHECK:STDOUT: !91 = !DILocation(line: 19, column: 43, scope: !86) // CHECK:STDOUT: !92 = !DILocation(line: 19, column: 36, scope: !86) // CHECK:STDOUT: !93 = !{!87} -// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !85, line: 20, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !118) +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !85, line: 20, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !116) // CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !9) -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 2, scope: !94, type: !9) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 2, scope: !94, type: !6) // CHECK:STDOUT: !101 = !DILocation(line: 21, column: 7, scope: !94) -// CHECK:STDOUT: !103 = !DILocation(line: 21, column: 27, scope: !94) -// CHECK:STDOUT: !105 = !DILocation(line: 22, column: 11, scope: !94) -// CHECK:STDOUT: !106 = !DILocation(line: 22, column: 19, scope: !94) -// CHECK:STDOUT: !107 = !DILocation(line: 22, column: 10, scope: !94) -// CHECK:STDOUT: !110 = !DILocation(line: 23, column: 9, scope: !94) -// CHECK:STDOUT: !111 = !DILocation(line: 24, column: 38, scope: !94) -// CHECK:STDOUT: !112 = !DILocation(line: 24, column: 16, scope: !94) -// CHECK:STDOUT: !113 = !DILocation(line: 24, column: 9, scope: !94) -// CHECK:STDOUT: !114 = !DILocation(line: 26, column: 16, scope: !94) -// CHECK:STDOUT: !115 = !{!9} -// CHECK:STDOUT: !116 = !DISubroutineType(types: !115) -// CHECK:STDOUT: !117 = !DILocation(line: 26, column: 9, scope: !94) -// CHECK:STDOUT: !118 = !{!95, !96} -// CHECK:STDOUT: !119 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !119, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !128) -// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !9) -// CHECK:STDOUT: !126 = !DILocation(line: 37, column: 12, scope: !120) -// CHECK:STDOUT: !127 = !DILocation(line: 37, column: 5, scope: !120) -// CHECK:STDOUT: !128 = !{!121} -// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !119, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !137) -// CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !129, type: !9) -// CHECK:STDOUT: !135 = !DILocation(line: 40, column: 12, scope: !129) -// CHECK:STDOUT: !136 = !DILocation(line: 40, column: 5, scope: !129) -// CHECK:STDOUT: !137 = !{!130} -// CHECK:STDOUT: !138 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !138, line: 396, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !146) -// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !6) -// CHECK:STDOUT: !142 = !DILocation(line: 398, column: 5, scope: !139) -// CHECK:STDOUT: !143 = !{null, !6, !6} -// CHECK:STDOUT: !144 = !DISubroutineType(types: !143) -// CHECK:STDOUT: !145 = !DILocation(line: 396, column: 3, scope: !139) -// CHECK:STDOUT: !146 = !{!140} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !119, line: 33, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !154) -// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !6) -// CHECK:STDOUT: !152 = !DILocation(line: 34, column: 12, scope: !147) -// CHECK:STDOUT: !153 = !DILocation(line: 34, column: 5, scope: !147) -// CHECK:STDOUT: !154 = !{!148} -// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !119, line: 30, type: !116, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !158 = !DILocation(line: 31, column: 12, scope: !155) -// CHECK:STDOUT: !159 = !DILocation(line: 31, column: 5, scope: !155) -// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !119, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !167) -// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !9) -// CHECK:STDOUT: !165 = !DILocation(line: 142, column: 12, scope: !160) -// CHECK:STDOUT: !166 = !DILocation(line: 142, column: 5, scope: !160) -// CHECK:STDOUT: !167 = !{!161} -// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !119, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !175) -// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !9) -// CHECK:STDOUT: !173 = !DILocation(line: 145, column: 12, scope: !168) -// CHECK:STDOUT: !174 = !DILocation(line: 145, column: 5, scope: !168) -// CHECK:STDOUT: !175 = !{!169} -// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !138, line: 331, type: !144, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !183) -// CHECK:STDOUT: !177 = !DILocalVariable(arg: 1, scope: !176, type: !6) -// CHECK:STDOUT: !178 = !DILocalVariable(arg: 2, scope: !176, type: !6) -// CHECK:STDOUT: !179 = !DILocation(line: 0, scope: !176) -// CHECK:STDOUT: !180 = !DILocation(line: 331, column: 3, scope: !176) -// CHECK:STDOUT: !181 = !{!6, !6} -// CHECK:STDOUT: !182 = !DISubroutineType(types: !181) -// CHECK:STDOUT: !183 = !{!177, !178} -// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !119, line: 131, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !197) -// CHECK:STDOUT: !185 = !DILocalVariable(arg: 1, scope: !184, type: !6) -// CHECK:STDOUT: !193 = !DILocation(line: 137, column: 5, scope: !184) -// CHECK:STDOUT: !195 = !DILocation(line: 138, column: 5, scope: !184) -// CHECK:STDOUT: !196 = !DILocation(line: 139, column: 5, scope: !184) -// CHECK:STDOUT: !197 = !{!185} -// CHECK:STDOUT: !198 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !119, line: 125, type: !116, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !205 = !DILocation(line: 128, column: 5, scope: !198) -// CHECK:STDOUT: !206 = !DILocation(line: 129, column: 5, scope: !198) -// CHECK:STDOUT: !207 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !138, line: 64, type: !182, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !215) -// CHECK:STDOUT: !208 = !DILocalVariable(arg: 1, scope: !207, type: !6) -// CHECK:STDOUT: !212 = !DILocation(line: 66, column: 17, scope: !207) -// CHECK:STDOUT: !214 = !DILocation(line: 66, column: 5, scope: !207) -// CHECK:STDOUT: !215 = !{!208} -// CHECK:STDOUT: !216 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !138, line: 59, type: !182, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !223) -// CHECK:STDOUT: !217 = !DILocalVariable(arg: 1, scope: !216, type: !6) -// CHECK:STDOUT: !222 = !DILocation(line: 59, column: 28, scope: !216) -// CHECK:STDOUT: !223 = !{!217} +// CHECK:STDOUT: !102 = !DILocation(line: 21, column: 27, scope: !94) +// CHECK:STDOUT: !104 = !DILocation(line: 22, column: 11, scope: !94) +// CHECK:STDOUT: !105 = !DILocation(line: 22, column: 19, scope: !94) +// CHECK:STDOUT: !106 = !DILocation(line: 22, column: 10, scope: !94) +// CHECK:STDOUT: !108 = !DILocation(line: 23, column: 9, scope: !94) +// CHECK:STDOUT: !109 = !DILocation(line: 24, column: 38, scope: !94) +// CHECK:STDOUT: !110 = !DILocation(line: 24, column: 16, scope: !94) +// CHECK:STDOUT: !111 = !DILocation(line: 24, column: 9, scope: !94) +// CHECK:STDOUT: !112 = !DILocation(line: 26, column: 16, scope: !94) +// CHECK:STDOUT: !113 = !{!9} +// CHECK:STDOUT: !114 = !DISubroutineType(types: !113) +// CHECK:STDOUT: !115 = !DILocation(line: 26, column: 9, scope: !94) +// CHECK:STDOUT: !116 = !{!95, !96} +// CHECK:STDOUT: !117 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !117, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !126) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !9) +// CHECK:STDOUT: !124 = !DILocation(line: 37, column: 12, scope: !118) +// CHECK:STDOUT: !125 = !DILocation(line: 37, column: 5, scope: !118) +// CHECK:STDOUT: !126 = !{!119} +// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !117, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !135) +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !9) +// CHECK:STDOUT: !133 = !DILocation(line: 40, column: 12, scope: !127) +// CHECK:STDOUT: !134 = !DILocation(line: 40, column: 5, scope: !127) +// CHECK:STDOUT: !135 = !{!128} +// CHECK:STDOUT: !136 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !136, line: 396, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !144) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !6) +// CHECK:STDOUT: !140 = !DILocation(line: 398, column: 5, scope: !137) +// CHECK:STDOUT: !141 = !{null, !6, !6} +// CHECK:STDOUT: !142 = !DISubroutineType(types: !141) +// CHECK:STDOUT: !143 = !DILocation(line: 396, column: 3, scope: !137) +// CHECK:STDOUT: !144 = !{!138} +// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !117, line: 33, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !152) +// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !6) +// CHECK:STDOUT: !150 = !DILocation(line: 34, column: 12, scope: !145) +// CHECK:STDOUT: !151 = !DILocation(line: 34, column: 5, scope: !145) +// CHECK:STDOUT: !152 = !{!146} +// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !117, line: 30, type: !114, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !156 = !DILocation(line: 31, column: 12, scope: !153) +// CHECK:STDOUT: !157 = !DILocation(line: 31, column: 5, scope: !153) +// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !117, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !165) +// CHECK:STDOUT: !159 = !DILocalVariable(arg: 1, scope: !158, type: !9) +// CHECK:STDOUT: !163 = !DILocation(line: 142, column: 12, scope: !158) +// CHECK:STDOUT: !164 = !DILocation(line: 142, column: 5, scope: !158) +// CHECK:STDOUT: !165 = !{!159} +// CHECK:STDOUT: !166 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !117, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !173) +// CHECK:STDOUT: !167 = !DILocalVariable(arg: 1, scope: !166, type: !9) +// CHECK:STDOUT: !171 = !DILocation(line: 145, column: 12, scope: !166) +// CHECK:STDOUT: !172 = !DILocation(line: 145, column: 5, scope: !166) +// CHECK:STDOUT: !173 = !{!167} +// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !136, line: 331, type: !142, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !181) +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !6) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 2, scope: !174, type: !6) +// CHECK:STDOUT: !177 = !DILocation(line: 0, scope: !174) +// CHECK:STDOUT: !178 = !DILocation(line: 331, column: 3, scope: !174) +// CHECK:STDOUT: !179 = !{!6, !6} +// CHECK:STDOUT: !180 = !DISubroutineType(types: !179) +// CHECK:STDOUT: !181 = !{!175, !176} +// CHECK:STDOUT: !182 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !117, line: 131, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !195) +// CHECK:STDOUT: !183 = !DILocalVariable(arg: 1, scope: !182, type: !6) +// CHECK:STDOUT: !191 = !DILocation(line: 137, column: 5, scope: !182) +// CHECK:STDOUT: !193 = !DILocation(line: 138, column: 5, scope: !182) +// CHECK:STDOUT: !194 = !DILocation(line: 139, column: 5, scope: !182) +// CHECK:STDOUT: !195 = !{!183} +// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !117, line: 125, type: !114, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !203 = !DILocation(line: 128, column: 5, scope: !196) +// CHECK:STDOUT: !204 = !DILocation(line: 129, column: 5, scope: !196) +// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !136, line: 64, type: !180, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !213) +// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !205, type: !6) +// CHECK:STDOUT: !210 = !DILocation(line: 66, column: 17, scope: !205) +// CHECK:STDOUT: !212 = !DILocation(line: 66, column: 5, scope: !205) +// CHECK:STDOUT: !213 = !{!206} +// CHECK:STDOUT: !214 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !136, line: 59, type: !180, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !221) +// CHECK:STDOUT: !215 = !DILocalVariable(arg: 1, scope: !214, type: !6) +// CHECK:STDOUT: !220 = !DILocation(line: 59, column: 28, scope: !214) +// CHECK:STDOUT: !221 = !{!215} // CHECK:STDOUT: diff --git a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon index 257def2b6f38..900b6caf315e 100644 --- a/toolchain/testing/testdata/min_prelude/parts/iterate.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/iterate.carbon @@ -16,5 +16,5 @@ interface Iterate { let ElementType: Copy; let CursorType: type; fn NewCursor(self) -> CursorType; - fn Next(self, cursor: CursorType*) -> Optional(ElementType); + fn Next(self, ref cursor: CursorType) -> Optional(ElementType); }