mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:40:10 +01:00
Destroy temporaries at the end of expression statements. (#7513)
Instead of tracking the cleanup scope depth on entry to each scope, track an "ambient" cleanup scope depth that's *after* the destructors of local variables in that scope. This gets increased to include the destructors of local variables when we create a name-binding declaration. Then, when we reach a point where temporaries should be destroyed, run cleanups that are after the ambient cleanup scope depth on the stack. This happens: * At the `;` of a statement expression. * At the `)` of an `if` or `while` statement. * After performing the implied `HasValue()` call in a `for` statement. Per informal agreement with leads, this means we lifetime-extend all temporaries created in the initializer of a name-binding declaration to the full scope of that declaration, but that temporaries created in an expression statement are destroyed at the `;`.
This commit is contained in:
@@ -161,7 +161,13 @@ static auto AddCleanups(Context& context, ScopeStack::CleanupScopeDepth depth)
|
||||
}
|
||||
}
|
||||
|
||||
auto AddAndDiscardCleanups(Context& context) -> void {
|
||||
auto AddAndDiscardTemporaryCleanups(Context& context) -> void {
|
||||
auto depth = context.scope_stack().ambient_cleanup_scope_depth();
|
||||
AddCleanups(context, depth);
|
||||
context.scope_stack().DiscardCleanupsSince(depth);
|
||||
}
|
||||
|
||||
auto AddAndDiscardScopeCleanups(Context& context) -> void {
|
||||
auto depth = context.scope_stack().enclosing_cleanup_scope_depth();
|
||||
AddCleanups(context, depth);
|
||||
context.scope_stack().DiscardCleanupsSince(depth);
|
||||
|
||||
@@ -92,9 +92,13 @@ auto AddInstWithCleanupInNoBlock(Context& context, LocT loc, InstT inst)
|
||||
return inst_id;
|
||||
}
|
||||
|
||||
// Adds any cleanups for variables and temporaries within the current statement
|
||||
// scope and discards them from cleanup tracking.
|
||||
auto AddAndDiscardCleanups(Context& context) -> void;
|
||||
// Adds any cleanups for temporaries within the current statement and discards
|
||||
// them from cleanup tracking.
|
||||
auto AddAndDiscardTemporaryCleanups(Context& context) -> void;
|
||||
|
||||
// Adds any cleanups for variables and temporaries within the current scope and
|
||||
// discards them from cleanup tracking.
|
||||
auto AddAndDiscardScopeCleanups(Context& context) -> void;
|
||||
|
||||
// Adds a branch to the given target block, which should be in the current scope
|
||||
// or an enclosing scope, along with cleanups for all variables and temporaries
|
||||
|
||||
@@ -17,7 +17,7 @@ auto HandleParseNode(Context& context, Parse::CodeBlockStartId node_id)
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::CodeBlockId /*node_id*/) -> bool {
|
||||
AddAndDiscardCleanups(context);
|
||||
AddAndDiscardScopeCleanups(context);
|
||||
context.scope_stack().Pop(/*check_unused=*/true);
|
||||
context.node_stack()
|
||||
.PopAndDiscardSoloNodeId<Parse::NodeKind::CodeBlockStart>();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#include "toolchain/check/context.h"
|
||||
#include "toolchain/check/control_flow.h"
|
||||
#include "toolchain/check/convert.h"
|
||||
#include "toolchain/check/handle.h"
|
||||
#include "toolchain/sem_ir/inst.h"
|
||||
@@ -12,6 +13,7 @@ namespace Carbon::Check {
|
||||
auto HandleParseNode(Context& context, Parse::ExprStatementId /*node_id*/)
|
||||
-> bool {
|
||||
DiscardExpr(context, context.node_stack().PopExpr());
|
||||
AddAndDiscardTemporaryCleanups(context);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ auto HandleParseNode(Context& context, Parse::IfConditionId node_id) -> bool {
|
||||
auto cond_value_id = context.node_stack().PopExpr();
|
||||
cond_value_id = ConvertToBoolValue(context, node_id, cond_value_id);
|
||||
|
||||
// Destroy any temporaries created in the condition.
|
||||
AddAndDiscardTemporaryCleanups(context);
|
||||
|
||||
// Create the then block and the else block, and branch to the right one. If
|
||||
// there is no `else`, the then block will terminate with a branch to the
|
||||
// else block, which will be reused as the resumption block.
|
||||
|
||||
@@ -342,6 +342,10 @@ auto HandleParseNode(Context& context, Parse::LetDeclId node_id) -> bool {
|
||||
if (!InNonStaticFieldDecl(context)) {
|
||||
AddInst<SemIR::NameBindingDecl>(context, node_id,
|
||||
{.pattern_block_id = pattern_block_id});
|
||||
|
||||
// Objects created in a name binding declaration live until the end of the
|
||||
// scope.
|
||||
context.scope_stack().DeferCleanups();
|
||||
}
|
||||
|
||||
context.full_pattern_stack().PopFullPattern();
|
||||
@@ -419,11 +423,14 @@ auto HandleParseNode(Context& context, Parse::VariableDeclId node_id) -> bool {
|
||||
if (!InNonStaticFieldDecl(context)) {
|
||||
AddInst<SemIR::NameBindingDecl>(context, node_id,
|
||||
{.pattern_block_id = pattern_block_id});
|
||||
|
||||
// Objects created in a name binding declaration live until the end of the
|
||||
// scope.
|
||||
context.scope_stack().DeferCleanups();
|
||||
}
|
||||
|
||||
context.full_pattern_stack().PopFullPattern();
|
||||
context.decl_introducer_state_stack().Pop<Lex::TokenKind::Var>();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,9 +43,13 @@ static auto StartLoopHeader(Context& context, Parse::NodeId node_id)
|
||||
// the loop exit if it is `false`.
|
||||
static auto BranchAndStartLoopBody(Context& context, Parse::NodeId node_id,
|
||||
SemIR::InstBlockId loop_header_id,
|
||||
ScopeStack::CleanupScopeDepth continue_depth,
|
||||
SemIR::InstId cond_value_id) -> void {
|
||||
cond_value_id = ConvertToBoolValue(context, node_id, cond_value_id);
|
||||
|
||||
// Destroy any temporaries created computing the loop condition.
|
||||
AddAndDiscardTemporaryCleanups(context);
|
||||
|
||||
// Branch to either the loop body or the loop exit block.
|
||||
auto loop_body_id =
|
||||
AddDominatedBlockAndBranchIf(context, node_id, cond_value_id);
|
||||
@@ -63,8 +67,7 @@ static auto BranchAndStartLoopBody(Context& context, Parse::NodeId node_id,
|
||||
{.break_target = loop_exit_id,
|
||||
.break_depth = context.scope_stack().cleanup_scope_depth(),
|
||||
.continue_target = loop_header_id,
|
||||
.continue_depth =
|
||||
context.scope_stack().enclosing_cleanup_scope_depth()});
|
||||
.continue_depth = continue_depth});
|
||||
}
|
||||
|
||||
// Finishes emitting the body for a `while`-like loop. Adds a back-edge to the
|
||||
@@ -83,7 +86,7 @@ static auto FinishLoopBody(Context& context, Parse::NodeId node_id) -> void {
|
||||
context.region_stack().AddToRegion(blocks.break_target, node_id);
|
||||
|
||||
// Clean up anything created in the loop header and pop the loop scope.
|
||||
AddAndDiscardCleanups(context);
|
||||
AddAndDiscardScopeCleanups(context);
|
||||
context.scope_stack().Pop(/*check_unused=*/true);
|
||||
}
|
||||
|
||||
@@ -105,7 +108,9 @@ auto HandleParseNode(Context& context, Parse::WhileConditionId node_id)
|
||||
|
||||
// Branch to either the loop body or the loop exit block, and start emitting
|
||||
// the loop body.
|
||||
BranchAndStartLoopBody(context, node_id, loop_header_id, cond_value_id);
|
||||
BranchAndStartLoopBody(context, node_id, loop_header_id,
|
||||
context.scope_stack().enclosing_cleanup_scope_depth(),
|
||||
cond_value_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -211,6 +216,7 @@ auto HandleParseNode(Context& context, Parse::ForHeaderId node_id) -> bool {
|
||||
|
||||
// Start emitting the loop header block.
|
||||
auto loop_header_id = StartLoopHeader(context, start_node_id);
|
||||
auto continue_depth = context.scope_stack().ambient_cleanup_scope_depth();
|
||||
|
||||
// Call `<range>.(Iterate.Next)(&cursor)`.
|
||||
auto cursor_type_inst_id = context.types().GetTypeInstId(cursor_type_id);
|
||||
@@ -229,10 +235,15 @@ auto HandleParseNode(Context& context, Parse::ForHeaderId node_id) -> bool {
|
||||
// that.
|
||||
element_id = ConvertToValueOrRefExpr(context, element_id);
|
||||
|
||||
// Temporaries in the optional and loop variables live for the duration of the
|
||||
// loop body.
|
||||
context.scope_stack().DeferCleanups();
|
||||
|
||||
// Branch to the loop body if the optional element has a value.
|
||||
auto cond_value_id = CallOptionalAccessor(context, node_id, element_id,
|
||||
CoreIdentifier::HasValue);
|
||||
BranchAndStartLoopBody(context, node_id, loop_header_id, cond_value_id);
|
||||
BranchAndStartLoopBody(context, node_id, loop_header_id, continue_depth,
|
||||
cond_value_id);
|
||||
|
||||
// The loop pattern's initializer is now complete, and any bindings in it
|
||||
// should be in scope.
|
||||
@@ -250,7 +261,7 @@ auto HandleParseNode(Context& context, Parse::ForStatementId node_id) -> bool {
|
||||
FinishLoopBody(context, node_id);
|
||||
|
||||
// Pop the scope that the range and cursor live in.
|
||||
AddAndDiscardCleanups(context);
|
||||
AddAndDiscardScopeCleanups(context);
|
||||
context.scope_stack().Pop(/*check_unused=*/true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -210,8 +210,9 @@ auto ScopeStack::MergeTopScopeIntoGrandparentAndPop() -> void {
|
||||
std::rotate(destroy_id_stack_.begin() + parent.cleanup_scope_depth.index,
|
||||
destroy_id_stack_.begin() + current.cleanup_scope_depth.index,
|
||||
destroy_id_stack_.end());
|
||||
parent.cleanup_scope_depth.index = new_mid - destroy_id_stack_.begin();
|
||||
current.cleanup_scope_depth.index = destroy_id_stack_.size();
|
||||
parent.cleanup_scope_depth =
|
||||
CleanupScopeDepth(new_mid - destroy_id_stack_.begin());
|
||||
current.cleanup_scope_depth = CleanupScopeDepth(destroy_id_stack_.size());
|
||||
|
||||
Pop();
|
||||
}
|
||||
|
||||
@@ -256,12 +256,27 @@ class ScopeStack {
|
||||
return llvm::ArrayRef(destroy_id_stack_).slice(depth.index);
|
||||
}
|
||||
|
||||
// Add all cleanups created so far in this scope to the ambient state of the
|
||||
// scope. This causes them to be deferred until the scope is exited.
|
||||
auto DeferCleanups() -> void {
|
||||
CARBON_CHECK(IsCleanupScope() ||
|
||||
static_cast<size_t>(Peek().cleanup_scope_depth.index) ==
|
||||
destroy_id_stack_.size());
|
||||
scope_stack_.back().cleanup_scope_depth =
|
||||
CleanupScopeDepth(destroy_id_stack_.size());
|
||||
}
|
||||
|
||||
// Discards cleanups after the given depth, which must be within the current
|
||||
// scope.
|
||||
auto DiscardCleanupsSince(CleanupScopeDepth depth) -> void {
|
||||
auto enclosing = enclosing_cleanup_scope_depth();
|
||||
CARBON_CHECK(depth >= enclosing);
|
||||
destroy_id_stack_.truncate(depth.index);
|
||||
if (scope_stack_.back().cleanup_scope_depth.index > depth.index) {
|
||||
// We have discarded ambient cleanups. Reduce the ambient cleanup depth to
|
||||
// match. This happens when exiting the scope.
|
||||
scope_stack_.back().cleanup_scope_depth = depth;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the current depth of the cleanup stack.
|
||||
@@ -269,9 +284,15 @@ class ScopeStack {
|
||||
return CleanupScopeDepth(destroy_id_stack_.size());
|
||||
}
|
||||
|
||||
// Returns the ambient depth of the cleanup stack in the current scope.
|
||||
auto ambient_cleanup_scope_depth() const -> CleanupScopeDepth {
|
||||
return Peek().cleanup_scope_depth;
|
||||
}
|
||||
|
||||
// Returns the depth of the cleanup stack enclosing the current scope.
|
||||
auto enclosing_cleanup_scope_depth() const -> CleanupScopeDepth {
|
||||
return Peek().cleanup_scope_depth;
|
||||
return scope_stack_.size() < 2 ? CleanupScopeDepth(0)
|
||||
: Peek(1).cleanup_scope_depth;
|
||||
}
|
||||
|
||||
// Returns the depth of the cleanup stack enclosing this function scope.
|
||||
@@ -329,7 +350,8 @@ class ScopeStack {
|
||||
// The kind of cleanup scope that is associated with this scope.
|
||||
CleanupScopeKind cleanup_scope_kind = CleanupScopeKind::None;
|
||||
|
||||
// The cleanup scope depth on entry to this scope.
|
||||
// The ambient cleanup scope depth in this scope. This is the depth that we
|
||||
// will return to at the end of a statement in this scope.
|
||||
CleanupScopeDepth cleanup_scope_depth;
|
||||
|
||||
// Whether there are any ids in the `names` set.
|
||||
|
||||
+22
-25
@@ -54,8 +54,6 @@ class C { fn Make() -> C; }
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F() {
|
||||
// TODO: The scoping of these destroy calls is incorrect. Maybe we need to
|
||||
// establish statement scopes?
|
||||
A.Make();
|
||||
B.Make();
|
||||
C.Make();
|
||||
@@ -88,7 +86,6 @@ fn F(template T: type) {
|
||||
|
||||
fn G() { F({}); }
|
||||
|
||||
|
||||
// CHECK:STDOUT: --- implicit_return.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -305,9 +302,9 @@ fn G() { F({}); }
|
||||
// CHECK:STDOUT: %C.Make: %C.Make.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc14_10.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc10_10.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc13 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.3: type = fn_type @Destroy.Op.loc11 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.3: %Destroy.Op.type.1d8f74.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc12 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
@@ -320,42 +317,42 @@ fn G() { F({}); }
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %Make.ref.loc12: %A.Make.type = name_ref Make, @A.%A.Make.decl [concrete = constants.%A.Make]
|
||||
// CHECK:STDOUT: %.loc12_10.1: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %A.Make.call: init %A to %.loc12_10.1 = call %Make.ref.loc12()
|
||||
// CHECK:STDOUT: %.loc12_10.2: ref %A = temporary %.loc12_10.1, %A.Make.call
|
||||
// CHECK:STDOUT: %Make.ref.loc10: %A.Make.type = name_ref Make, @A.%A.Make.decl [concrete = constants.%A.Make]
|
||||
// CHECK:STDOUT: %.loc10_10.1: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %A.Make.call: init %A to %.loc10_10.1 = call %Make.ref.loc10()
|
||||
// CHECK:STDOUT: %.loc10_10.2: ref %A = temporary %.loc10_10.1, %A.Make.call
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc10: <bound method> = bound_method %.loc10_10.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%.loc10_10.2)
|
||||
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
|
||||
// CHECK:STDOUT: %Make.ref.loc13: %B.Make.type = name_ref Make, @B.%B.Make.decl [concrete = constants.%B.Make]
|
||||
// CHECK:STDOUT: %.loc13_10.1: ref %B = temporary_storage
|
||||
// CHECK:STDOUT: %B.Make.call: init %B to %.loc13_10.1 = call %Make.ref.loc13()
|
||||
// CHECK:STDOUT: %.loc13_10.2: ref %B = temporary %.loc13_10.1, %B.Make.call
|
||||
// CHECK:STDOUT: %Make.ref.loc11: %B.Make.type = name_ref Make, @B.%B.Make.decl [concrete = constants.%B.Make]
|
||||
// CHECK:STDOUT: %.loc11_10.1: ref %B = temporary_storage
|
||||
// CHECK:STDOUT: %B.Make.call: init %B to %.loc11_10.1 = call %Make.ref.loc11()
|
||||
// CHECK:STDOUT: %.loc11_10.2: ref %B = temporary %.loc11_10.1, %B.Make.call
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc11: <bound method> = bound_method %.loc11_10.2, constants.%Destroy.Op.1a2547.3
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_10.2)
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Make.ref.loc14: %C.Make.type = name_ref Make, @C.%C.Make.decl [concrete = constants.%C.Make]
|
||||
// CHECK:STDOUT: %.loc14_10.1: ref %C = temporary_storage
|
||||
// CHECK:STDOUT: %C.Make.call: init %C to %.loc14_10.1 = call %Make.ref.loc14()
|
||||
// CHECK:STDOUT: %.loc14_10.2: ref %C = temporary %.loc14_10.1, %C.Make.call
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc14: <bound method> = bound_method %.loc14_10.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc14: init %empty_tuple.type = call %Destroy.Op.bound.loc14(%.loc14_10.2)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc13: <bound method> = bound_method %.loc13_10.2, constants.%Destroy.Op.1a2547.3
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_10.2)
|
||||
// CHECK:STDOUT: %Make.ref.loc12: %C.Make.type = name_ref Make, @C.%C.Make.decl [concrete = constants.%C.Make]
|
||||
// CHECK:STDOUT: %.loc12_10.1: ref %C = temporary_storage
|
||||
// CHECK:STDOUT: %C.Make.call: init %C to %.loc12_10.1 = call %Make.ref.loc12()
|
||||
// CHECK:STDOUT: %.loc12_10.2: ref %C = temporary %.loc12_10.1, %C.Make.call
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc12: <bound method> = bound_method %.loc12_10.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call %Destroy.Op.bound.loc12(%.loc12_10.2)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc14_10.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_10.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc14_10.2(%self.param: ref %C) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_10.2(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %B) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11(%self.param: ref %B) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc12(%self.param: ref %C) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+4
-4
@@ -149,7 +149,7 @@ fn F[A: J, B: A](x: C(A, B)) {
|
||||
// CHECK:STDOUT: %Goat.val: %Goat = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.4ea: ref %Goat = temporary invalid, %Goat.val [concrete]
|
||||
// CHECK:STDOUT: %.406: type = fn_type_with_self_type %Eats.WithSelf.Eat.type.618, %Eats.facet [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc27_8.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc26_8.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.4ea, %Destroy.Op.1a2547.2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -196,6 +196,7 @@ fn F[A: J, B: A](x: C(A, B)) {
|
||||
// CHECK:STDOUT: %.loc26_8.2: ref %Goat = temporary %.loc26_6.2, %.loc26_8.1 [concrete = constants.%.4ea]
|
||||
// CHECK:STDOUT: %Bleet.ref.loc26: %Goat.Bleet.type = name_ref Bleet, @Goat.%Goat.Bleet.decl [concrete = constants.%Goat.Bleet]
|
||||
// CHECK:STDOUT: %Goat.Bleet.call.loc26: init %empty_tuple.type = call %Bleet.ref.loc26()
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.4ea)
|
||||
// CHECK:STDOUT: %.loc27_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Goat.ref.loc27_11: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat]
|
||||
// CHECK:STDOUT: %.loc27_6.2: ref %Goat = temporary_storage
|
||||
@@ -212,14 +213,13 @@ fn F[A: J, B: A](x: C(A, B)) {
|
||||
// CHECK:STDOUT: %impl.elem0.loc27: %.406 = impl_witness_access constants.%Eats.impl_witness, element0 [concrete = constants.%Goat.as.Eats.impl.Eat]
|
||||
// CHECK:STDOUT: %Goat.as.Eats.impl.Eat.call.loc27: init %empty_tuple.type = call %impl.elem0.loc27()
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc27: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.4ea)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc26: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.4ea)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc22: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.4ea)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc27_8.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc26_8.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc27_8.2(%self.param: ref %Goat) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc26_8.2(%self.param: ref %Goat) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+9
-9
@@ -218,11 +218,11 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc33_17.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ReturnDUsed.type: type = fn_type @ReturnDUsed [concrete]
|
||||
// CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc34_15.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -279,14 +279,14 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT: %.loc33_17.1: ref %D = temporary_storage
|
||||
// CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc33_17.1 = call %ReturnDUnused.ref()
|
||||
// CHECK:STDOUT: %.loc33_17.2: ref %D = temporary %.loc33_17.1, %ReturnDUnused.call
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc33: <bound method> = bound_method %.loc33_17.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc33: init %empty_tuple.type = call %Destroy.Op.bound.loc33(%.loc33_17.2)
|
||||
// CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%Main.ReturnDUsed [concrete = constants.%ReturnDUsed]
|
||||
// CHECK:STDOUT: %.loc34_15.1: ref %D = temporary_storage
|
||||
// CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc34_15.1 = call %ReturnDUsed.ref()
|
||||
// CHECK:STDOUT: %.loc34_15.2: ref %D = temporary %.loc34_15.1, %ReturnDUsed.call
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc34: <bound method> = bound_method %.loc34_15.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_15.2)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc33: <bound method> = bound_method %.loc33_17.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc33: init %empty_tuple.type = call %Destroy.Op.bound.loc33(%.loc33_17.2)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -296,12 +296,12 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ReturnDUnused [from "fail_incomplete_return.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ReturnDUsed [from "fail_incomplete_return.carbon"];
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc33_17.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc34_15.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc34_15.2(%self.param: ref %D) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc33_17.2(%self.param: ref %D) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ReturnDUsed [from "fail_incomplete_return.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/bool.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/if/lifetime.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/if/lifetime.carbon
|
||||
|
||||
// --- condition_lifetime.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class A {
|
||||
fn F() -> bool;
|
||||
}
|
||||
|
||||
fn Make() -> A;
|
||||
|
||||
fn G();
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// The temporary A object is destroyed before the branch.
|
||||
if (Make().F()) {
|
||||
G();
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- condition_lifetime.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %A.F.type: type = fn_type @A.F [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %A.F: %A.F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete]
|
||||
// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc14_12.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
|
||||
// CHECK:STDOUT: %.loc14_12.1: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %Make.call: init %A to %.loc14_12.1 = call %Make.ref()
|
||||
// CHECK:STDOUT: %.loc14_12.2: ref %A = temporary %.loc14_12.1, %Make.call
|
||||
// CHECK:STDOUT: %F.ref: %A.F.type = name_ref F, @A.%A.F.decl [concrete = constants.%A.F]
|
||||
// CHECK:STDOUT: %A.F.call: init bool = call %F.ref()
|
||||
// CHECK:STDOUT: %.loc14_17.1: bool = value_of_initializer %A.F.call
|
||||
// CHECK:STDOUT: %.loc14_17.2: bool = converted %A.F.call, %.loc14_17.1
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc14_12.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc14_12.2)
|
||||
// CHECK:STDOUT: if %.loc14_17.2 br !if.then else br !if.else
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.then:
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref()
|
||||
// CHECK:STDOUT: br !if.else
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !if.else:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc14_12.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc14_12.2(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -139,14 +139,14 @@ fn G() {
|
||||
// CHECK:STDOUT: %I.WithSelf.II.03d: %I.WithSelf.II.type.92c = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.dd2: type = fn_type_with_self_type %J.WithSelf.JJ.type.95f, %J.facet.a74 [concrete]
|
||||
// CHECK:STDOUT: %C.as.J.impl.JJ.bound: <bound method> = bound_method %.5d3, %C.as.J.impl.JJ [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc40_8.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.5d3, %Destroy.Op.1a2547.2 [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %facet_type = facet_value %C, (%I.impl_witness, %J.impl_witness) [concrete]
|
||||
// CHECK:STDOUT: %t.param_patt.5f8: %pattern_type.f79 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %t.patt.b06: %pattern_type.f79 = at_binding_pattern t, %t.param_patt.5f8 [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc46_11.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.5d3, %Destroy.Op.1a2547.2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -432,6 +432,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc40_8.2, %impl.elem0 [concrete = constants.%C.as.J.impl.JJ.bound]
|
||||
// CHECK:STDOUT: %.loc40_8.3: %C = acquire_value %.loc40_8.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %C.as.J.impl.JJ.call: init %empty_tuple.type = call %bound_method(%.loc40_8.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc40: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5d3)
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %C.ref.loc46_5: type = name_ref C, %C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %.loc46_9.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
@@ -450,7 +451,6 @@ fn G() {
|
||||
// CHECK:STDOUT: %.loc46_11.3: %C = acquire_value %.loc46_11.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc46_11.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc46: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5d3)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc40: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.5d3)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -464,9 +464,9 @@ fn G() {
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc46_11.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc40_8.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc46_11.2(%self.param: ref %C) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc40_8.2(%self.param: ref %C) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+16
-16
@@ -1942,14 +1942,14 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %ptr.0a2: type = ptr_type %C [concrete]
|
||||
// CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.Overload.cpp_overload_set.type: type = cpp_overload_set_type @C.Overload.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %C.Overload.cpp_overload_set.value: %C.Overload.cpp_overload_set.type = cpp_overload_set_value @C.Overload.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.type: type = fn_type @Overload__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk: %Overload__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -2001,6 +2001,10 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_38.1, %addr.loc8_38.2)
|
||||
// CHECK:STDOUT: %.loc8_38.2: init %C to %.loc8_38.1 = mark_in_place_init %C__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc8_38.3: ref %C = temporary %.loc8_38.1, %.loc8_38.2
|
||||
// CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc8_38.3, constants.%C.cpp_destructor
|
||||
// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_38.3)
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_37.3, constants.%PublicCall.cpp_destructor
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.call.loc8: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound.loc8(%.loc8_37.3)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc9_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %C.ref.loc9: type = name_ref C, imports.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Overload.ref: %C.Overload.cpp_overload_set.type = name_ref Overload, imports.%C.Overload.cpp_overload_set.value [concrete = constants.%C.Overload.cpp_overload_set.value]
|
||||
@@ -2018,10 +2022,6 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl(%addr.loc9_45)
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_44.3, constants.%PublicCall.cpp_destructor
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.call.loc9: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound.loc9(%.loc9_44.3)
|
||||
// CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc8_38.3, constants.%C.cpp_destructor
|
||||
// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_38.3)
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_37.3, constants.%PublicCall.cpp_destructor
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.call.loc8: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound.loc8(%.loc8_37.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -2304,6 +2304,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete]
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.1: %Overload__carbon_thunk.type.3dd392.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
|
||||
@@ -2314,8 +2316,6 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.2: %Overload__carbon_thunk.type.3dd392.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -2380,6 +2380,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4
|
||||
// CHECK:STDOUT: %addr.loc11_41: %ptr.d0a = addr_of %.loc11_40.5
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc11_41)
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3)
|
||||
// CHECK:STDOUT: %Overload.ref.loc12: %Public.Overload.cpp_overload_set.type = name_ref Overload, imports.%Public.Overload.cpp_overload_set.value [concrete = constants.%Public.Overload.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ProtectedCall.ref.loc12_17: type = name_ref ProtectedCall, imports.%ProtectedCall.decl [concrete = constants.%ProtectedCall]
|
||||
@@ -2395,8 +2397,6 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc12_47)
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: <bound method> = bound_method %.loc12_46.3, constants.%ProtectedCall.cpp_destructor
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc12_46.3)
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -2416,6 +2416,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete]
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.1: %Overload__carbon_thunk.type.3dd392.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
|
||||
@@ -2426,8 +2428,6 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.2: %Overload__carbon_thunk.type.3dd392.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -2492,6 +2492,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4
|
||||
// CHECK:STDOUT: %addr.loc11_41: %ptr.d0a = addr_of %.loc11_40.5
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc11_41)
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3)
|
||||
// CHECK:STDOUT: %Overload.ref.loc12: %Protected.Overload.cpp_overload_set.type = name_ref Overload, imports.%Protected.Overload.cpp_overload_set.value [concrete = constants.%Protected.Overload.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ProtectedCall.ref.loc12_17: type = name_ref ProtectedCall, imports.%ProtectedCall.decl [concrete = constants.%ProtectedCall]
|
||||
@@ -2507,8 +2509,6 @@ fn Call(var instance: Cpp.PublicPrivate) {
|
||||
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc12_47)
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: <bound method> = bound_method %.loc12_46.3, constants.%ProtectedCall.cpp_destructor
|
||||
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc12_46.3)
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor
|
||||
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+32
-32
@@ -296,6 +296,10 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %HasQualifiers.ref_this: %HasQualifiers.ref_this.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.plain.type.99c640.2: type = fn_type @HasQualifiers.plain.2 [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.plain.cdd9ec.2: %HasQualifiers.plain.type.99c640.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.type: type = fn_type @HasQualifiers.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor: %HasQualifiers.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.1: type = fn_type @HasQualifiers.Op.1 [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.4dca31.1: %HasQualifiers.Op.type.83af6e.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_ref_this.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ref_ref_this__carbon_thunk.type: type = fn_type @ref_ref_this__carbon_thunk [concrete]
|
||||
@@ -307,16 +311,12 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %ptr.e71: type = ptr_type %const.ba8 [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers__carbon_thunk.type: type = fn_type @HasQualifiers__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers__carbon_thunk: %HasQualifiers__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.1: type = fn_type @HasQualifiers.Op.1 [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.4dca31.1: %HasQualifiers.Op.type.83af6e.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.d0d: <witness> = custom_witness (%HasQualifiers.Op.4dca31.1), @Copy [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.2: type = fn_type @HasQualifiers.Op.2 [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.4dca31.2: %HasQualifiers.Op.type.83af6e.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.d0d: <witness> = custom_witness (%HasQualifiers.Op.4dca31.2), @Copy [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet.11b: %Copy.type = facet_value %HasQualifiers, (%custom_witness.d0d) [concrete]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.033: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.11b) [concrete]
|
||||
// CHECK:STDOUT: %.703: type = fn_type_with_self_type %Copy.WithSelf.Op.type.033, %Copy.facet.11b [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.type: type = fn_type @HasQualifiers.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor: %HasQualifiers.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.2: type = fn_type @HasQualifiers.Op.2 [concrete]
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.4dca31.2: %HasQualifiers.Op.type.83af6e.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -355,6 +355,11 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.decl: %HasQualifiers.cpp_destructor.type = fn_decl @HasQualifiers.cpp_destructor [concrete = constants.%HasQualifiers.cpp_destructor] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.ref_ref_this.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %ref_ref_this__carbon_thunk.decl: %ref_ref_this__carbon_thunk.type = fn_decl @ref_ref_this__carbon_thunk [concrete = constants.%ref_ref_this__carbon_thunk] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -371,11 +376,6 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.decl: %HasQualifiers.cpp_destructor.type = fn_decl @HasQualifiers.cpp_destructor [concrete = constants.%HasQualifiers.cpp_destructor] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%v.param: %HasQualifiers, %p.param: %ptr.102) {
|
||||
@@ -422,6 +422,11 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %bound_method.loc19: <bound method> = bound_method %.loc19_8.2, %plain.ref.loc19
|
||||
// CHECK:STDOUT: %.loc19_8.3: %HasQualifiers = acquire_value %.loc19_8.2
|
||||
// CHECK:STDOUT: %HasQualifiers.plain.call.loc19: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl.3d4ba8.2(%.loc19_8.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc19: <bound method> = bound_method %.loc19_8.2, constants.%HasQualifiers.Op.4dca31.1
|
||||
// CHECK:STDOUT: %Op.ref.loc19: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc19: <bound method> = bound_method %.loc19_8.2, %Op.ref.loc19
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc19: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc19(%.loc19_8.2)
|
||||
// CHECK:STDOUT: %Make.ref.loc20: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
|
||||
// CHECK:STDOUT: %.loc20_8.1: ref %HasQualifiers = temporary_storage
|
||||
// CHECK:STDOUT: %Make.call.loc20: init %HasQualifiers to %.loc20_8.1 = call %Make.ref.loc20()
|
||||
@@ -430,6 +435,10 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %bound_method.loc20: <bound method> = bound_method %.loc20_8.2, %const_this.ref.loc20
|
||||
// CHECK:STDOUT: %.loc20_8.3: %HasQualifiers = acquire_value %.loc20_8.2
|
||||
// CHECK:STDOUT: %const_this__carbon_thunk.call.loc20: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc20_8.3)
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc20: <bound method> = bound_method %.loc20_8.2, constants.%HasQualifiers.Op.4dca31.1
|
||||
// CHECK:STDOUT: %Op.ref.loc20: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc20: <bound method> = bound_method %.loc20_8.2, %Op.ref.loc20
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc20: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc20(%.loc20_8.2)
|
||||
// CHECK:STDOUT: %Make.ref.loc21: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
|
||||
// CHECK:STDOUT: %.loc21_8.1: ref %HasQualifiers = temporary_storage
|
||||
// CHECK:STDOUT: %Make.call.loc21: init %HasQualifiers to %.loc21_8.1 = call %Make.ref.loc21()
|
||||
@@ -438,6 +447,10 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %bound_method.loc21: <bound method> = bound_method %.loc21_8.2, %const_ref_this.ref.loc21
|
||||
// CHECK:STDOUT: %.loc21_8.3: %HasQualifiers = acquire_value %.loc21_8.2
|
||||
// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc21: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc21_8.3)
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc21: <bound method> = bound_method %.loc21_8.2, constants.%HasQualifiers.Op.4dca31.1
|
||||
// CHECK:STDOUT: %Op.ref.loc21: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc21: <bound method> = bound_method %.loc21_8.2, %Op.ref.loc21
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc21: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc21(%.loc21_8.2)
|
||||
// CHECK:STDOUT: %Make.ref.loc22: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
|
||||
// CHECK:STDOUT: %.loc22_8.1: ref %HasQualifiers = temporary_storage
|
||||
// CHECK:STDOUT: %Make.call.loc22: init %HasQualifiers to %.loc22_8.1 = call %Make.ref.loc22()
|
||||
@@ -446,7 +459,7 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %bound_method.loc22_9: <bound method> = bound_method %.loc22_8.2, %ref_ref_this.ref
|
||||
// CHECK:STDOUT: %.loc22_8.3: %HasQualifiers = acquire_value %.loc22_8.2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %impl.elem0.loc22: %.703 = impl_witness_access constants.%custom_witness.d0d, element0 [concrete = constants.%HasQualifiers.Op.4dca31.1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc22: %.703 = impl_witness_access constants.%custom_witness.d0d, element0 [concrete = constants.%HasQualifiers.Op.4dca31.2]
|
||||
// CHECK:STDOUT: %bound_method.loc22_8: <bound method> = bound_method %.loc22_8.3, %impl.elem0.loc22
|
||||
// CHECK:STDOUT: %.loc22_8.4: ref %HasQualifiers = temporary_storage
|
||||
// CHECK:STDOUT: %Op.ref.loc22_8.1: %HasQualifiers.HasQualifiers.type = name_ref Op, imports.%HasQualifiers.HasQualifiers.decl [concrete = constants.%HasQualifiers.HasQualifiers]
|
||||
@@ -460,6 +473,11 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %.loc22_8.8: init %HasQualifiers to %self.var = mark_in_place_init %HasQualifiers__carbon_thunk.call
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %ref_ref_this__carbon_thunk.call: init %empty_tuple.type = call imports.%ref_ref_this__carbon_thunk.decl(%self.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc22: <bound method> = bound_method %.loc22_8.2, constants.%HasQualifiers.Op.4dca31.1
|
||||
// CHECK:STDOUT: %Op.ref.loc22_8.2: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc22: <bound method> = bound_method %.loc22_8.2, %Op.ref.loc22_8.2
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc22: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc22(%.loc22_8.2)
|
||||
// CHECK:STDOUT: %Make.ref.loc23: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
|
||||
// CHECK:STDOUT: %.loc23_8.1: ref %HasQualifiers = temporary_storage
|
||||
// CHECK:STDOUT: %Make.call.loc23: init %HasQualifiers to %.loc23_8.1 = call %Make.ref.loc23()
|
||||
@@ -468,29 +486,11 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
|
||||
// CHECK:STDOUT: %bound_method.loc23: <bound method> = bound_method %.loc23_8.2, %const_ref_ref_this.ref.loc23
|
||||
// CHECK:STDOUT: %.loc23_8.3: %HasQualifiers = acquire_value %.loc23_8.2
|
||||
// CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call.loc23: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%.loc23_8.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc23: <bound method> = bound_method %.loc23_8.2, constants.%HasQualifiers.Op.4dca31.2
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc23: <bound method> = bound_method %.loc23_8.2, constants.%HasQualifiers.Op.4dca31.1
|
||||
// CHECK:STDOUT: %Op.ref.loc23: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc23: <bound method> = bound_method %.loc23_8.2, %Op.ref.loc23
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc23: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc23(%.loc23_8.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc22: <bound method> = bound_method %.loc22_8.2, constants.%HasQualifiers.Op.4dca31.2
|
||||
// CHECK:STDOUT: %Op.ref.loc22_8.2: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc22: <bound method> = bound_method %.loc22_8.2, %Op.ref.loc22_8.2
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc22: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc22(%.loc22_8.2)
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc21: <bound method> = bound_method %.loc21_8.2, constants.%HasQualifiers.Op.4dca31.2
|
||||
// CHECK:STDOUT: %Op.ref.loc21: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc21: <bound method> = bound_method %.loc21_8.2, %Op.ref.loc21
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc21: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc21(%.loc21_8.2)
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc20: <bound method> = bound_method %.loc20_8.2, constants.%HasQualifiers.Op.4dca31.2
|
||||
// CHECK:STDOUT: %Op.ref.loc20: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc20: <bound method> = bound_method %.loc20_8.2, %Op.ref.loc20
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc20: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc20(%.loc20_8.2)
|
||||
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc19: <bound method> = bound_method %.loc19_8.2, constants.%HasQualifiers.Op.4dca31.2
|
||||
// CHECK:STDOUT: %Op.ref.loc19: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc19: <bound method> = bound_method %.loc19_8.2, %Op.ref.loc19
|
||||
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc19: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc19(%.loc19_8.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- use_object_param_qualifiers_overloaded.carbon
|
||||
|
||||
@@ -156,6 +156,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b02: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.cd0, %ImplicitAs.facet.4ba) [concrete]
|
||||
// CHECK:STDOUT: %.0a4: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b02, %ImplicitAs.facet.4ba [concrete]
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %U.as_type.as.ImplicitAs.impl.Convert.968, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.e9e, %OptionalAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc11_18.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t: type = class_type @NullptrT [concrete]
|
||||
// CHECK:STDOUT: %uninit: %Cpp.nullptr_t = uninitialized_value [concrete]
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.e28: type = fn_type @Cpp.nullptr_t.as.ImplicitAs.impl.Convert, @Cpp.nullptr_t.as.ImplicitAs.impl(%T.67d) [symbolic]
|
||||
@@ -169,8 +171,6 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.0b4 [concrete]
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.0b4, @Cpp.nullptr_t.as.ImplicitAs.impl.Convert(%i32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.480: <bound method> = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.5: type = fn_type @Destroy.Op.loc13_21.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.5: %Destroy.Op.type.1d8f74.5 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.8: type = fn_type @Destroy.Op.loc10_3.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.8: %Destroy.Op.type.1d8f74.8 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -259,6 +259,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc11_18.3: ref %Optional.cd0 = temporary %.loc11_18.2, %.loc11_18.1
|
||||
// CHECK:STDOUT: %.loc11_18.4: %Optional.cd0 = acquire_value %.loc11_18.3
|
||||
// CHECK:STDOUT: %TakesArray.call.loc11: init %empty_tuple.type = call imports.%TakesArray.decl(%.loc11_18.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc11: <bound method> = bound_method %.loc11_18.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_18.3)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesArray.ref.loc13: %TakesArray.cpp_overload_set.type = name_ref TakesArray, imports.%TakesArray.cpp_overload_set.value [concrete = constants.%TakesArray.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
@@ -274,26 +276,24 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc13_21.3: ref %Optional.cd0 = temporary %.loc13_21.2, %.loc13_21.1
|
||||
// CHECK:STDOUT: %.loc13_21.4: %Optional.cd0 = acquire_value %.loc13_21.3
|
||||
// CHECK:STDOUT: %TakesArray.call.loc13: init %empty_tuple.type = call imports.%TakesArray.decl(%.loc13_21.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc13: <bound method> = bound_method %.loc13_21.3, constants.%Destroy.Op.1a2547.5
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc13: <bound method> = bound_method %.loc13_21.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_21.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc11: <bound method> = bound_method %.loc11_18.3, constants.%Destroy.Op.1a2547.5
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_18.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc10: <bound method> = bound_method %n.var, constants.%Destroy.Op.1a2547.8
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%n.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc13_21.1(%self.param: ref %.0f8) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_18.1(%self.param: ref %.0f8) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc13_21.2(%self.param: ref %MaybeUnformed.b84) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_18.2(%self.param: ref %MaybeUnformed.b84) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc13_21.3(%self.param: ref %Optional.cd0) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_18.3(%self.param: ref %Optional.cd0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -188,6 +188,8 @@ fn Call() {
|
||||
// CHECK:STDOUT: %bound_method.f8c: <bound method> = bound_method %.414, %X.B.cpp_overload_set.value [concrete]
|
||||
// CHECK:STDOUT: %X.B.type: type = fn_type @X.B [concrete]
|
||||
// CHECK:STDOUT: %X.B: %X.B.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %X.C.type: type = fn_type @X.C [concrete]
|
||||
@@ -198,8 +200,6 @@ fn Call() {
|
||||
// CHECK:STDOUT: %ptr.ca1: type = ptr_type %X [concrete]
|
||||
// CHECK:STDOUT: %D__carbon_thunk.type: type = fn_type @D__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %D__carbon_thunk: %D__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -230,6 +230,11 @@ fn Call() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %X.C.decl: %X.C.type = fn_decl @X.C [concrete = constants.%X.C] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -242,11 +247,6 @@ fn Call() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Call() {
|
||||
@@ -355,6 +355,8 @@ fn Call() {
|
||||
// CHECK:STDOUT: %.loc10_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_22 [concrete = constants.%int_2.295]
|
||||
// CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_2.loc10, %.loc10_22.1 [concrete = constants.%int_2.295]
|
||||
// CHECK:STDOUT: %X.B.call: init %empty_tuple.type = call imports.%X.B.decl(%.loc10_7.3, %.loc10_19.2, %.loc10_22.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Op.ref.loc10: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc11: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
@@ -404,9 +406,7 @@ fn Call() {
|
||||
// CHECK:STDOUT: %.loc12_7.4: ref %X = value_as_ref %.loc12_7.3
|
||||
// CHECK:STDOUT: %addr: %ptr.ca1 = addr_of %.loc12_7.4
|
||||
// CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc12_19.2, %.loc12_22.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Op.ref.loc12: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: %Op.ref.loc10: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -479,6 +479,18 @@ fn Call() {
|
||||
// CHECK:STDOUT: %this.patt: %pattern_type.fa7 = at_binding_pattern this, %this.param_patt [concrete]
|
||||
// CHECK:STDOUT: %B__carbon_thunk.type: type = fn_type @B__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %B__carbon_thunk: %B__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self.0e7) [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %self.param_patt.a14: %pattern_type.fa7 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.37b: %pattern_type.fa7 = at_binding_pattern self, %self.param_patt.a14 [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.c5a: <witness> = custom_witness (), @Destroy [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.761: %Destroy.type = facet_value %X, (%custom_witness.c5a) [concrete]
|
||||
// CHECK:STDOUT: %X.Op.type: type = fn_type @X.Op [concrete]
|
||||
// CHECK:STDOUT: %X.Op: %X.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
|
||||
@@ -492,18 +504,6 @@ fn Call() {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.cf1 = at_binding_pattern _, %_.param_patt [concrete]
|
||||
// CHECK:STDOUT: %D__carbon_thunk.type: type = fn_type @D__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %D__carbon_thunk: %D__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self.0e7) [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %self.param_patt.a14: %pattern_type.fa7 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.37b: %pattern_type.fa7 = at_binding_pattern self, %self.param_patt.a14 [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.c5a: <witness> = custom_witness (), @Destroy [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.761: %Destroy.type = facet_value %X, (%custom_witness.c5a) [concrete]
|
||||
// CHECK:STDOUT: %X.Op.type: type = fn_type @X.Op [concrete]
|
||||
// CHECK:STDOUT: %X.Op: %X.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -623,6 +623,15 @@ fn Call() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: %i32 = wrapper_binding a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.d3e = fn_decl @Destroy.WithSelf.Op [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] {} {}
|
||||
// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = at_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.37b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
|
||||
// CHECK:STDOUT: %a.param_patt: %pattern_type.6b6 = value_param_pattern [concrete = constants.%a.param_patt]
|
||||
@@ -653,15 +662,6 @@ fn Call() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: %i32 = wrapper_binding a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.d3e = fn_decl @Destroy.WithSelf.Op [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] {} {}
|
||||
// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = at_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.37b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -782,6 +782,14 @@ fn Call() {
|
||||
// CHECK:STDOUT: %.loc11_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc11_19.2: %i32 = converted %int_1.loc11, %.loc11_19.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %B__carbon_thunk.call: init %empty_tuple.type = call imports.%B__carbon_thunk.decl(%.loc11_7.3, %.loc11_19.2)
|
||||
// CHECK:STDOUT: %X.Op.decl: %X.Op.type = fn_decl @X.Op [concrete = constants.%X.Op] {
|
||||
// CHECK:STDOUT: %.1: %pattern_type.fa7 = specific_constant constants.%self.param_patt.a14, @Destroy.WithSelf.Op(constants.%Destroy.facet.761) [concrete = constants.%self.param_patt.a14]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = at_binding_pattern self, %.1 [concrete = constants.%self.patt.37b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Op.ref.loc11: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc12: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
@@ -815,15 +823,7 @@ fn Call() {
|
||||
// CHECK:STDOUT: %.loc13_7.4: ref %X = value_as_ref %.loc13_7.3
|
||||
// CHECK:STDOUT: %addr: %ptr.ca1 = addr_of %.loc13_7.4
|
||||
// CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc13_19.2)
|
||||
// CHECK:STDOUT: %X.Op.decl: %X.Op.type = fn_decl @X.Op [concrete = constants.%X.Op] {
|
||||
// CHECK:STDOUT: %.1: %pattern_type.fa7 = specific_constant constants.%self.param_patt.a14, @Destroy.WithSelf.Op(constants.%Destroy.facet.761) [concrete = constants.%self.param_patt.a14]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = at_binding_pattern self, %.1 [concrete = constants.%self.patt.37b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Op.ref.loc13: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: %Op.ref.loc11: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -843,14 +843,6 @@ fn Call() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B__carbon_thunk(%this.param: %X, %a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @X.C(%a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C__carbon_thunk(%a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @X.D(%self.param: %X, %a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @D__carbon_thunk(%_.param: %ptr.ca1, %a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @X.cpp_destructor(%self.param: ref %X) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @X.Op(%self.param: ref %X) [thunk imports.%X.cpp_destructor.decl for imports.%Destroy.WithSelf.Op.decl, @Destroy.WithSelf.Op(constants.%Destroy.facet.761)] {
|
||||
@@ -861,6 +853,14 @@ fn Call() {
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @X.C(%a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C__carbon_thunk(%a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @X.D(%self.param: %X, %a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @D__carbon_thunk(%_.param: %ptr.ca1, %a.param: %i32);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_call_too_few_args.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -877,13 +877,13 @@ fn Call() {
|
||||
// CHECK:STDOUT: %X.B.cpp_overload_set.type: type = cpp_overload_set_type @X.B.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %bound_method.f8c: <bound method> = bound_method %.414, %X.B.cpp_overload_set.value [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %X.D.cpp_overload_set.type: type = cpp_overload_set_type @X.D.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %bound_method.9a8: <bound method> = bound_method %.414, %X.D.cpp_overload_set.value [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -897,13 +897,13 @@ fn Call() {
|
||||
// CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.value: %GlobalReturnInt.cpp_overload_set.type = cpp_overload_set_value @GlobalReturnInt.cpp_overload_set [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
|
||||
// CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete = constants.%X.B.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete = constants.%X.D.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete = constants.%X.D.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Call() {
|
||||
@@ -927,6 +927,8 @@ fn Call() {
|
||||
// CHECK:STDOUT: %.loc56_7.2: ref %X = temporary %.loc56_5.2, %.loc56_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc56: <bound method> = bound_method %.loc56_7.2, %B.ref [concrete = constants.%bound_method.f8c]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Op.ref.loc56: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc66: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc66: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
@@ -939,9 +941,7 @@ fn Call() {
|
||||
// CHECK:STDOUT: %.loc76_7.2: ref %X = temporary %.loc76_5.2, %.loc76_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc76: <bound method> = bound_method %.loc76_7.2, %D.ref [concrete = constants.%bound_method.9a8]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Op.ref.loc76: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: %Op.ref.loc56: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -1993,14 +1993,14 @@ fn F() {
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.243: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.0c8, %ImplicitAs.facet.424) [concrete]
|
||||
// CHECK:STDOUT: %.954: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.243, %ImplicitAs.facet.424 [concrete]
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %U.as_type.as.ImplicitAs.impl.Convert.593, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.0d5, %OptionalAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc11_14.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.9f1 = value_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %Indirect.cpp_overload_set.type: type = cpp_overload_set_type @Indirect.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Indirect.cpp_overload_set.value: %Indirect.cpp_overload_set.type = cpp_overload_set_value @Indirect.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Indirect__carbon_thunk.type: type = fn_type @Indirect__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %Indirect__carbon_thunk: %Indirect__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.a94: ref %S = temporary invalid, %S.val [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc13_65.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -2048,6 +2048,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.cf7 = impl_witness_table (%Core.import_ref.eb9), @U.as_type.as.ImplicitAs.impl.167 [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.017d8: @T.as_type.as.OptionalAs.impl.%T.as_type.as.OptionalAs.impl.Convert.type (%T.as_type.as.OptionalAs.impl.Convert.type.774) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.OptionalAs.impl.%T.as_type.as.OptionalAs.impl.Convert (constants.%T.as_type.as.OptionalAs.impl.Convert.5f9)]
|
||||
// CHECK:STDOUT: %OptionalAs.impl_witness_table.efa = impl_witness_table (%Core.import_ref.017d8), @T.as_type.as.OptionalAs.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: %Indirect.cpp_overload_set.value: %Indirect.cpp_overload_set.type = cpp_overload_set_value @Indirect.cpp_overload_set [concrete = constants.%Indirect.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Indirect__carbon_thunk.decl: %Indirect__carbon_thunk.type = fn_decl @Indirect__carbon_thunk [concrete = constants.%Indirect__carbon_thunk] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -2057,7 +2058,6 @@ fn F() {
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.0d5) [concrete = constants.%Optional.0c8]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
@@ -2090,6 +2090,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc11_14.3: ref %Optional.0c8 = temporary %.loc11_14.2, %.loc11_14.1
|
||||
// CHECK:STDOUT: %.loc11_14.4: %Optional.0c8 = acquire_value %.loc11_14.3
|
||||
// CHECK:STDOUT: %Direct.call: init %Optional.0c8 = call imports.%Direct.decl(%.loc11_14.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc11: <bound method> = bound_method %.loc11_14.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_14.3)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13_41: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Indirect.ref: %Indirect.cpp_overload_set.type = name_ref Indirect, imports.%Indirect.cpp_overload_set.value [concrete = constants.%Indirect.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc13_55.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
@@ -2122,24 +2124,22 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc13: <bound method> = bound_method %.loc13_65.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_65.2)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc11: <bound method> = bound_method %.loc11_14.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc11: init %empty_tuple.type = call %Destroy.Op.bound.loc11(%.loc11_14.3)
|
||||
// CHECK:STDOUT: %S.cpp_destructor.bound: <bound method> = bound_method %s.var, constants.%S.cpp_destructor
|
||||
// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc13_65.1(%self.param: ref %.08a0) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_14.1(%self.param: ref %.08a0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc13_65.2(%self.param: ref %MaybeUnformed.9f2) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_14.2(%self.param: ref %MaybeUnformed.9f2) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc13_65.3(%self.param: ref %Optional.0c8) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_14.3(%self.param: ref %Optional.0c8) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -122,12 +122,12 @@ fn Var() {
|
||||
// CHECK:STDOUT: %foo1__carbon_thunk.type: type = fn_type @foo1__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %foo1__carbon_thunk: %foo1__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc11_22.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo2.cpp_overload_set.type: type = cpp_overload_set_type @foo2.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo2.cpp_overload_set.value: %foo2.cpp_overload_set.type = cpp_overload_set_value @foo2.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo2.type: type = fn_type @foo2 [concrete]
|
||||
// CHECK:STDOUT: %foo2: %foo2.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc11_22.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -162,6 +162,8 @@ fn Var() {
|
||||
// CHECK:STDOUT: %.loc11_22.3: ref %i16 = temporary %.loc11_22.1, %.loc11_22.2
|
||||
// CHECK:STDOUT: %.loc11_22.4: %i16 = acquire_value %.loc11_22.3
|
||||
// CHECK:STDOUT: %IngestI16.call: init %empty_tuple.type = call %IngestI16.ref(%.loc11_22.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc11_22.3, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_22.3)
|
||||
// CHECK:STDOUT: %IngestI32.ref: %IngestI32.type = name_ref IngestI32, file.%IngestI32.decl [concrete = constants.%IngestI32]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo2.ref: %foo2.cpp_overload_set.type = name_ref foo2, imports.%foo2.cpp_overload_set.value [concrete = constants.%foo2.cpp_overload_set.value]
|
||||
@@ -169,8 +171,6 @@ fn Var() {
|
||||
// CHECK:STDOUT: %.loc12_22.1: %i32 = value_of_initializer %foo2.call
|
||||
// CHECK:STDOUT: %.loc12_22.2: %i32 = converted %foo2.call, %.loc12_22.1
|
||||
// CHECK:STDOUT: %IngestI32.call: init %empty_tuple.type = call %IngestI32.ref(%.loc12_22.2)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc11_22.3, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_22.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -548,6 +548,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) {
|
||||
// CHECK:STDOUT: %result.patt.488: %pattern_type.785 = at_binding_pattern result, %result.param_patt.be6 [concrete]
|
||||
// CHECK:STDOUT: %y.param_patt.418: %pattern_type.785 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %y.patt.4e6: %pattern_type.785 = at_binding_pattern y, %y.param_patt.418 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.9d5: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.2cc) [concrete]
|
||||
// CHECK:STDOUT: %.6da: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.9d5, %Destroy.facet.2cc [concrete]
|
||||
// CHECK:STDOUT: %facet_type.b15: type = facet_type <@Destroy & @SubWith.1, @SubWith.1(%Int16)> [concrete]
|
||||
// CHECK:STDOUT: %.Self.415: %facet_type.b15 = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %SubWith.lookup_impl_witness.266: <witness> = lookup_impl_witness %.Self.415, @SubWith.1, @SubWith.1(%Int16) [symbolic_self]
|
||||
@@ -760,6 +762,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) {
|
||||
// CHECK:STDOUT: %result.patt.830: %pattern_type.8b4 = at_binding_pattern result, %result.param_patt.e81 [concrete]
|
||||
// CHECK:STDOUT: %y.param_patt.e0c: %pattern_type.8b4 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %y.patt.0a3: %pattern_type.8b4 = at_binding_pattern y, %y.param_patt.e0c [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.b76: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.099) [concrete]
|
||||
// CHECK:STDOUT: %.043: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.b76, %Destroy.facet.099 [concrete]
|
||||
// CHECK:STDOUT: %facet_type.44e: type = facet_type <@Destroy & @SubWith.1, @SubWith.1(%Int32)> [concrete]
|
||||
// CHECK:STDOUT: %.Self.8ac: %facet_type.44e = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %SubWith.lookup_impl_witness.f41: <witness> = lookup_impl_witness %.Self.8ac, @SubWith.1, @SubWith.1(%Int32) [symbolic_self]
|
||||
@@ -925,6 +929,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) {
|
||||
// CHECK:STDOUT: %T.patt.f5c: %pattern_type.613 = symbolic_binding_pattern T, 2 [symbolic]
|
||||
// CHECK:STDOUT: %result.param_patt.1e1: %pattern_type.4aa = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %result.patt.41f: %pattern_type.4aa = at_binding_pattern result, %result.param_patt.1e1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.c2c: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.191) [concrete]
|
||||
// CHECK:STDOUT: %.c2e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.c2c, %Destroy.facet.191 [concrete]
|
||||
// CHECK:STDOUT: %facet_type.502: type = facet_type <@Destroy & @SubWith.1, @SubWith.1(%Int64)> [concrete]
|
||||
// CHECK:STDOUT: %.Self.074: %facet_type.502 = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %SubWith.lookup_impl_witness.0c4: <witness> = lookup_impl_witness %.Self.074, @SubWith.1, @SubWith.1(%Int64) [symbolic_self]
|
||||
@@ -1042,12 +1048,6 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) {
|
||||
// CHECK:STDOUT: %facet_value.20a: %facet_type.546 = facet_value %Int64, (%custom_witness.e7a31c.3, %custom_witness.e66) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.5db: type = pattern_type %facet_type.546 [concrete]
|
||||
// CHECK:STDOUT: %T.patt.ed0: %pattern_type.5db = symbolic_binding_pattern T, 2 [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.c2c: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.191) [concrete]
|
||||
// CHECK:STDOUT: %.c2e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.c2c, %Destroy.facet.191 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.b76: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.099) [concrete]
|
||||
// CHECK:STDOUT: %.043: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.b76, %Destroy.facet.099 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.9d5: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.2cc) [concrete]
|
||||
// CHECK:STDOUT: %.6da: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.9d5, %Destroy.facet.2cc [concrete]
|
||||
// CHECK:STDOUT: %U.patt.d47: %pattern_type.98f = symbolic_binding_pattern U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %U.67d: type = symbolic_binding U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %AddAssignWith.type.2c8890.1: type = facet_type <@AddAssignWith.1, @AddAssignWith.1(%Other)> [symbolic]
|
||||
|
||||
@@ -108,6 +108,11 @@ fn F() {
|
||||
// CHECK:STDOUT: %Consume__carbon_thunk: %Consume__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.type.0fbcd7.2: type = fn_type @initializer_list.initializer_list.loc10 [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.0db5f6.2: %initializer_list.initializer_list.type.0fbcd7.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.type: type = fn_type @initializer_list.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor: %initializer_list.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_23.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.981, %Destroy.Op.1a2547.4 [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor: type = class_type @InitListConstructor [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.ed6: type = pattern_type %InitListConstructor [concrete]
|
||||
// CHECK:STDOUT: %_.patt.100: %pattern_type.ed6 = value_binding_pattern _ [concrete]
|
||||
@@ -118,11 +123,6 @@ fn F() {
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.0db5f6.3: %initializer_list.initializer_list.type.0fbcd7.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor.cpp_destructor.type: type = fn_type @InitListConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor.cpp_destructor: %InitListConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.type: type = fn_type @initializer_list.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor: %initializer_list.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc12_44.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.981, %Destroy.Op.1a2547.4 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -296,6 +296,9 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc10_23.20: ref %initializer_list = value_as_ref %.loc10_23.19
|
||||
// CHECK:STDOUT: %addr.loc10: %ptr.fac = addr_of %.loc10_23.20
|
||||
// CHECK:STDOUT: %Consume__carbon_thunk.call: init %empty_tuple.type = call imports.%Consume__carbon_thunk.decl(%addr.loc10)
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc10: <bound method> = bound_method %.loc10_23.18, constants.%initializer_list.cpp_destructor
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc10: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc10(%.loc10_23.18)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.981)
|
||||
// CHECK:STDOUT: %int_1.loc12_37: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc12_40: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3.loc12_43: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
@@ -362,9 +365,6 @@ fn F() {
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc12: <bound method> = bound_method %.loc12_44.19, constants.%initializer_list.cpp_destructor
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc12: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc12(%.loc12_44.19)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc12: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.981)
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc10: <bound method> = bound_method %.loc10_23.18, constants.%initializer_list.cpp_destructor
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc10: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc10(%.loc10_23.18)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.981)
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_50.18, constants.%initializer_list.cpp_destructor
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc8: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc8(%.loc8_50.18)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.981)
|
||||
@@ -375,17 +375,17 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @initializer_list.initializer_list.loc10(%_.param: %array_type) -> out %return.param: %initializer_list = "cpp.std.initializer_list.make";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_23.1(%self.param: ref %i32.builtin) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_23.2(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_23.3(%self.param: ref %array_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @initializer_list.initializer_list.loc12(%_.param: %array_type) -> out %return.param: %initializer_list = "cpp.std.initializer_list.make";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc12_44.1(%self.param: ref %i32.builtin) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc12_44.2(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc12_44.3(%self.param: ref %array_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/lifetime.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/lifetime.carbon
|
||||
|
||||
// --- extend.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class A { fn Clone() -> Self; }
|
||||
|
||||
fn G();
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// All of these A temporaries get lifetime-extended.
|
||||
let unused a: A = ({} as A, {} as A).1;
|
||||
let unused b: A = ({} as A).Clone();
|
||||
G();
|
||||
// Four A objects are destroyed here.
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- extend.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9ef: type = pattern_type %A [concrete]
|
||||
// CHECK:STDOUT: %A.Clone.type: type = fn_type @A.Clone [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %A.Clone: %A.Clone.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.9ef = value_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %A.val: %A = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.777: type = tuple_type (%A, %A) [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.777 = tuple_value (%A.val, %A.val) [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %.367: ref %A = temporary invalid, %A.val [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.9ef = value_binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc11_37.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.367, %Destroy.Op.1a2547.2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc10_23.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %A.ref.loc10_28: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %.loc10_23.2: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_23.3: init %A to %.loc10_23.2 = class_init () [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc10_25.1: init %A = converted %.loc10_23.1, %.loc10_23.3 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc10_32.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %A.ref.loc10_37: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %.loc10_32.2: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_32.3: init %A to %.loc10_32.2 = class_init () [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc10_34.1: init %A = converted %.loc10_32.1, %.loc10_32.3 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc10_38.1: %tuple.type.777 = tuple_literal (%.loc10_25.1, %.loc10_34.1) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc10_25.2: ref %A = temporary %.loc10_23.2, %.loc10_25.1 [concrete = constants.%.367]
|
||||
// CHECK:STDOUT: %.loc10_25.3: %A = acquire_value %.loc10_25.2 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc10_34.2: ref %A = temporary %.loc10_32.2, %.loc10_34.1 [concrete = constants.%.367]
|
||||
// CHECK:STDOUT: %.loc10_34.3: %A = acquire_value %.loc10_34.2 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.777 = tuple_value (%.loc10_25.3, %.loc10_34.3) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc10_38.2: %tuple.type.777 = converted %.loc10_38.1, %tuple [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %tuple.elem1: %A = tuple_access %.loc10_38.2, element1 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %A.ref.loc10_17: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %a: %A = wrapper_binding a, %tuple.elem1
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.9ef = value_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc11_23.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %A.ref.loc11_28: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %.loc11_23.2: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %.loc11_23.3: init %A to %.loc11_23.2 = class_init () [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc11_25.1: init %A = converted %.loc11_23.1, %.loc11_23.3 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc11_25.2: ref %A = temporary %.loc11_23.2, %.loc11_25.1 [concrete = constants.%.367]
|
||||
// CHECK:STDOUT: %Clone.ref: %A.Clone.type = name_ref Clone, @A.%A.Clone.decl [concrete = constants.%A.Clone]
|
||||
// CHECK:STDOUT: %.loc11_37.1: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %A.Clone.call: init %A to %.loc11_37.1 = call %Clone.ref()
|
||||
// CHECK:STDOUT: %.loc11_37.2: ref %A = temporary %.loc11_37.1, %A.Clone.call
|
||||
// CHECK:STDOUT: %.loc11_37.3: %A = acquire_value %.loc11_37.2
|
||||
// CHECK:STDOUT: %A.ref.loc11_17: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %b: %A = wrapper_binding b, %.loc11_37.3
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.9ef = value_binding_pattern b [concrete = constants.%b.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref()
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc11_37.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc11_37: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_37.2)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc11_25: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.367)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc10_34: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.367)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc10_25: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.367)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_37.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc11_37.2(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -172,6 +172,9 @@ fn Run() {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.821: type = pattern_type %A [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc7_11.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.821 = ref_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.821 = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete]
|
||||
@@ -183,15 +186,12 @@ fn Run() {
|
||||
// CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.c80: %T.as.DefaultOrUnformed.impl.Op.type.1ef = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %A, (%DefaultOrUnformed.impl_witness.776) [concrete]
|
||||
// CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: <specific function> = specific_function %T.as.DefaultOrUnformed.impl.Op.c80, @T.as.DefaultOrUnformed.impl.Op(%A) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc10_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .DefaultOrUnformed = %Core.DefaultOrUnformed
|
||||
// CHECK:STDOUT: .Destroy = %Core.Destroy
|
||||
// CHECK:STDOUT: .DefaultOrUnformed = %Core.DefaultOrUnformed
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -204,6 +204,7 @@ fn Run() {
|
||||
// CHECK:STDOUT: %Other.F: %F.type = import_ref Other//b, F, loaded [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %Other.import_ref.8db: <witness> = import_ref Other//b, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: %Other.import_ref.975 = import_ref Other//b, inst{{[0-9A-F]+}} [indirect], unloaded
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: %Other.NS1: <namespace> = import_ref Other//b, NS1, loaded
|
||||
// CHECK:STDOUT: %NS1.acfa4a.2: <namespace> = namespace %Other.NS1, [concrete] {
|
||||
// CHECK:STDOUT: .A = %Other.A
|
||||
@@ -214,7 +215,6 @@ fn Run() {
|
||||
// CHECK:STDOUT: %Core.DefaultOrUnformed: type = import_ref Core//prelude/parts/default, DefaultOrUnformed, loaded [concrete = constants.%DefaultOrUnformed.type]
|
||||
// CHECK:STDOUT: %Core.import_ref.cc8: @T.as.DefaultOrUnformed.impl.%T.as.DefaultOrUnformed.impl.Op.type (%T.as.DefaultOrUnformed.impl.Op.type.150) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as.DefaultOrUnformed.impl.%T.as.DefaultOrUnformed.impl.Op (constants.%T.as.DefaultOrUnformed.impl.Op.53a)]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.374 = impl_witness_table (%Core.import_ref.cc8), @T.as.DefaultOrUnformed.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -242,6 +242,8 @@ fn Run() {
|
||||
// CHECK:STDOUT: %.loc7_11.1: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %F.call.loc7: init %A to %.loc7_11.1 = call %F.ref.loc7()
|
||||
// CHECK:STDOUT: %.loc7_11.2: ref %A = temporary %.loc7_11.1, %F.call.loc7
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc7: <bound method> = bound_method %.loc7_11.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%.loc7_11.2)
|
||||
// CHECK:STDOUT: %a.var: ref %A = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value constants.%A, (constants.%DefaultOrUnformed.impl_witness.776) [concrete = constants.%DefaultOrUnformed.facet]
|
||||
// CHECK:STDOUT: %.loc10_21.1: %DefaultOrUnformed.type = converted constants.%A, %DefaultOrUnformed.facet [concrete = constants.%DefaultOrUnformed.facet]
|
||||
@@ -269,16 +271,14 @@ fn Run() {
|
||||
// CHECK:STDOUT: assign %a.ref, %F.call.loc13
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc10: <bound method> = bound_method %a.var, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%a.var)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc7: <bound method> = bound_method %.loc7_11.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%.loc7_11.2)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F [from "b.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc7_11.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc7_11.2(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -112,11 +112,11 @@ fn Test() {
|
||||
// CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Source.specific_fn.ca6: <specific function> = specific_function %Source, @Source(%X) [concrete]
|
||||
// CHECK:STDOUT: %.094: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.6bb, %ImplicitAs.facet.1cb [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc34_20.4 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Source.specific_fn.75e: <specific function> = specific_function %Source, @Source(%i32) [concrete]
|
||||
// CHECK:STDOUT: %.015: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.9de, %ImplicitAs.facet.474 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc35_20.4 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -328,6 +328,8 @@ fn Test() {
|
||||
// CHECK:STDOUT: %.loc34_20.4: %i32 = value_of_initializer %X.as.ImplicitAs.impl.Convert.call
|
||||
// CHECK:STDOUT: %.loc34_20.5: %i32 = converted %Source.call.loc34, %.loc34_20.4
|
||||
// CHECK:STDOUT: %Sink_i32.call: init %empty_tuple.type = call %Sink_i32.ref(%.loc34_20.5)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc34: <bound method> = bound_method %.loc34_20.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_20.2)
|
||||
// CHECK:STDOUT: %Sink_X.ref: %Sink_X.type = name_ref Sink_X, file.%Sink_X.decl [concrete = constants.%Sink_X]
|
||||
// CHECK:STDOUT: %Source.ref.loc35: %Source.type = name_ref Source, file.%Source.decl [concrete = constants.%Source]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
@@ -345,24 +347,22 @@ fn Test() {
|
||||
// CHECK:STDOUT: %Sink_X.call: init %empty_tuple.type = call %Sink_X.ref(%.loc35_20.6)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc35: <bound method> = bound_method %.loc35_20.5, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc35: init %empty_tuple.type = call %Destroy.Op.bound.loc35(%.loc35_20.5)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc34: <bound method> = bound_method %.loc34_20.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc34: init %empty_tuple.type = call %Destroy.Op.bound.loc34(%.loc34_20.2)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc35_20.1(%self.param: ref %i32.builtin) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc34_20.1(%self.param: ref %i32.builtin) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc35_20.2(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc34_20.2(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc35_20.3(%self.param: ref %struct_type.n) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc34_20.3(%self.param: ref %struct_type.n) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc35_20.4(%self.param: ref %X) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc34_20.4(%self.param: ref %X) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/lifetime.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/lifetime.carbon
|
||||
|
||||
// --- extend.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class A {
|
||||
fn Clone() -> Self;
|
||||
impl as Core.Copy {
|
||||
fn Op(self) -> Self;
|
||||
}
|
||||
}
|
||||
|
||||
fn G();
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// All of these A temporaries get lifetime-extended.
|
||||
var unused a: A = ({} as A, {} as A).1;
|
||||
var unused b: A = ({} as A).Clone();
|
||||
G();
|
||||
// TODO: Four A objects should be destroyed here.
|
||||
// For now, we create five A objects, because we copy from (...).1.
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- extend.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9ef: type = pattern_type %A [concrete]
|
||||
// CHECK:STDOUT: %A.Clone.type: type = fn_type @A.Clone [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %A.Clone: %A.Clone.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Copy.impl_witness.7c4: <witness> = impl_witness @A.as.Copy.impl.%Copy.impl_witness_table [concrete]
|
||||
// CHECK:STDOUT: %A.as.Copy.impl.Op.type: type = fn_type @A.as.Copy.impl.Op [concrete]
|
||||
// CHECK:STDOUT: %A.as.Copy.impl.Op: %A.as.Copy.impl.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %A, (%Copy.impl_witness.7c4) [concrete]
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.573: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.9ef = ref_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.9ef = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %A.val: %A = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.777: type = tuple_type (%A, %A) [concrete]
|
||||
// CHECK:STDOUT: %tuple.cc9: %tuple.type.777 = tuple_value (%A.val, %A.val) [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %.367: ref %A = temporary invalid, %A.val [concrete]
|
||||
// CHECK:STDOUT: %.b68: type = fn_type_with_self_type %Copy.WithSelf.Op.type.573, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %A.as.Copy.impl.Op.bound: <bound method> = bound_method %A.val, %A.as.Copy.impl.Op [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.9ef = ref_binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.9ef = var_pattern %b.patt [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc16_25.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.367, %Destroy.Op.1a2547.2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.var: ref %A = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %.loc15_23.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %A.ref.loc15_28: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %.loc15_23.2: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %.loc15_23.3: init %A to %.loc15_23.2 = class_init () [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc15_25.1: init %A = converted %.loc15_23.1, %.loc15_23.3 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc15_32.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %A.ref.loc15_37: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %.loc15_32.2: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %.loc15_32.3: init %A to %.loc15_32.2 = class_init () [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc15_34.1: init %A = converted %.loc15_32.1, %.loc15_32.3 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc15_38.1: %tuple.type.777 = tuple_literal (%.loc15_25.1, %.loc15_34.1) [concrete = constants.%tuple.cc9]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc15_25.2: ref %A = temporary %.loc15_23.2, %.loc15_25.1 [concrete = constants.%.367]
|
||||
// CHECK:STDOUT: %.loc15_25.3: %A = acquire_value %.loc15_25.2 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc15_34.2: ref %A = temporary %.loc15_32.2, %.loc15_34.1 [concrete = constants.%.367]
|
||||
// CHECK:STDOUT: %.loc15_34.3: %A = acquire_value %.loc15_34.2 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.777 = tuple_value (%.loc15_25.3, %.loc15_34.3) [concrete = constants.%tuple.cc9]
|
||||
// CHECK:STDOUT: %.loc15_38.2: %tuple.type.777 = converted %.loc15_38.1, %tuple [concrete = constants.%tuple.cc9]
|
||||
// CHECK:STDOUT: %tuple.elem1: %A = tuple_access %.loc15_38.2, element1 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %impl.elem0: %.b68 = impl_witness_access constants.%Copy.impl_witness.7c4, element0 [concrete = constants.%A.as.Copy.impl.Op]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %tuple.elem1, %impl.elem0 [concrete = constants.%A.as.Copy.impl.Op.bound]
|
||||
// CHECK:STDOUT: %.loc15_3: ref %A = splice_block %a.var {}
|
||||
// CHECK:STDOUT: %A.as.Copy.impl.Op.call: init %A to %.loc15_3 = call %bound_method(%tuple.elem1)
|
||||
// CHECK:STDOUT: assign %a.var, %A.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: %A.ref.loc15_17: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %a: ref %A = wrapper_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.9ef = ref_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.9ef = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %A = var_storage %b.var_patt
|
||||
// CHECK:STDOUT: %.loc16_23.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %A.ref.loc16_28: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %.loc16_23.2: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %.loc16_23.3: init %A to %.loc16_23.2 = class_init () [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc16_25.1: init %A = converted %.loc16_23.1, %.loc16_23.3 [concrete = constants.%A.val]
|
||||
// CHECK:STDOUT: %.loc16_25.2: ref %A = temporary %.loc16_23.2, %.loc16_25.1 [concrete = constants.%.367]
|
||||
// CHECK:STDOUT: %Clone.ref: %A.Clone.type = name_ref Clone, @A.%A.Clone.decl [concrete = constants.%A.Clone]
|
||||
// CHECK:STDOUT: %.loc16_3: ref %A = splice_block %b.var {}
|
||||
// CHECK:STDOUT: %A.Clone.call: init %A to %.loc16_3 = call %Clone.ref()
|
||||
// CHECK:STDOUT: assign %b.var, %A.Clone.call
|
||||
// CHECK:STDOUT: %A.ref.loc16_17: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %b: ref %A = wrapper_binding b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.9ef = ref_binding_pattern b [concrete = constants.%b.patt]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.9ef = var_pattern %b.patt [concrete = constants.%b.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref()
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc16_25: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.367)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc16: <bound method> = bound_method %b.var, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc16_3: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%b.var)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc15_34: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.367)
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc15_25: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.367)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound.loc15: <bound method> = bound_method %a.var, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call.loc15_3: init %empty_tuple.type = call %Destroy.Op.bound.loc15(%a.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc16_25.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc16_25.2(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/bool.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/while/lifetime.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/lifetime.carbon
|
||||
|
||||
// --- condition_lifetime.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class A {
|
||||
fn F() -> bool;
|
||||
}
|
||||
|
||||
fn Make() -> A;
|
||||
|
||||
fn G();
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// The temporary A object is destroyed before the branch.
|
||||
while (Make().F()) {
|
||||
G();
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- condition_lifetime.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %A.F.type: type = fn_type @A.F [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %A.F: %A.F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete]
|
||||
// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc14_15.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: br !while.cond
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !while.cond:
|
||||
// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
|
||||
// CHECK:STDOUT: %.loc14_15.1: ref %A = temporary_storage
|
||||
// CHECK:STDOUT: %Make.call: init %A to %.loc14_15.1 = call %Make.ref()
|
||||
// CHECK:STDOUT: %.loc14_15.2: ref %A = temporary %.loc14_15.1, %Make.call
|
||||
// CHECK:STDOUT: %F.ref: %A.F.type = name_ref F, @A.%A.F.decl [concrete = constants.%A.F]
|
||||
// CHECK:STDOUT: %A.F.call: init bool = call %F.ref()
|
||||
// CHECK:STDOUT: %.loc14_20.1: bool = value_of_initializer %A.F.call
|
||||
// CHECK:STDOUT: %.loc14_20.2: bool = converted %A.F.call, %.loc14_20.1
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc14_15.2, constants.%Destroy.Op.1a2547.2
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc14_15.2)
|
||||
// CHECK:STDOUT: if %.loc14_20.2 br !while.body else br !while.done
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !while.body:
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref()
|
||||
// CHECK:STDOUT: br !while.cond
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !while.done:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc14_15.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc14_15.2(%self.param: ref %A) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+5
-5
@@ -70,6 +70,7 @@ fn Test() {
|
||||
// CHECK:STDOUT: %MakePointerPointer.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 8, !dbg !15
|
||||
// CHECK:STDOUT: store ptr getelementptr inbounds ([4 x i32], ptr @array.loc25_52.18, i32 1), ptr %MakePointerPointer.call.init_list.end, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @_CTakePointerPointer.Main(ptr %.loc25_53.1.temp), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr @array), !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_47.1.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_46.3.temp), !dbg !18
|
||||
// CHECK:STDOUT: %.loc26_46.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 0, !dbg !18
|
||||
@@ -82,7 +83,6 @@ fn Test() {
|
||||
// CHECK:STDOUT: store i64 4, ptr %MakePointerSize.call.init_list.size, align 8, !dbg !17
|
||||
// CHECK:STDOUT: call void @_CTakePointerSize.Main(ptr %.loc26_47.1.temp), !dbg !20
|
||||
// CHECK:STDOUT: call void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr @array), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr @array), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -134,18 +134,18 @@ fn Test() {
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 25, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 26, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 26, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26)
|
||||
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 25, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26)
|
||||
// CHECK:STDOUT: !23 = !DISubroutineType(types: !24)
|
||||
// CHECK:STDOUT: !24 = !{null, !25}
|
||||
// CHECK:STDOUT: !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !26 = !{!27}
|
||||
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !22, type: !25)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 26, column: 35, scope: !22)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8ab5ebc4f407c395:core.Destroy.Core", scope: null, file: !1, line: 26, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 25, column: 41, scope: !22)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8ab5ebc4f407c395:core.Destroy.Core", scope: null, file: !1, line: 25, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33)
|
||||
// CHECK:STDOUT: !30 = !DISubroutineType(types: !31)
|
||||
// CHECK:STDOUT: !31 = !{null, !32}
|
||||
// CHECK:STDOUT: !32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !33 = !{!34}
|
||||
// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !29, type: !32)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 26, column: 35, scope: !29)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 25, column: 41, scope: !29)
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -23,8 +23,6 @@ fn G();
|
||||
|
||||
fn CallF() {
|
||||
F({});
|
||||
// TODO: The `C` instance is destroyed after the call to `G()`, and
|
||||
// should be destroyed before.
|
||||
G();
|
||||
}
|
||||
|
||||
@@ -41,8 +39,6 @@ fn G();
|
||||
|
||||
fn CallF() {
|
||||
F({});
|
||||
// TODO: The `C` instance is destroyed after the call to `G()`, and
|
||||
// should be destroyed before.
|
||||
G();
|
||||
}
|
||||
|
||||
@@ -93,8 +89,8 @@ fn InitLet() {
|
||||
// CHECK:STDOUT: %.loc12_6.2.temp = alloca {}, align 1, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_6.2.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_CF.Main(ptr @C.val.loc12_6.6), !dbg !15
|
||||
// CHECK:STDOUT: call void @_CG.Main(), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr @C.val), !dbg !14
|
||||
// CHECK:STDOUT: call void @_CG.Main(), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -129,7 +125,7 @@ fn InitLet() {
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 12, column: 5, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 12, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 11, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19)
|
||||
// CHECK:STDOUT: !19 = !{!20}
|
||||
@@ -157,8 +153,8 @@ fn InitLet() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var, ptr align 1 @C.val.loc6, i64 0, i1 false), !dbg !14
|
||||
// CHECK:STDOUT: call void @_CF.Main(ptr %_.var), !dbg !15
|
||||
// CHECK:STDOUT: call void @_CG.Main(), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %_.var), !dbg !14
|
||||
// CHECK:STDOUT: call void @_CG.Main(), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -196,7 +192,7 @@ fn InitLet() {
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 6, column: 6, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 12, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 15, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 11, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 6, type: !5, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19)
|
||||
// CHECK:STDOUT: !19 = !{!20}
|
||||
|
||||
+22
-20
@@ -24,6 +24,8 @@ fn Call() {
|
||||
OneVar_i32(1);
|
||||
OneVar_X({});
|
||||
TwoVars(1, {});
|
||||
// TODO: This passes a global as the `X` parameter, then destroys a different
|
||||
// `X` global. We shouldn't be calling Destroy on a global.
|
||||
VarThenLet(1, {});
|
||||
LetThenVar(1, {});
|
||||
}
|
||||
@@ -73,44 +75,44 @@ fn Call() {
|
||||
// CHECK:STDOUT: %_.var.loc18_12 = alloca i32, align 4, !dbg !40
|
||||
// CHECK:STDOUT: %_.var.loc18_24 = alloca {}, align 1, !dbg !41
|
||||
// CHECK:STDOUT: %_.var.loc20 = alloca i32, align 4, !dbg !42
|
||||
// CHECK:STDOUT: %.loc27_18.2.temp = alloca {}, align 1, !dbg !43
|
||||
// CHECK:STDOUT: %.loc29_18.2.temp = alloca {}, align 1, !dbg !43
|
||||
// CHECK:STDOUT: %_.var.loc21 = alloca {}, align 1, !dbg !44
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc15), !dbg !38
|
||||
// CHECK:STDOUT: store i32 1, ptr %_.var.loc15, align 4, !dbg !38
|
||||
// CHECK:STDOUT: call void @_COneVar_i32.Main(ptr %_.var.loc15), !dbg !45
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.loc15), !dbg !38
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc16), !dbg !39
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc16, ptr align 1 @X.val.loc16, i64 0, i1 false), !dbg !39
|
||||
// CHECK:STDOUT: call void @_COneVar_X.Main(ptr %_.var.loc16), !dbg !46
|
||||
// CHECK:STDOUT: call void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr %_.var.loc16), !dbg !39
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18_12), !dbg !40
|
||||
// CHECK:STDOUT: store i32 1, ptr %_.var.loc18_12, align 4, !dbg !40
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18_24), !dbg !41
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc18_24, ptr align 1 @X.val.loc16, i64 0, i1 false), !dbg !41
|
||||
// CHECK:STDOUT: call void @_CTwoVars.Main(ptr %_.var.loc18_12, ptr %_.var.loc18_24), !dbg !47
|
||||
// CHECK:STDOUT: call void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr %_.var.loc18_24), !dbg !41
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.loc18_12), !dbg !40
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc20), !dbg !42
|
||||
// CHECK:STDOUT: store i32 1, ptr %_.var.loc20, align 4, !dbg !42
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_18.2.temp), !dbg !43
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_18.2.temp), !dbg !43
|
||||
// CHECK:STDOUT: call void @_CVarThenLet.Main(ptr %_.var.loc20, ptr @X.val.loc16), !dbg !48
|
||||
// CHECK:STDOUT: call void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr @X.val), !dbg !43
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.loc20), !dbg !42
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc21), !dbg !44
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc21, ptr align 1 @X.val.loc16, i64 0, i1 false), !dbg !44
|
||||
// CHECK:STDOUT: call void @_CLetThenVar.Main(i32 1, ptr %_.var.loc21), !dbg !49
|
||||
// CHECK:STDOUT: call void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr %_.var.loc21), !dbg !44
|
||||
// CHECK:STDOUT: call void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr @X.val), !dbg !43
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.loc20), !dbg !42
|
||||
// CHECK:STDOUT: call void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr %_.var.loc18_24), !dbg !41
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.loc18_12), !dbg !40
|
||||
// CHECK:STDOUT: call void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr %_.var.loc16), !dbg !39
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.loc15), !dbg !38
|
||||
// CHECK:STDOUT: ret void, !dbg !50
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr %self) #0 !dbg !51 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !51 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !54
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !55 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.429fc69ea0bf165d:core.Destroy.Core"(ptr %self) #0 !dbg !55 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !58
|
||||
// CHECK:STDOUT: }
|
||||
@@ -122,8 +124,8 @@ fn Call() {
|
||||
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @"_COp.429fc69ea0bf165d:core.Destroy.Core", { 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @"_COp.5e27612b9dd31a14:core.Destroy.Core", { 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @"_COp.429fc69ea0bf165d:core.Destroy.Core", { 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 6, 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
@@ -176,20 +178,20 @@ fn Call() {
|
||||
// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 12, scope: !35)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 18, column: 24, scope: !35)
|
||||
// CHECK:STDOUT: !42 = !DILocation(line: 20, column: 15, scope: !35)
|
||||
// CHECK:STDOUT: !43 = !DILocation(line: 27, column: 17, scope: !35)
|
||||
// CHECK:STDOUT: !43 = !DILocation(line: 29, column: 17, scope: !35)
|
||||
// CHECK:STDOUT: !44 = !DILocation(line: 21, column: 23, scope: !35)
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 24, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 25, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !47 = !DILocation(line: 26, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 27, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 28, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 29, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 30, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 1, scope: !35)
|
||||
// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.429fc69ea0bf165d:core.Destroy.Core", scope: null, file: !1, line: 21, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !52)
|
||||
// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !52)
|
||||
// CHECK:STDOUT: !52 = !{!53}
|
||||
// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !14)
|
||||
// CHECK:STDOUT: !54 = !DILocation(line: 21, column: 23, scope: !51)
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56)
|
||||
// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !7)
|
||||
// CHECK:STDOUT: !54 = !DILocation(line: 15, column: 15, scope: !51)
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.429fc69ea0bf165d:core.Destroy.Core", scope: null, file: !1, line: 16, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56)
|
||||
// CHECK:STDOUT: !56 = !{!57}
|
||||
// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !7)
|
||||
// CHECK:STDOUT: !58 = !DILocation(line: 20, column: 15, scope: !55)
|
||||
// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !14)
|
||||
// CHECK:STDOUT: !58 = !DILocation(line: 16, column: 13, scope: !55)
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -137,6 +137,7 @@ fn M() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.3.temp), !dbg !51
|
||||
// CHECK:STDOUT: %H.call.loc29 = call i32 @_CH.Main.5bd8d5767580997a(i32 %x), !dbg !51
|
||||
// CHECK:STDOUT: store i32 %H.call.loc29, ptr %.loc29_6.3.temp, align 4, !dbg !51
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !51
|
||||
// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.ee509b43cf4eb3c5(%type zeroinitializer), !dbg !60
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !52
|
||||
// CHECK:STDOUT: %G.call = call i32 @_CG.Main.58016a73bff04416(i32 %x), !dbg !52
|
||||
@@ -145,6 +146,8 @@ fn M() {
|
||||
// CHECK:STDOUT: %.loc31_8.5 = load i32, ptr %.loc31_8.3.temp, align 4, !dbg !52
|
||||
// CHECK:STDOUT: %H.call.loc31 = call i32 @_CH.Main.5bd8d5767580997a(i32 %.loc31_8.5), !dbg !53
|
||||
// CHECK:STDOUT: store i32 %H.call.loc31, ptr %.loc31_9.3.temp, align 4, !dbg !53
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !53
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !52
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !54
|
||||
// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !54
|
||||
// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !61
|
||||
@@ -167,9 +170,6 @@ fn M() {
|
||||
// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %.loc43_6.3.temp), !dbg !59
|
||||
// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %c.var), !dbg !58
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %var_f64.var), !dbg !54
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !53
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !52
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !51
|
||||
// CHECK:STDOUT: ret i32 %x, !dbg !69
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -194,6 +194,7 @@ fn M() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.3.temp), !dbg !77
|
||||
// CHECK:STDOUT: %H.call.loc29 = call double @_CH.Main.c27b765f2159c9a0(double %x), !dbg !77
|
||||
// CHECK:STDOUT: store double %H.call.loc29, ptr %.loc29_6.3.temp, align 8, !dbg !77
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !77
|
||||
// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.ee509b43cf4eb3c5(%type zeroinitializer), !dbg !86
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !78
|
||||
// CHECK:STDOUT: %G.call = call double @_CG.Main.fa1f0912a5bbe922(double %x), !dbg !78
|
||||
@@ -202,6 +203,8 @@ fn M() {
|
||||
// CHECK:STDOUT: %.loc31_8.5 = load double, ptr %.loc31_8.3.temp, align 8, !dbg !78
|
||||
// CHECK:STDOUT: %H.call.loc31 = call double @_CH.Main.c27b765f2159c9a0(double %.loc31_8.5), !dbg !79
|
||||
// CHECK:STDOUT: store double %H.call.loc31, ptr %.loc31_9.3.temp, align 8, !dbg !79
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !79
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !78
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !80
|
||||
// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !80
|
||||
// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !87
|
||||
@@ -224,9 +227,6 @@ fn M() {
|
||||
// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %.loc43_6.3.temp), !dbg !85
|
||||
// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %c.var), !dbg !84
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %var_f64.var), !dbg !80
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !79
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !78
|
||||
// CHECK:STDOUT: call void @"_COp.30d8007fdcc57f83:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !77
|
||||
// CHECK:STDOUT: ret double %x, !dbg !95
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -82,8 +82,8 @@ fn M() -> i32 {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_6.3.temp), !dbg !32
|
||||
// CHECK:STDOUT: %H.call = call i32 @_CH.Main.5bd8d5767580997a(i32 %x), !dbg !32
|
||||
// CHECK:STDOUT: store i32 %H.call, ptr %.loc25_6.3.temp, align 4, !dbg !32
|
||||
// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %x), !dbg !33
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc25_6.3.temp), !dbg !32
|
||||
// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %x), !dbg !33
|
||||
// CHECK:STDOUT: ret i32 %x, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -334,10 +334,10 @@ fn F(ref r: Cpp.A) {
|
||||
// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !20
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !19
|
||||
// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !21
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -355,6 +355,12 @@ fn F(ref r: Cpp.A) {
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !30 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr noundef %0, ptr noundef %c) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
@@ -370,12 +376,6 @@ fn F(ref r: Cpp.A) {
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !30 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
@@ -426,13 +426,13 @@ fn F(ref r: Cpp.A) {
|
||||
// CHECK:STDOUT: !27 = !{!"p1 omnipotent char", !25, i64 0}
|
||||
// CHECK:STDOUT: !28 = !{}
|
||||
// CHECK:STDOUT: !29 = !{!10, !10, i64 0}
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34)
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 7, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34)
|
||||
// CHECK:STDOUT: !31 = !DISubroutineType(types: !32)
|
||||
// CHECK:STDOUT: !32 = !{null, !33}
|
||||
// CHECK:STDOUT: !33 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !34 = !{!35}
|
||||
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 14, scope: !30)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 7, column: 14, scope: !30)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'call_with_ref_self.carbon'
|
||||
|
||||
@@ -131,13 +131,13 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.3.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_22.3.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk.____(ptr @int_1.f1e, ptr @int_2.5c2, i32 3, i64 4), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr @int_2.5c2), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr @int_1.067, ptr @int_2.ec3, i32 3, i64 4), !dbg !20
|
||||
// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr @int_2.ec3), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr @int_1.067), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr @int_2.5c2), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -162,6 +162,18 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !39
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !40 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !46
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
@@ -184,25 +196,13 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !39
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !40 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !46
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !47 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !47 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !53
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !54 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !54 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !60
|
||||
// CHECK:STDOUT: }
|
||||
@@ -219,22 +219,22 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !68
|
||||
// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !68
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !68
|
||||
// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !69
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !69
|
||||
// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !69
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !69
|
||||
// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !70
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !70
|
||||
// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !70
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !74
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !70
|
||||
// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !71
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !71
|
||||
// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !71
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !75
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !71
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !70
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !69
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !68
|
||||
// CHECK:STDOUT: ret void, !dbg !76
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -311,40 +311,40 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: !30 = !{!10, !10, i64 0}
|
||||
// CHECK:STDOUT: !31 = !{!32, !32, i64 0}
|
||||
// CHECK:STDOUT: !32 = !{!"short", !10, i64 0}
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !1, line: 9, type: !34, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !1, line: 7, type: !34, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37)
|
||||
// CHECK:STDOUT: !34 = !DISubroutineType(types: !35)
|
||||
// CHECK:STDOUT: !35 = !{null, !36}
|
||||
// CHECK:STDOUT: !36 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !36 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !37 = !{!38}
|
||||
// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !33, type: !36)
|
||||
// CHECK:STDOUT: !39 = !DILocation(line: 9, column: 24, scope: !33)
|
||||
// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !1, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !44)
|
||||
// CHECK:STDOUT: !39 = !DILocation(line: 7, column: 22, scope: !33)
|
||||
// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !44)
|
||||
// CHECK:STDOUT: !41 = !DISubroutineType(types: !42)
|
||||
// CHECK:STDOUT: !42 = !{null, !43}
|
||||
// CHECK:STDOUT: !43 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !43 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !44 = !{!45}
|
||||
// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !40, type: !43)
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 9, column: 21, scope: !40)
|
||||
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !1, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !51)
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 7, column: 19, scope: !40)
|
||||
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !1, line: 9, type: !48, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !51)
|
||||
// CHECK:STDOUT: !48 = !DISubroutineType(types: !49)
|
||||
// CHECK:STDOUT: !49 = !{null, !50}
|
||||
// CHECK:STDOUT: !50 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !50 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !51 = !{!52}
|
||||
// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !47, type: !50)
|
||||
// CHECK:STDOUT: !53 = !DILocation(line: 7, column: 22, scope: !47)
|
||||
// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 7, type: !55, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58)
|
||||
// CHECK:STDOUT: !53 = !DILocation(line: 9, column: 24, scope: !47)
|
||||
// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !1, line: 9, type: !55, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58)
|
||||
// CHECK:STDOUT: !55 = !DISubroutineType(types: !56)
|
||||
// CHECK:STDOUT: !56 = !{null, !57}
|
||||
// CHECK:STDOUT: !57 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !57 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !58 = !{!59}
|
||||
// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !54, type: !57)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 7, column: 19, scope: !54)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 9, column: 21, scope: !54)
|
||||
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !1, line: 16, type: !62, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !65)
|
||||
// CHECK:STDOUT: !62 = !DISubroutineType(types: !63)
|
||||
// CHECK:STDOUT: !63 = !{null, !50, !64}
|
||||
// CHECK:STDOUT: !63 = !{null, !36, !64}
|
||||
// CHECK:STDOUT: !64 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !65 = !{!66, !67}
|
||||
// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !61, type: !50)
|
||||
// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !61, type: !36)
|
||||
// CHECK:STDOUT: !67 = !DILocalVariable(arg: 2, scope: !61, type: !64)
|
||||
// CHECK:STDOUT: !68 = !DILocation(line: 17, column: 18, scope: !61)
|
||||
// CHECK:STDOUT: !69 = !DILocation(line: 18, column: 18, scope: !61)
|
||||
|
||||
+56
-56
@@ -65,23 +65,41 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, ptr %.loc12_18.2.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc12_18.4 = load ptr, ptr %.loc12_18.2.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z7TakePtrPi(ptr %.loc12_18.4), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_22.1.temp), !dbg !16
|
||||
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, ptr %.loc14_22.1.temp, align 8, !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk._(ptr %.loc14_22.1.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z7TakePtrPi(ptr noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.32a070744df634d9:core.Destroy.Core"(ptr %self) #0 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.958634845f762cfe:core.Destroy.Core"(ptr %self) #0 !dbg !27 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !30
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %self) #0 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11TakeNullptrDn.carbon_thunk._(ptr noundef %n) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %n.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !35
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !35
|
||||
// CHECK:STDOUT: call void @_Z11TakeNullptrDn(ptr null)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -89,37 +107,19 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: declare ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d:core.Destroy.Core"(ptr %self) #0 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !29
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %self) #0 !dbg !30 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %self) #0 !dbg !34 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.32a070744df634d9:core.Destroy.Core"(ptr %self) #0 !dbg !38 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d:core.Destroy.Core"(ptr %self) #0 !dbg !38 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !41
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.958634845f762cfe:core.Destroy.Core"(ptr %self) #0 !dbg !42 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %self) #0 !dbg !42 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !45
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %self) #0 !dbg !46 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %self) #0 !dbg !46 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !49
|
||||
// CHECK:STDOUT: }
|
||||
@@ -160,8 +160,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: define internal void @_Z13ReturnNullptrv.carbon_thunk.(ptr noundef %return) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !35
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !35
|
||||
// CHECK:STDOUT: %call = call ptr @_Z13ReturnNullptrv()
|
||||
// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !65
|
||||
// CHECK:STDOUT: ret void
|
||||
@@ -239,39 +239,39 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !{!21, !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 std::nullptr_t", !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d:core.Destroy.Core", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27)
|
||||
// CHECK:STDOUT: !24 = !DISubroutineType(types: !25)
|
||||
// CHECK:STDOUT: !25 = !{null, !26}
|
||||
// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !27 = !{!28}
|
||||
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 14, column: 19, scope: !23)
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31)
|
||||
// CHECK:STDOUT: !31 = !{!32}
|
||||
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !26)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 14, column: 19, scope: !30)
|
||||
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.37a0be3fec6961f4:core.Destroy.Core", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35)
|
||||
// CHECK:STDOUT: !35 = !{!36}
|
||||
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !26)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 14, column: 19, scope: !34)
|
||||
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.32a070744df634d9:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.32a070744df634d9:core.Destroy.Core", scope: null, file: !1, line: 12, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24)
|
||||
// CHECK:STDOUT: !21 = !DISubroutineType(types: !22)
|
||||
// CHECK:STDOUT: !22 = !{null, !23}
|
||||
// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !24 = !{!25}
|
||||
// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 12, column: 15, scope: !20)
|
||||
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.958634845f762cfe:core.Destroy.Core", scope: null, file: !1, line: 12, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28)
|
||||
// CHECK:STDOUT: !28 = !{!29}
|
||||
// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !23)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 12, column: 15, scope: !27)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9a41840f34ccc47a:core.Destroy.Core", scope: null, file: !1, line: 12, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32)
|
||||
// CHECK:STDOUT: !32 = !{!33}
|
||||
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !23)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 12, column: 15, scope: !31)
|
||||
// CHECK:STDOUT: !35 = !{!36, !36, i64 0}
|
||||
// CHECK:STDOUT: !36 = !{!"p1 std::nullptr_t", !37, i64 0}
|
||||
// CHECK:STDOUT: !37 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d:core.Destroy.Core", scope: null, file: !1, line: 14, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39)
|
||||
// CHECK:STDOUT: !39 = !{!40}
|
||||
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !26)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 15, scope: !38)
|
||||
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.958634845f762cfe:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !23)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 14, column: 19, scope: !38)
|
||||
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !1, line: 14, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !43 = !{!44}
|
||||
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !26)
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 12, column: 15, scope: !42)
|
||||
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9a41840f34ccc47a:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !47)
|
||||
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !23)
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 14, column: 19, scope: !42)
|
||||
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.37a0be3fec6961f4:core.Destroy.Core", scope: null, file: !1, line: 14, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !47)
|
||||
// CHECK:STDOUT: !47 = !{!48}
|
||||
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !26)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 12, column: 15, scope: !46)
|
||||
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !23)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 14, column: 19, scope: !46)
|
||||
// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !1, line: 17, type: !51, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !51 = !DISubroutineType(types: !52)
|
||||
// CHECK:STDOUT: !52 = !{!26}
|
||||
// CHECK:STDOUT: !52 = !{!23}
|
||||
// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 10, scope: !50)
|
||||
// CHECK:STDOUT: !54 = !DILocation(line: 18, column: 3, scope: !50)
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !1, line: 21, type: !51, spFlags: DISPFlagDefinition, unit: !0)
|
||||
@@ -294,9 +294,9 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba", scope: null, file: !73, line: 51, type: !74, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !76)
|
||||
// CHECK:STDOUT: !73 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "")
|
||||
// CHECK:STDOUT: !74 = !DISubroutineType(types: !75)
|
||||
// CHECK:STDOUT: !75 = !{!26, !26}
|
||||
// CHECK:STDOUT: !75 = !{!23, !23}
|
||||
// CHECK:STDOUT: !76 = !{!77}
|
||||
// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !72, type: !26)
|
||||
// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !72, type: !23)
|
||||
// CHECK:STDOUT: !78 = !DILocation(line: 52, column: 14, scope: !72)
|
||||
// CHECK:STDOUT: !79 = !DILocation(line: 52, column: 7, scope: !72)
|
||||
// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.0a6122c87ac9ba0f", scope: null, file: !81, line: 30, type: !51, spFlags: DISPFlagDefinition, unit: !0)
|
||||
|
||||
+18
-18
@@ -157,12 +157,12 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.2), !dbg !18
|
||||
// CHECK:STDOUT: store i32 42, ptr %_.var.2, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr %_.var.2), !dbg !24
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.2), !dbg !18
|
||||
// CHECK:STDOUT: %.loc25_23.1 = load i32, ptr %n.var, align 4, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !19
|
||||
// CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !19
|
||||
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr %.loc25_23.2.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.2), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
@@ -217,6 +217,12 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !43
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: entry:
|
||||
@@ -227,12 +233,6 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !43
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #5
|
||||
// CHECK:STDOUT:
|
||||
@@ -305,13 +305,13 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 5, column: 7, scope: !30)
|
||||
// CHECK:STDOUT: !35 = !{!36, !36, i64 0}
|
||||
// CHECK:STDOUT: !36 = !{!"p1 int", !29, i64 0}
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 12, type: !38, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41)
|
||||
// CHECK:STDOUT: !38 = !DISubroutineType(types: !39)
|
||||
// CHECK:STDOUT: !39 = !{null, !40}
|
||||
// CHECK:STDOUT: !40 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !41 = !{!42}
|
||||
// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !37, type: !40)
|
||||
// CHECK:STDOUT: !43 = !DILocation(line: 25, column: 23, scope: !37)
|
||||
// CHECK:STDOUT: !43 = !DILocation(line: 12, column: 23, scope: !37)
|
||||
// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !45, line: 9, type: !31, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !45 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "")
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 9, column: 28, scope: !44)
|
||||
@@ -348,12 +348,12 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !18
|
||||
// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !24
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var), !dbg !18
|
||||
// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !19
|
||||
// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !19
|
||||
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
@@ -429,6 +429,12 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !39 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !45
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
@@ -440,12 +446,6 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !39 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !45
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #4
|
||||
// CHECK:STDOUT:
|
||||
@@ -521,13 +521,13 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: !36 = !{!37, !37, i64 0}
|
||||
// CHECK:STDOUT: !37 = !{!"p1 int", !29, i64 0}
|
||||
// CHECK:STDOUT: !38 = !{i64 4}
|
||||
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 26, type: !40, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 13, type: !40, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !40 = !DISubroutineType(types: !41)
|
||||
// CHECK:STDOUT: !41 = !{null, !42}
|
||||
// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !43 = !{!44}
|
||||
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !39, type: !42)
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 26, column: 23, scope: !39)
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 13, column: 23, scope: !39)
|
||||
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !47, line: 9, type: !31, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !47 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "")
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 9, column: 28, scope: !46)
|
||||
|
||||
@@ -129,10 +129,10 @@ fn CallF() {
|
||||
// CHECK:STDOUT: %temp1 = alloca {}, align 1, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !18
|
||||
// CHECK:STDOUT: %1 = call i123 @_CF.C.Main.e43630e9a6c38c3f(), !dbg !20
|
||||
// CHECK:STDOUT: call void @"_COp.493fde38be547afd:core.Destroy.Core"(ptr @C.val.eeb), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !19
|
||||
// CHECK:STDOUT: %2 = call i456 @_CG.C.Main.e43630e9a6c38c3f(), !dbg !21
|
||||
// CHECK:STDOUT: call void @"_COp.493fde38be547afd:core.Destroy.Core"(ptr @C.val.eeb), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.493fde38be547afd:core.Destroy.Core"(ptr @C.val.eeb), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -167,14 +167,14 @@ fn CallF() {
|
||||
// CHECK:STDOUT: !6 = !{null}
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 9, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !8 = !DILocation(line: 6, column: 1, scope: !4)
|
||||
// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Op", linkageName: "_COp.493fde38be547afd:core.Destroy.Core", scope: null, file: !10, line: 22, type: !11, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !14)
|
||||
// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Op", linkageName: "_COp.493fde38be547afd:core.Destroy.Core", scope: null, file: !10, line: 19, type: !11, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !14)
|
||||
// CHECK:STDOUT: !10 = !DIFile(filename: "require_completion_in_call.carbon", directory: "")
|
||||
// CHECK:STDOUT: !11 = !DISubroutineType(types: !12)
|
||||
// CHECK:STDOUT: !12 = !{null, !13}
|
||||
// CHECK:STDOUT: !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !14 = !{!15}
|
||||
// CHECK:STDOUT: !15 = !DILocalVariable(arg: 1, scope: !9, type: !13)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 22, column: 4, scope: !9)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 19, column: 4, scope: !9)
|
||||
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.e43630e9a6c38c3f", scope: null, file: !10, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 19, column: 4, scope: !17)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 22, column: 4, scope: !17)
|
||||
|
||||
Reference in New Issue
Block a user