Implement checking observe declarations (#6709)

This adds SemIR structs and implements building `observe` lists, as well
as naming, formatting, and importing `observe` declarations.

---------

Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
Özgür T. Önsoy
2026-07-08 17:07:10 +00:00
committed by GitHub
co-authored by Dana Jansens
parent 918bb9364f
commit 08385adeb5
713 changed files with 13013 additions and 13 deletions
+1
View File
@@ -244,6 +244,7 @@ cc_library(
"//common:error",
"//common:find",
"//common:growing_range",
"//common:hashtable_key_context",
"//common:map",
"//common:ostream",
"//common:pretty_stack_trace_function",
+13
View File
@@ -37,6 +37,7 @@
#include "toolchain/sem_ir/import_ir.h"
#include "toolchain/sem_ir/inst.h"
#include "toolchain/sem_ir/name_scope.h"
#include "toolchain/sem_ir/observe.h"
#include "toolchain/sem_ir/specific_interface.h"
#include "toolchain/sem_ir/typed_insts.h"
@@ -131,6 +132,10 @@ class Context {
return require_impls_stack_;
}
auto observe_stack() -> ArrayStack<SemIR::ObserveId>& {
return observe_stack_;
}
auto decl_name_stack() -> DeclNameStack& { return decl_name_stack_; }
auto decl_introducer_state_stack() -> DeclIntroducerStateStack& {
@@ -356,6 +361,10 @@ class Context {
auto require_impls_blocks() -> SemIR::RequireImplsBlockStore& {
return sem_ir().require_impls_blocks();
}
auto observes() -> SemIR::ObserveStore& { return sem_ir().observes(); }
auto observe_blocks() -> SemIR::ObserveBlockStore& {
return sem_ir().observe_blocks();
}
auto associated_constants() -> SemIR::AssociatedConstantStore& {
return sem_ir().associated_constants();
}
@@ -464,6 +473,10 @@ class Context {
// definitions.
RequireImplsStack require_impls_stack_;
// The stack of Observe for in-progress Interface and Function
// definitions.
ArrayStack<SemIR::ObserveId> observe_stack_;
// The stack used for qualified declaration name construction.
DeclNameStack decl_name_stack_;
+6
View File
@@ -458,6 +458,7 @@ auto StartFunctionDefinition(Context& context, SemIR::InstId decl_id,
// Create the function scope and the entry block.
context.scope_stack().PushForFunctionBody(decl_id);
context.inst_block_stack().Push();
context.observe_stack().PushArray();
context.region_stack().PushRegion(context.inst_block_stack().PeekOrAdd());
StartGenericDefinition(context,
context.functions().Get(function_id).generic_id);
@@ -470,8 +471,13 @@ auto FinishFunctionDefinition(Context& context, SemIR::FunctionId function_id)
context.inst_block_stack().Pop();
context.scope_stack().Pop(/*check_unused=*/true);
auto observe_block_id =
context.observe_blocks().Add(context.observe_stack().PeekArray());
context.observe_stack().PopArray();
auto& function = context.functions().Get(function_id);
function.body_block_ids = context.region_stack().PopRegion();
function.observe_block_id = observe_block_id;
// If this is a generic function, collect information about the definition.
FinishGenericDefinition(context, function.generic_id);
+8
View File
@@ -889,4 +889,12 @@ auto CopySpecificToGeneric(Context& context, SemIR::LocId loc_id,
return MakeSpecific(context, loc_id, target_generic_id, args_id);
}
auto DiagnoseImplsOnNonFacetType(Context& context, SemIR::LocId loc_id)
-> void {
CARBON_DIAGNOSTIC(
ImplsOnNonFacetType, Error,
"right argument of `impls` requirement must be a facet type");
context.emitter().Emit(loc_id, ImplsOnNonFacetType);
}
} // namespace Carbon::Check
+2
View File
@@ -168,6 +168,8 @@ auto CopySpecificToGeneric(Context& context, SemIR::LocId loc_id,
SemIR::GenericId target_generic_id)
-> SemIR::SpecificId;
auto DiagnoseImplsOnNonFacetType(Context& context, SemIR::LocId loc_id) -> void;
} // namespace Carbon::Check
#endif // CARBON_TOOLCHAIN_CHECK_GENERIC_H_
+6
View File
@@ -198,6 +198,7 @@ auto HandleParseNode(Context& context,
context.inst_block_stack().Push();
context.require_impls_stack().Push(interface_id);
context.observe_stack().PushArray();
// We use the arg stack to build the witness table type.
context.args_type_info_stack().Push();
@@ -229,9 +230,14 @@ auto HandleParseNode(Context& context, Parse::InterfaceDefinitionId /*node_id*/)
context.require_impls_stack().PeekTop());
context.require_impls_stack().Pop();
auto observe_block_id =
context.observe_blocks().Add(context.observe_stack().PeekArray());
context.observe_stack().PopArray();
auto& interface_info = context.interfaces().Get(interface_id);
if (!interface_info.associated_entities_id.has_value()) {
interface_info.require_impls_block_id = require_impls_block_id;
interface_info.observe_block_id = observe_block_id;
// This marks the interface type as fully defined.
interface_info.associated_entities_id = associated_entities_id;
}
+97 -4
View File
@@ -2,28 +2,121 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "common/hashtable_key_context.h"
#include "toolchain/check/context.h"
#include "toolchain/check/convert.h"
#include "toolchain/check/diagnostic_helpers.h"
#include "toolchain/check/generic.h"
#include "toolchain/check/handle.h"
#include "toolchain/check/inst.h"
#include "toolchain/check/type.h"
#include "toolchain/parse/node_ids.h"
#include "toolchain/parse/node_kind.h"
#include "toolchain/sem_ir/ids.h"
#include "toolchain/sem_ir/inst.h"
#include "toolchain/sem_ir/typed_insts.h"
namespace Carbon::Check {
auto HandleParseNode(Context& context, Parse::ObserveIntroducerId node_id)
-> bool {
return context.TODO(node_id, "ObserveIntroducerId");
auto scope_inst_id = context.scope_stack().PeekInstId();
if (!context.insts()
.IsOneOf<SemIR::InterfaceWithSelfDecl, SemIR::FunctionDecl>(
scope_inst_id)) {
CARBON_DIAGNOSTIC(
ObserveInWrongScope, Error,
"`observe` can only be used in an `interface` or `function`");
context.emitter().Emit(node_id, ObserveInWrongScope);
scope_inst_id = SemIR::ErrorInst::InstId;
}
context.args_type_info_stack().Push();
context.node_stack().Push(node_id, scope_inst_id);
return true;
}
auto HandleParseNode(Context& context, Parse::ObserveEqualEqualId node_id)
-> bool {
return context.TODO(node_id, "ObserveEqualEqualId");
auto [rhs_node_id, rhs_inst_id] = context.node_stack().PopExprWithNodeId();
auto [lhs_node_id, lhs_inst_id] = context.node_stack().PopExprWithNodeId();
if (context.node_stack().Peek<Parse::NodeKind::ObserveIntroducer>() ==
SemIR::ErrorInst::InstId) {
context.node_stack().Push(rhs_node_id, rhs_inst_id);
return true;
}
auto rhs_as_type = ExprAsType(context, rhs_node_id, rhs_inst_id);
auto lhs_as_type = ExprAsType(context, lhs_node_id, lhs_inst_id);
// TODO: Type check lhs and rhs are same type.
// Push rhs again for chain == expressions.
context.node_stack().Push(rhs_node_id, rhs_inst_id);
context.args_type_info_stack().AddInstId(
AddInstInNoBlock<SemIR::ObserveEquivalent>(
context, node_id,
{.lhs_id = GetCanonicalFacetOrTypeValue(context, lhs_as_type.inst_id),
.rhs_id =
GetCanonicalFacetOrTypeValue(context, rhs_as_type.inst_id)}));
return true;
}
auto HandleParseNode(Context& context, Parse::ObserveImplsId node_id) -> bool {
return context.TODO(node_id, "ObserveImplsId");
auto [rhs_node_id, rhs_inst_id] = context.node_stack().PopExprWithNodeId();
auto [lhs_node_id, lhs_inst_id] = context.node_stack().PopExprWithNodeId();
if (context.node_stack().Peek<Parse::NodeKind::ObserveIntroducer>() ==
SemIR::ErrorInst::InstId) {
context.node_stack().Push(rhs_node_id, rhs_inst_id);
return true;
}
auto rhs_as_type = ExprAsType(context, rhs_node_id, rhs_inst_id);
auto lhs_as_type = ExprAsType(context, lhs_node_id, lhs_inst_id);
if (!context.types().IsFacetTypeOrError(rhs_as_type.type_id)) {
DiagnoseImplsOnNonFacetType(context, rhs_node_id);
auto [node_id, scope_inst_id] =
context.node_stack()
.PopWithNodeId<Parse::NodeKind::ObserveIntroducer>();
context.node_stack().Push(node_id, SemIR::ErrorInst::InstId);
}
// Dummy node for ObserveDeclId.
context.node_stack().Push(rhs_node_id, rhs_inst_id);
context.args_type_info_stack().AddInstId(
AddInstInNoBlock<SemIR::ObserveImpls>(
context, node_id,
{.lhs_id = GetCanonicalFacetOrTypeValue(context, lhs_as_type.inst_id),
.rhs_id =
GetCanonicalFacetOrTypeValue(context, rhs_as_type.inst_id)}));
return true;
}
auto HandleParseNode(Context& context, Parse::ObserveDeclId node_id) -> bool {
return context.TODO(node_id, "ObserveDeclId");
context.node_stack().PopAndIgnore();
auto scope_inst_id =
context.node_stack().Pop<Parse::NodeKind::ObserveIntroducer>();
auto operations_id = context.args_type_info_stack().Pop();
if (scope_inst_id == SemIR::ErrorInst::InstId) {
// We already diagnosed the errors.
return true;
}
auto observe_decl = SemIR::ObserveDecl{// To be filled in after.
.observe_id = SemIR::ObserveId::None};
auto decl_id = AddPlaceholderInst(context, node_id, observe_decl);
observe_decl.observe_id =
context.observes().Add({.decl_id = decl_id,
.operations_id = operations_id,
.enclosing_scope_inst_id = scope_inst_id});
ReplaceInstBeforeConstantUse(context, decl_id, observe_decl);
context.observe_stack().AppendToTop(observe_decl.observe_id);
return true;
}
} // namespace Carbon::Check
+1 -4
View File
@@ -329,10 +329,7 @@ auto HandleParseNode(Context& context, Parse::RequirementImplsId node_id)
auto rhs_as_type = ExprAsType(context, rhs_node, rhs_id);
if (rhs_as_type.type_id != SemIR::ErrorInst::TypeId &&
!context.types().IsFacetType(rhs_as_type.type_id)) {
CARBON_DIAGNOSTIC(
ImplsOnNonFacetType, Error,
"right argument of `impls` requirement must be a facet type");
context.emitter().Emit(rhs_node, ImplsOnNonFacetType);
DiagnoseImplsOnNonFacetType(context, rhs_node);
rhs_as_type.type_id = SemIR::ErrorInst::TypeId;
rhs_as_type.inst_id = SemIR::ErrorInst::TypeInstId;
}
+135
View File
@@ -34,6 +34,7 @@
#include "toolchain/sem_ir/inst_categories.h"
#include "toolchain/sem_ir/inst_kind.h"
#include "toolchain/sem_ir/name_scope.h"
#include "toolchain/sem_ir/observe.h"
#include "toolchain/sem_ir/specific_interface.h"
#include "toolchain/sem_ir/specific_named_constraint.h"
#include "toolchain/sem_ir/type_info.h"
@@ -213,6 +214,12 @@ class ImportContext {
auto import_require_impls_blocks() -> const SemIR::RequireImplsBlockStore& {
return import_ir().require_impls_blocks();
}
auto import_observes() -> const SemIR::ObserveStore& {
return import_ir().observes();
}
auto import_observe_blocks() -> const SemIR::ObserveBlockStore& {
return import_ir().observe_blocks();
}
auto import_specifics() -> const SemIR::SpecificStore& {
return import_ir().specifics();
}
@@ -295,6 +302,12 @@ class ImportContext {
auto local_require_impls_blocks() -> SemIR::RequireImplsBlockStore& {
return local_ir().require_impls_blocks();
}
auto local_observes() -> SemIR::ObserveStore& {
return local_ir().observes();
}
auto local_observe_blocks() -> SemIR::ObserveBlockStore& {
return local_ir().observe_blocks();
}
auto local_specifics() -> SemIR::SpecificStore& {
return local_ir().specifics();
}
@@ -811,6 +824,52 @@ static auto GetLocalCanonicalRequireImplsBlockId(
return context.local_require_impls_blocks().Add(contents);
}
// Imports the ObserveDecl instructions for each ObserveId in the block, and
// gets the local ObserveIds from them. The returned vector is only complete if
// there is no more work to do in the resolver on return.
static auto GetLocalObserveBlockContents(ImportRefResolver& resolver,
SemIR::ObserveBlockId import_block_id)
-> llvm::SmallVector<SemIR::ObserveId> {
llvm::SmallVector<SemIR::ObserveId> observe_decl_ids;
if (!import_block_id.has_value() ||
import_block_id == SemIR::ObserveBlockId::Empty) {
return observe_decl_ids;
}
// Import the ObserveDecl for each Observe in the block.
auto import_block = resolver.import_observe_blocks().Get(import_block_id);
observe_decl_ids.reserve(import_block.size());
for (auto import_observe_id : import_block) {
const auto& import_observe =
resolver.import_observes().Get(import_observe_id);
auto local_decl_id =
GetLocalConstantInstId(resolver, import_observe.decl_id);
// If `local_decl_id` is None, the resolver will have more work to do, and
// we will call this function to try get all the decl instructions again.
if (local_decl_id.has_value()) {
// Importing the ObserveDecl instruction in `local_decl_id` also imported
// the Observe structure that it points to through the ObserveId.
observe_decl_ids.push_back(resolver.local_insts()
.GetAs<SemIR::ObserveDecl>(local_decl_id)
.observe_id);
}
}
return observe_decl_ids;
}
// Gets the local block of ObserveIds from the imported block. Only valid
// to call once there is no more work to do after the call to
// GetLocalObserveBlockContents().
static auto GetLocalCanonicalObserveBlockId(
ImportContext& context, SemIR::ObserveBlockId import_block_id,
llvm::ArrayRef<SemIR::ObserveId> contents) -> SemIR::ObserveBlockId {
if (!import_block_id.has_value()) {
return SemIR::ObserveBlockId::None;
}
return context.local_observe_blocks().Add(contents);
}
// Gets a local instruction block containing ImportRefs referring to the
// instructions in the specified imported instruction block.
static auto GetLocalImportRefInstBlock(ImportContext& context,
@@ -2884,6 +2943,69 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver,
import_require.generic_id, new_require.generic_id, generic_data);
}
static auto TryResolveTypedInst(ImportRefResolver& resolver,
SemIR::ObserveDecl inst,
SemIR::InstId import_inst_id) -> ResolveResult {
const auto& import_observe = resolver.import_observes().Get(inst.observe_id);
auto operations =
GetLocalInstBlockContents(resolver, import_observe.operations_id);
auto operations_id = GetLocalCanonicalInstBlockId(
resolver, import_observe.operations_id, operations);
auto enclosing_scope_inst_id =
GetLocalConstantInstId(resolver, import_observe.enclosing_scope_inst_id);
if (resolver.HasNewWork()) {
return ResolveResult::Retry();
}
SemIR::ObserveDecl observe_decl = {.observe_id = SemIR::ObserveId::None};
auto observe_decl_id =
AddPlaceholderImportedInst(resolver, import_inst_id, observe_decl);
auto observe_id = resolver.local_observes().Add(
{.decl_id = observe_decl_id,
.operations_id = operations_id,
.enclosing_scope_inst_id = enclosing_scope_inst_id});
observe_decl.observe_id = observe_id;
return ResolveResult::Done(
ReplacePlaceholderImportedInst(resolver, observe_decl_id, observe_decl),
observe_decl_id);
}
static auto TryResolveTypedInst(ImportRefResolver& resolver,
SemIR::ObserveEquivalent inst,
SemIR::InstId import_inst_id) -> ResolveResult {
auto lhs_id = GetLocalConstantInstId(resolver, inst.lhs_id);
auto rhs_id = GetLocalConstantInstId(resolver, inst.rhs_id);
if (resolver.HasNewWork()) {
return ResolveResult::Retry();
}
auto observe_equivalent =
SemIR::ObserveEquivalent{.lhs_id = lhs_id, .rhs_id = rhs_id};
auto observe_equivalent_id =
AddPlaceholderImportedInst(resolver, import_inst_id, observe_equivalent);
return ResolveResult::Done(SetConstantValue(
resolver.local_context(), observe_equivalent_id, observe_equivalent));
}
static auto TryResolveTypedInst(ImportRefResolver& resolver,
SemIR::ObserveImpls inst,
SemIR::InstId import_inst_id) -> ResolveResult {
auto lhs_id = GetLocalConstantInstId(resolver, inst.lhs_id);
auto rhs_id = GetLocalConstantInstId(resolver, inst.rhs_id);
if (resolver.HasNewWork()) {
return ResolveResult::Retry();
}
auto observe_impls = SemIR::ObserveImpls{.lhs_id = lhs_id, .rhs_id = rhs_id};
auto observe_impls_id =
AddPlaceholderImportedInst(resolver, import_inst_id, observe_impls);
return ResolveResult::Done(SetConstantValue(resolver.local_context(),
observe_impls_id, observe_impls));
}
static auto TryResolveTypedInst(ImportRefResolver& resolver,
SemIR::ImportRefLoaded /*inst*/,
SemIR::InstId inst_id) -> ResolveResult {
@@ -3018,6 +3140,8 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver,
GetLocalGenericData(resolver, import_interface.generic_id);
auto require_impls = GetLocalRequireImplsBlockContents(
resolver, import_interface.require_impls_block_id);
auto observes =
GetLocalObserveBlockContents(resolver, import_interface.observe_block_id);
std::optional<SemIR::InstId> self_param_id;
if (import_interface.is_complete()) {
@@ -3047,6 +3171,8 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver,
AddLoadedImportRefBlock(resolver, param_patterns);
new_interface.require_impls_block_id = GetLocalCanonicalRequireImplsBlockId(
resolver, import_interface.require_impls_block_id, require_impls);
new_interface.observe_block_id = GetLocalCanonicalObserveBlockId(
resolver, import_interface.observe_block_id, observes);
if (import_interface.is_complete()) {
CARBON_CHECK(self_param_id);
@@ -4353,6 +4479,15 @@ static auto TryResolveInstCanonical(ImportRefResolver& resolver,
case CARBON_KIND(SemIR::Namespace inst): {
return TryResolveTypedInst(resolver, inst, constant_inst_id);
}
case CARBON_KIND(SemIR::ObserveDecl inst): {
return TryResolveTypedInst(resolver, inst, constant_inst_id);
}
case CARBON_KIND(SemIR::ObserveEquivalent inst): {
return TryResolveTypedInst(resolver, inst, constant_inst_id);
}
case CARBON_KIND(SemIR::ObserveImpls inst): {
return TryResolveTypedInst(resolver, inst, constant_inst_id);
}
case CARBON_KIND(SemIR::OutParamPattern inst): {
return TryResolveTypedInst(resolver, inst);
}
+3 -3
View File
@@ -392,6 +392,8 @@ class NodeStack {
Id::KindFor<SemIR::InstId>());
set_id_if_category_is(Parse::NodeCategory::Expr,
Id::KindFor<SemIR::InstId>());
set_id_if_category_is(Parse::NodeCategory::ObserveOperator,
Id::KindFor<SemIR::InstId>());
set_id_if_category_is(
Parse::NodeCategory::MemberName | Parse::NodeCategory::NonExprName,
Id::KindFor<SemIR::NameId>());
@@ -415,6 +417,7 @@ class NodeStack {
switch (node_kind) {
case Parse::NodeKind::CallExprStart:
case Parse::NodeKind::IfExprThen:
case Parse::NodeKind::ObserveIntroducer:
case Parse::NodeKind::RequireIntroducer:
case Parse::NodeKind::ShortCircuitOperandAnd:
case Parse::NodeKind::ShortCircuitOperandOr:
@@ -462,7 +465,6 @@ class NodeStack {
case Parse::NodeKind::LetInitializer:
case Parse::NodeKind::LetIntroducer:
case Parse::NodeKind::NamedConstraintIntroducer:
case Parse::NodeKind::ObserveIntroducer:
case Parse::NodeKind::RefBindingName:
case Parse::NodeKind::ReturnStatementStart:
case Parse::NodeKind::StructLiteralStart:
@@ -524,8 +526,6 @@ class NodeStack {
case Parse::NodeKind::MatchIntroducer:
case Parse::NodeKind::MatchStatementStart:
case Parse::NodeKind::NamespaceStart:
case Parse::NodeKind::ObserveEqualEqual:
case Parse::NodeKind::ObserveImpls:
case Parse::NodeKind::PackageIntroducer:
case Parse::NodeKind::ParenExprStart:
case Parse::NodeKind::PatternListComma:
+6
View File
@@ -169,6 +169,8 @@ extern alias C = Class;
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- alias_of_alias.carbon
@@ -206,6 +208,8 @@ extern alias C = Class;
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- alias_to_generic.carbon
@@ -229,5 +233,7 @@ extern alias C = Class;
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -77,5 +77,7 @@ let a_test: bool = a;
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %a.ref: bool = name_ref a, file.%a [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+6
View File
@@ -235,6 +235,8 @@ var d: D* = &c;
// CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_13.1, %.loc6_13.2 [concrete = constants.%C.val]
// CHECK:STDOUT: assign file.%d.var, %.loc6_1
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_orig_name_not_in_export.carbon
@@ -275,6 +277,8 @@ var d: D* = &c;
// CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: assign file.%c.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- indirect_compat.carbon
@@ -374,5 +378,7 @@ var d: D* = &c;
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.6b6 = call %bound_method.loc8_13.2(%addr) [concrete = constants.%addr]
// CHECK:STDOUT: assign file.%d.var, %ptr.as.Copy.impl.Op.call
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+12
View File
@@ -138,6 +138,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.call: init %ptr = call %T.as.DefaultOrUnformed.impl.Op.specific_fn()
// CHECK:STDOUT: assign file.%a.var, %T.as.DefaultOrUnformed.impl.Op.call
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- class2.carbon
@@ -219,6 +221,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.call: init %ptr = call %T.as.DefaultOrUnformed.impl.Op.specific_fn()
// CHECK:STDOUT: assign file.%b.var, %T.as.DefaultOrUnformed.impl.Op.call
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- class3.carbon
@@ -295,6 +299,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.call: init %ptr = call %T.as.DefaultOrUnformed.impl.Op.specific_fn()
// CHECK:STDOUT: assign file.%c.var, %T.as.DefaultOrUnformed.impl.Op.call
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- var1.carbon
@@ -342,6 +348,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: %.loc4_1: init %empty_tuple.type = converted %.loc4_14.1, %.loc4_14.2 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: assign file.%a.var, %.loc4_1
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- var2.carbon
@@ -397,6 +405,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: %.loc8_1: init %empty_tuple.type = converted %a_alias.ref, %.loc8_13 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: assign file.%b.var, %.loc8_1
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- var3.carbon
@@ -449,5 +459,7 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: %.loc6_1: init %empty_tuple.type = converted %a_alias_alias.ref, %.loc6_13 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: assign file.%c.var, %.loc6_1
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+6
View File
@@ -133,6 +133,8 @@ var inst: Test.A = {};
// CHECK:STDOUT: %.loc4_1: init %C = converted %.loc4_16.1, %.loc4_16.2 [concrete = constants.%C.val]
// CHECK:STDOUT: assign file.%inst.var, %.loc4_1
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_local_def.carbon
@@ -167,6 +169,8 @@ var inst: Test.A = {};
// CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: assign file.%inst.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_other_def.carbon
@@ -206,5 +210,7 @@ var inst: Test.A = {};
// CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: assign file.%inst.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -209,5 +209,7 @@ var a_val: a = {.v = b_val.v};
// CHECK:STDOUT: %.loc10_1: init %C = converted %.loc10_29.1, %.loc10_29.5 [concrete = constants.%C.val]
// CHECK:STDOUT: assign file.%a_val.var, %.loc10_1
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -64,5 +64,7 @@ fn F() -> {} {
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+6
View File
@@ -54,11 +54,15 @@ fn F() -> () {
// CHECK:STDOUT: %a.ref: ref %empty_tuple.type = name_ref a, file.%a [concrete = file.%a.var]
// CHECK:STDOUT: %b: ref %empty_tuple.type = alias_binding b, %a.ref [concrete = file.%a.var]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_local.carbon
@@ -73,5 +77,7 @@ fn F() -> () {
// CHECK:STDOUT: %a.ref: ref %empty_tuple.type = name_ref a, %a
// CHECK:STDOUT: %b: ref %empty_tuple.type = alias_binding b, %a.ref
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+24
View File
@@ -166,6 +166,8 @@ var a: array(1, 1);
// CHECK:STDOUT: %.loc6_1: init %array_type = converted %a.ref, %.loc6_23.13 [concrete = constants.%array]
// CHECK:STDOUT: assign file.%b.var, %.loc6_1
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- array_in_place.carbon
@@ -227,6 +229,8 @@ var a: array(1, 1);
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %v.var, constants.%Destroy.Op.1a2547.4
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -234,16 +238,22 @@ var a: array(1, 1);
// CHECK:STDOUT: fn @Destroy.Op.loc10_3.2(%self.param: ref %C) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc10_3.3(%self.param: ref %tuple.type.a8c) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc10_3.4(%self.param: ref %array_type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- array_vs_tuple.carbon
@@ -331,6 +341,8 @@ var a: array(1, 1);
// CHECK:STDOUT: %Destroy.Op.bound.loc7: <bound method> = bound_method %a.var, constants.%Destroy.Op.1a2547.3
// CHECK:STDOUT: %Destroy.Op.call.loc7: init %empty_tuple.type = call %Destroy.Op.bound.loc7(%a.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %empty_tuple.type) = "no_op";
@@ -338,11 +350,15 @@ var a: array(1, 1);
// CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %tuple.type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %array_type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- assign_return_value.carbon
@@ -398,6 +414,8 @@ var a: array(1, 1);
// CHECK:STDOUT: %Destroy.Op.bound.loc8_3: <bound method> = bound_method %t.var, constants.%Destroy.Op.1a2547.3
// CHECK:STDOUT: %Destroy.Op.call.loc8_3: init %empty_tuple.type = call %Destroy.Op.bound.loc8_3(%t.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc8_34.1(%self.param: ref %empty_tuple.type) = "no_op";
@@ -405,11 +423,15 @@ var a: array(1, 1);
// CHECK:STDOUT: fn @Destroy.Op.loc8_34.2(%self.param: ref %tuple.type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc8_3(%self.param: ref %array_type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- nine_elements.carbon
@@ -521,5 +543,7 @@ var a: array(1, 1);
// CHECK:STDOUT: %.loc9_1: init %array_type = converted %a.ref, %.loc9_23.37 [concrete = constants.%array]
// CHECK:STDOUT: assign file.%b.var, %.loc9_1
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -107,6 +107,8 @@ var b: array(1, 39999999999999999993);
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- unsigned.carbon
@@ -179,5 +181,7 @@ var b: array(1, 39999999999999999993);
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+8
View File
@@ -99,6 +99,8 @@ fn F() -> i32 {
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc6_12.2, constants.%Destroy.Op.1a2547.3
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc6_12.2)
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc6_12.1(%self.param: ref %i32.builtin) = "no_op";
@@ -106,11 +108,15 @@ fn F() -> i32 {
// CHECK:STDOUT: fn @Destroy.Op.loc6_12.2(%self.param: ref %i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc6_12.3(%self.param: ref %array_type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_symbolic_decl.carbon
@@ -162,5 +168,7 @@ fn F() -> i32 {
// CHECK:STDOUT: %a.patt: %pattern_type.97e = value_binding_pattern a [concrete = constants.%a.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+10
View File
@@ -120,6 +120,8 @@ fn F(a: array({}, 3)) -> {} {
// CHECK:STDOUT: %bound_method.loc4_15.2: <bound method> = bound_method %.loc4_15.3, %specific_fn
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc4_15.2(%.loc4_15.3)
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> out %return.param: %i32 {
@@ -172,6 +174,8 @@ fn F(a: array({}, 3)) -> {} {
// CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc10_20.15, %.loc10_23.2)
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call constants.%Destroy.Op.bound(constants.%.981)
// CHECK:STDOUT: return %F.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc10_20.1(%self.param: ref %i32.builtin) = "no_op";
@@ -179,11 +183,15 @@ fn F(a: array({}, 3)) -> {} {
// CHECK:STDOUT: fn @Destroy.Op.loc10_20.2(%self.param: ref %i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc10_20.3(%self.param: ref %array_type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- index_non_literal.carbon
@@ -241,5 +249,7 @@ fn F(a: array({}, 3)) -> {} {
// CHECK:STDOUT: %.loc6_30.4: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc6_31: init %empty_struct_type = converted %.loc6_30.3, %.loc6_30.4 [concrete = constants.%empty_struct]
// CHECK:STDOUT: return %.loc6_31
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -138,6 +138,8 @@ fn H() { G(3); }
// CHECK:STDOUT: %bound_method.loc7_3.2: <bound method> = bound_method %arr.var, %specific_impl_fn.loc7_3.1
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%arr.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -233,6 +235,8 @@ fn H() { G(3); }
// CHECK:STDOUT: %arr.var_patt: <error> = var_pattern %arr.patt [concrete = <error>]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
+10
View File
@@ -232,6 +232,8 @@ var b: B = {.x = ()} as B;
// CHECK:STDOUT: %.loc25_29.2: init %B = converted %A.Make.call, %.loc25_29.1
// CHECK:STDOUT: assign file.%b_factory.var, %.loc25_29.2
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- adapt_i32.carbon
@@ -299,6 +301,8 @@ var b: B = {.x = ()} as B;
// CHECK:STDOUT: %.loc10_16.1: %i32 = as_compatible %a.ref
// CHECK:STDOUT: %.loc10_16.2: %i32 = converted %a.ref, %.loc10_16.1
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- multi_level_adapt.carbon
@@ -328,6 +332,8 @@ var b: B = {.x = ()} as B;
// CHECK:STDOUT: %.loc10_15.1: %D = as_compatible %empty_struct [concrete = constants.%D.val]
// CHECK:STDOUT: %.loc10_15.2: %D = converted %.loc10_13, %.loc10_15.1 [concrete = constants.%D.val]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- init_class_value.carbon
@@ -409,6 +415,8 @@ var b: B = {.x = ()} as B;
// CHECK:STDOUT: %.loc14_42.1: init %B = as_compatible %.loc14_36 [concrete = constants.%B.val]
// CHECK:STDOUT: %.loc14_42.2: init %B = converted %.loc14_36, %.loc14_42.1 [concrete = constants.%B.val]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- init_tuple_value.carbon
@@ -444,5 +452,7 @@ var b: B = {.x = ()} as B;
// CHECK:STDOUT: %a_value.patt: %pattern_type = value_binding_pattern a_value [concrete = constants.%a_value.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+22
View File
@@ -168,6 +168,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %.loc6_29.12: init %struct_type.x.y to %return.param = struct_init (%.loc6_29.6, %.loc6_29.11) [concrete = constants.%struct.005]
// CHECK:STDOUT: %.loc6_48: init %struct_type.x.y = converted %.loc6_29.1, %.loc6_29.12 [concrete = constants.%struct.005]
// CHECK:STDOUT: return %.loc6_48 to %return.param
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- as_type.carbon
@@ -199,6 +201,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %.loc5_24.2: type = converted constants.%empty_struct, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %.loc5_24.3: type = converted %.loc5_22, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- as_tuple.carbon
@@ -256,6 +260,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %Destroy.Op.bound.loc13_32: <bound method> = bound_method %.loc13_32.2, constants.%Destroy.Op.1a2547.2
// CHECK:STDOUT: %Destroy.Op.call.loc13_32: init %empty_tuple.type = call %Destroy.Op.bound.loc13_32(%.loc13_32.2)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc13_40.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -263,6 +269,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: fn @Destroy.Op.loc13_40.2(%self.param: ref %X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Var() {
@@ -296,11 +304,15 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %b.var, constants.%Destroy.Op.1a2547.3
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%b.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc20(%self.param: ref %tuple.type.359) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- identity.carbon
@@ -332,6 +344,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %m.patt: %pattern_type.6cb = value_binding_pattern m [concrete = constants.%m.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Reference(%p.param: %ptr.db8) {
@@ -349,6 +363,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %q.patt: %pattern_type.990 = value_binding_pattern q [concrete = constants.%q.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Initializing() {
@@ -368,6 +384,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %x.var, constants.%Destroy.Op.1a2547.2
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc24_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -375,6 +393,8 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: fn @Destroy.Op.loc24_3.2(%self.param: ref %X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- overloaded.carbon
@@ -431,5 +451,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
// CHECK:STDOUT: %X.as.As.impl.Convert.call: init %Y to %.loc19_29.1 = call %bound_method(%.loc19_23.3)
// CHECK:STDOUT: %.loc19_29.2: init %Y = converted %.loc19_23.1, %X.as.As.impl.Convert.call
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+18
View File
@@ -182,6 +182,8 @@ fn Use() {
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %i.var, constants.%Destroy.Op.1a2547.3
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -189,16 +191,22 @@ fn Use() {
// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc14_3.3(%self.param: ref %const) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- remove_const.carbon
@@ -246,6 +254,8 @@ fn Use() {
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %i.var, constants.%Destroy.Op.1a2547.2
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -253,11 +263,15 @@ fn Use() {
// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- unsafe_remove_const.carbon
@@ -303,10 +317,14 @@ fn Use() {
// CHECK:STDOUT: %b.patt: %pattern_type.990 = value_binding_pattern b [concrete = constants.%b.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+18
View File
@@ -202,11 +202,15 @@ fn Use() {
// CHECK:STDOUT: %b.patt: %pattern_type.abe = value_binding_pattern b [concrete = constants.%b.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_todo_add_unformed_nonref.carbon
@@ -287,6 +291,8 @@ fn Use() {
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %i.var, constants.%Destroy.Op.1a2547.4
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc19_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -294,21 +300,29 @@ fn Use() {
// CHECK:STDOUT: fn @Destroy.Op.loc19_3.2(%self.param: ref %X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc19_3.3(%self.param: ref %.f01) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc19_3.4(%self.param: ref %MaybeUnformed.198) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- unsafe_remove_unformed.carbon
@@ -365,10 +379,14 @@ fn Use() {
// CHECK:STDOUT: %b.patt: %pattern_type.990 = value_binding_pattern b [concrete = constants.%b.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+14
View File
@@ -196,6 +196,8 @@ fn Use() {
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %i.var, constants.%Destroy.Op.1a2547.2
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%i.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -203,11 +205,15 @@ fn Use() {
// CHECK:STDOUT: fn @Destroy.Op.loc14_3.2(%self.param: ref %.d74) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- remove_partial_in_init.carbon
@@ -280,6 +286,8 @@ fn Use() {
// CHECK:STDOUT: %Destroy.Op.bound.loc10: <bound method> = bound_method %i.var, constants.%Destroy.Op.1a2547.2
// CHECK:STDOUT: %Destroy.Op.call.loc10: init %empty_tuple.type = call %Destroy.Op.bound.loc10(%i.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -287,6 +295,8 @@ fn Use() {
// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- unsafe_remove_partial.carbon
@@ -343,10 +353,14 @@ fn Use() {
// CHECK:STDOUT: %b.patt: %pattern_type.990 = value_binding_pattern b [concrete = constants.%b.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -70,6 +70,8 @@ fn Convert(unused t: ()) {
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %x.var, constants.%Destroy.Op.1a2547.2
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%x.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op";
@@ -77,5 +79,7 @@ fn Convert(unused t: ()) {
// CHECK:STDOUT: fn @Destroy.Op.loc12_3.2(%self.param: ref %X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -139,6 +139,8 @@ library "[[@TEST_NAME]]";
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref()
// CHECK:STDOUT: assign %b.ref.loc11, %A.call
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C() -> out %return.param: %empty_tuple.type {
@@ -167,6 +169,8 @@ library "[[@TEST_NAME]]";
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %c.var, constants.%Destroy.Op
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%c.var)
// CHECK:STDOUT: return %.loc20_11
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- class.carbon
@@ -248,6 +252,8 @@ library "[[@TEST_NAME]]";
// CHECK:STDOUT: %Destroy.Op.bound.loc13: <bound method> = bound_method %.loc13_7.2, constants.%Destroy.Op
// CHECK:STDOUT: %Destroy.Op.call.loc13: init %empty_tuple.type = call %Destroy.Op.bound.loc13(%.loc13_7.2)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %empty_tuple.type) = "no_op";
@@ -78,6 +78,8 @@ fn A() {
// CHECK:STDOUT: %Destroy.Op.bound.loc18_5: <bound method> = bound_method %n.var.loc18_5, constants.%Destroy.Op
// CHECK:STDOUT: %Destroy.Op.call.loc18_5: init %empty_tuple.type = call %Destroy.Op.bound.loc18_5(%n.var.loc18_5)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %empty_tuple.type) = "no_op";
+10
View File
@@ -112,6 +112,8 @@ fn F(c: C) { c.(I.Op)(); }
// CHECK:STDOUT: witness = ()
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {}
@@ -168,6 +170,8 @@ fn F(c: C) { c.(I.Op)(); }
// CHECK:STDOUT: witness = (@I.WithSelf.%I.WithSelf.Op.decl)
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @I.WithSelf.Op(@I.%Self: %I.type) {
@@ -288,6 +292,8 @@ fn F(c: C) { c.(I.Op)(); }
// CHECK:STDOUT: witness = (imports.%Main.Op)
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @C.as.I.impl: imports.%Main.import_ref.335 as imports.%Main.import_ref.c3f [from "exclude/included_with_range.carbon"] {
@@ -311,6 +317,8 @@ fn F(c: C) { c.(I.Op)(); }
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
// CHECK:STDOUT: %C.as.I.impl.Op.call: init %empty_tuple.type = call %bound_method(%c.ref)
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @I.WithSelf.Op(imports.%Main.import_ref.e59c42.2: %I.type) [from "exclude/included_with_range.carbon"] {
@@ -412,5 +420,7 @@ fn F(c: C) { c.(I.Op)(); }
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
// CHECK:STDOUT: %C.as.I.impl.Op.call: init %empty_tuple.type = call %bound_method(%c.ref)
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -51,5 +51,7 @@ fn Boo[a: ()]() {}
// CHECK:STDOUT: fn @Boo() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -44,6 +44,8 @@ fn F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %x.ref: <error> = name_ref x, <error> [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_qualififier_unsupported.carbon
@@ -56,5 +58,7 @@ fn F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -104,5 +104,7 @@ var b: i32 = ((2));
// CHECK:STDOUT: %.loc15: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_2.295]
// CHECK:STDOUT: assign file.%b.var, %.loc15
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+6
View File
@@ -112,6 +112,8 @@ fn C(r#if: ()) -> () {
// CHECK:STDOUT: %.loc15_10: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc15_13: init %empty_tuple.type = converted %n.ref, %.loc15_10 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: return %.loc15_13
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%n.param: %empty_tuple.type) -> out %return.param: %empty_tuple.type {
@@ -120,6 +122,8 @@ fn C(r#if: ()) -> () {
// CHECK:STDOUT: %.loc19_10: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc19_11: init %empty_tuple.type = converted %n.ref, %.loc19_10 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: return %.loc19_11
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C(%if.param: %empty_tuple.type) -> out %return.param: %empty_tuple.type {
@@ -128,5 +132,7 @@ fn C(r#if: ()) -> () {
// CHECK:STDOUT: %.loc23_10: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc23_14: init %empty_tuple.type = converted %if.ref, %.loc23_10 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: return %.loc23_14
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -144,6 +144,8 @@ fn B() {
// CHECK:STDOUT: fn @A() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ---
@@ -310,6 +312,8 @@ fn B() {
// CHECK:STDOUT: %A.ref.loc6_4: %A.type = name_ref A, imports.%A.A [concrete = constants.%A]
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref.loc6_4()
// CHECK:STDOUT: return
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A [from "a.carbon"];
@@ -328,5 +328,7 @@ fn Foo(n: ()) -> ((), ()) {
// CHECK:STDOUT: %.loc17_16.6: init %tuple.type to %return.param = tuple_init (%.loc17_16.3, %.loc17_16.5) [concrete = constants.%tuple]
// CHECK:STDOUT: %.loc17_17: init %tuple.type = converted %.loc17_16.1, %.loc17_16.6 [concrete = constants.%tuple]
// CHECK:STDOUT: return %.loc17_17 to %return.param
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -86,6 +86,8 @@ var d: C(false == false) = True();
// CHECK:STDOUT: %True.call.loc12: init %C.ac4 to %.loc12 = call %True.ref.loc12()
// CHECK:STDOUT: assign file.%a.var, %True.call.loc12
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- prelude.carbon
@@ -143,5 +145,7 @@ var d: C(false == false) = True();
// CHECK:STDOUT: %True.call.loc10: init %C.ac4 to %.loc10 = call %True.ref.loc10()
// CHECK:STDOUT: assign file.%a.var, %True.call.loc10
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -57,5 +57,7 @@ let b: Bool() = false;
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -87,6 +87,8 @@ var d: C(false != false) = False();
// CHECK:STDOUT: %False.call.loc12: init %C.4b2 to %.loc12 = call %False.ref.loc12()
// CHECK:STDOUT: assign file.%a.var, %False.call.loc12
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- prelude.carbon
@@ -145,5 +147,7 @@ var d: C(false != false) = False();
// CHECK:STDOUT: %False.call.loc10: init %C.4b2 to %.loc10 = call %False.ref.loc10()
// CHECK:STDOUT: assign file.%a.var, %False.call.loc10
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -129,5 +129,7 @@ let c: CharLiteral = AddCharInt('a', Negate(98));
// CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
// CHECK:STDOUT: %AddCharInt.call.loc16: init Core.CharLiteral = call %AddCharInt.ref.loc16(%.loc16, %int_1.loc16) [concrete = constants.%.a8b]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -173,5 +173,7 @@ let c: UInt(8) = ToChar('\u{1E15}');
// CHECK:STDOUT: %.loc8: Core.CharLiteral = char_value U+007F [concrete = constants.%.e28]
// CHECK:STDOUT: %ToChar.call.loc8: init %u8.builtin = call %ToChar.ref.loc8(%.loc8) [concrete = constants.%int_127]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -170,5 +170,7 @@ let g: u8 = ConvertToU8('\u{100}');
// CHECK:STDOUT: %.loc20: Core.CharLiteral = char_value U+00FF [concrete = constants.%.ad8]
// CHECK:STDOUT: %ConvertToU8.call.loc20: init %u8 = call %ConvertToU8.ref.loc20(%.loc20) [concrete = constants.%int_255]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -64,5 +64,7 @@ let b: bool = Eq('a', 'b');
// CHECK:STDOUT: %.loc22_23: Core.CharLiteral = char_value U+0062 [concrete = constants.%.711]
// CHECK:STDOUT: %Eq.call.loc22: init bool = call %Eq.ref.loc22(%.loc22_18, %.loc22_23) [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -64,5 +64,7 @@ let b: bool = Greater('a', 'b');
// CHECK:STDOUT: %.loc22_28: Core.CharLiteral = char_value U+0062 [concrete = constants.%.711]
// CHECK:STDOUT: %Greater.call.loc22: init bool = call %Greater.ref.loc22(%.loc22_23, %.loc22_28) [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -77,5 +77,7 @@ let c: bool = GreaterEq('a', 'b');
// CHECK:STDOUT: %.loc23_30: Core.CharLiteral = char_value U+0062 [concrete = constants.%.711]
// CHECK:STDOUT: %GreaterEq.call.loc23: init bool = call %GreaterEq.ref.loc23(%.loc23_25, %.loc23_30) [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -64,5 +64,7 @@ let b: bool = Less('b', 'a');
// CHECK:STDOUT: %.loc22_25: Core.CharLiteral = char_value U+0061 [concrete = constants.%.54f]
// CHECK:STDOUT: %Less.call.loc22: init bool = call %Less.ref.loc22(%.loc22_20, %.loc22_25) [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -77,5 +77,7 @@ let c: bool = LessEq('b', 'a');
// CHECK:STDOUT: %.loc23_27: Core.CharLiteral = char_value U+0061 [concrete = constants.%.54f]
// CHECK:STDOUT: %LessEq.call.loc23: init bool = call %LessEq.ref.loc23(%.loc23_22, %.loc23_27) [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -69,5 +69,7 @@ let not_8_bit: CharLiteral = '\u{1E15}';
// CHECK:STDOUT: %.loc8: Core.CharLiteral = char_value U+0080 [concrete = constants.%.ae7]
// CHECK:STDOUT: %.loc9: Core.CharLiteral = char_value U+1E15 [concrete = constants.%.a81]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -64,5 +64,7 @@ let b: bool = Neq('a', 'a');
// CHECK:STDOUT: %.loc22_24: Core.CharLiteral = char_value U+0061 [concrete = constants.%.54f]
// CHECK:STDOUT: %Neq.call.loc22: init bool = call %Neq.ref.loc22(%.loc22_19, %.loc22_24) [concrete = constants.%false]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -130,5 +130,7 @@ let min: i32 = SubCharCharToI32('\u{0}', '\u{10FFFF}');
// CHECK:STDOUT: %.loc29_42: Core.CharLiteral = char_value U+10FFFF [concrete = constants.%.914]
// CHECK:STDOUT: %SubCharCharToI32.call.loc29: init %i32 = call %SubCharCharToI32.ref.loc29(%.loc29_33, %.loc29_42) [concrete = constants.%int_-1114111]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -122,5 +122,7 @@ let b: CharLiteral = SubCharInt('\u{10FFFF}', Negate(1));
// CHECK:STDOUT: %.loc17_51.2: Core.IntLiteral = converted %Negate.call.loc17, %.loc17_51.1 [concrete = constants.%int_-1]
// CHECK:STDOUT: %SubCharInt.call.loc17: init Core.CharLiteral = call %SubCharInt.ref.loc17(%.loc17_33, %.loc17_51.2) [concrete = constants.%.a8b]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -84,10 +84,14 @@ fn AddLiteral(a: Literal(), b: Literal()) -> Literal() = "float.add";
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Add.call: init %f64.dc1 = call %Add.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Add.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+14
View File
@@ -150,6 +150,8 @@ let b: f64 = Float32ToFloat64(1.0e30);
// CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float]
// CHECK:STDOUT: %FloatLiteralToFloatLiteral.call: init Core.FloatLiteral = call %FloatLiteralToFloatLiteral.ref(%float) [concrete = constants.%float]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- literal_f64.carbon
@@ -224,6 +226,8 @@ let b: f64 = Float32ToFloat64(1.0e30);
// CHECK:STDOUT: %float.loc10: Core.FloatLiteral = float_literal_value 10e308 [concrete = constants.%float.82f]
// CHECK:STDOUT: %FloatLiteralToFloat64.call.loc10: init %f64.dc1 = call %FloatLiteralToFloat64.ref.loc10(%float.loc10) [concrete = constants.%float.7ae]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- literal_f32.carbon
@@ -298,6 +302,8 @@ let b: f64 = Float32ToFloat64(1.0e30);
// CHECK:STDOUT: %float.loc10: Core.FloatLiteral = float_literal_value 10e38 [concrete = constants.%float.cfc]
// CHECK:STDOUT: %FloatLiteralToFloat32.call.loc10: init %f32.c73 = call %FloatLiteralToFloat32.ref.loc10(%float.loc10) [concrete = constants.%float.021]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- identity_f64.carbon
@@ -399,6 +405,8 @@ let b: f64 = Float32ToFloat64(1.0e30);
// CHECK:STDOUT: %.loc8_31.2: %f64.dc1 = converted %float.loc8, %.loc8_31.1 [concrete = constants.%float.672]
// CHECK:STDOUT: %Float64ToFloat64.call.loc8: init %f64.dc1 = call %Float64ToFloat64.ref.loc8(%.loc8_31.2) [concrete = constants.%float.672]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- identity_f32.carbon
@@ -500,6 +508,8 @@ let b: f64 = Float32ToFloat64(1.0e30);
// CHECK:STDOUT: %.loc8_31.2: %f32.c73 = converted %float.loc8, %.loc8_31.1 [concrete = constants.%float.c47]
// CHECK:STDOUT: %Float32ToFloat32.call.loc8: init %f32.c73 = call %Float32ToFloat32.ref.loc8(%.loc8_31.2) [concrete = constants.%float.c47]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- truncate.carbon
@@ -583,6 +593,8 @@ let b: f64 = Float32ToFloat64(1.0e30);
// CHECK:STDOUT: %.loc9_31.2: %f64.dc1 = converted %float.loc9, %.loc9_31.1 [concrete = constants.%float.7b6]
// CHECK:STDOUT: %Float64ToFloat32.call.loc9: init %f32.c73 = call %Float64ToFloat32.ref.loc9(%.loc9_31.2) [concrete = constants.%float.021]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- extend.carbon
@@ -666,5 +678,7 @@ let b: f64 = Float32ToFloat64(1.0e30);
// CHECK:STDOUT: %.loc8_31.2: %f32.c73 = converted %float.loc8, %.loc8_31.1 [concrete = constants.%float.518]
// CHECK:STDOUT: %Float32ToFloat64.call.loc8: init %f64.dc1 = call %Float32ToFloat64.ref.loc8(%.loc8_31.2) [concrete = constants.%float.84e]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -186,6 +186,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float]
// CHECK:STDOUT: %FloatLiteralToFloatLiteral.call: init Core.FloatLiteral = call %FloatLiteralToFloatLiteral.ref(%float) [concrete = constants.%float]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- literal_f64.carbon
@@ -247,6 +249,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %float.loc8: Core.FloatLiteral = float_literal_value 10e307 [concrete = constants.%float.12a]
// CHECK:STDOUT: %FloatLiteralToFloat64.call.loc8: init %f64.dc1 = call %FloatLiteralToFloat64.ref.loc8(%float.loc8) [concrete = constants.%float.672]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- literal_f32.carbon
@@ -308,6 +312,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %float.loc8: Core.FloatLiteral = float_literal_value 10e37 [concrete = constants.%float.8d2]
// CHECK:STDOUT: %FloatLiteralToFloat32.call.loc8: init %f32.c73 = call %FloatLiteralToFloat32.ref.loc8(%float.loc8) [concrete = constants.%float.c47]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- identity_f64.carbon
@@ -409,6 +415,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %.loc8_31.2: %f64.dc1 = converted %float.loc8, %.loc8_31.1 [concrete = constants.%float.672]
// CHECK:STDOUT: %Float64ToFloat64.call.loc8: init %f64.dc1 = call %Float64ToFloat64.ref.loc8(%.loc8_31.2) [concrete = constants.%float.672]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- identity_f32.carbon
@@ -510,6 +518,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %.loc8_31.2: %f32.c73 = converted %float.loc8, %.loc8_31.1 [concrete = constants.%float.c47]
// CHECK:STDOUT: %Float32ToFloat32.call.loc8: init %f32.c73 = call %Float32ToFloat32.ref.loc8(%.loc8_31.2) [concrete = constants.%float.c47]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- truncate.carbon
@@ -570,6 +580,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %.loc6_31.2: %f64.dc1 = converted %float, %.loc6_31.1 [concrete = constants.%float.3b9]
// CHECK:STDOUT: %Float64ToFloat32.call: init %f32.c73 = call %Float64ToFloat32.ref(%.loc6_31.2) [concrete = constants.%float.943]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_truncate_overflow.carbon
@@ -660,6 +672,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %float.loc21: Core.FloatLiteral = float_literal_value 10e308 [concrete = constants.%float.82f]
// CHECK:STDOUT: %FloatLiteralToFloat64.call: init %f64.dc1 = call %FloatLiteralToFloat64.ref(%float.loc21) [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- extend.carbon
@@ -743,6 +757,8 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %.loc7_31.2: %f32.c73 = converted %float.loc7, %.loc7_31.1 [concrete = constants.%float.518]
// CHECK:STDOUT: %Float32ToFloat64.call.loc7: init %f64.dc1 = call %Float32ToFloat64.ref.loc7(%.loc7_31.2) [concrete = constants.%float.84e]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_not_constant.carbon
@@ -807,5 +823,7 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
// CHECK:STDOUT: %not_constant_64.ref: %f64.dc1 = name_ref not_constant_64, file.%not_constant_64
// CHECK:STDOUT: %Float64ToFloat64.call: init %f64.dc1 = call %Float64ToFloat64.ref(%not_constant_64.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -513,6 +513,8 @@ let inf_val: i32 = ConvertF64ToI32(Div(1.0, 0.0));
// CHECK:STDOUT: %float.loc104: Core.FloatLiteral = float_literal_value 16p28 [concrete = constants.%float.97b]
// CHECK:STDOUT: %ConvertFloatLiteralToU32.call.loc104: init %u32 = call %ConvertFloatLiteralToU32.ref.loc104(%float.loc104) [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_nan_inf.carbon
@@ -629,5 +631,7 @@ let inf_val: i32 = ConvertF64ToI32(Div(1.0, 0.0));
// CHECK:STDOUT: %.loc15_48.2: %f64.dc1 = converted %Div.call.loc15, %.loc15_48.1 [concrete = constants.%float.7ae]
// CHECK:STDOUT: %ConvertF64ToI32.call.loc15: init %i32 = call %ConvertF64ToI32.ref.loc15(%.loc15_48.2) [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -95,10 +95,14 @@ fn DivLiteral(a: Literal(), b: Literal()) -> Literal() = "float.div";
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Div.call: init %f64.dc1 = call %Div.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Div.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -64,5 +64,7 @@ fn Eq(a: Core.FloatLiteral, b: Core.FloatLiteral) -> bool = "float.eq";
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Eq.call: init bool = call %Eq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Eq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -48,5 +48,7 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Greater.call: init bool = call %Greater.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Greater.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -48,5 +48,7 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %GreaterEq.call: init bool = call %GreaterEq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %GreaterEq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -48,5 +48,7 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Less.call: init bool = call %Less.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Less.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -58,5 +58,7 @@ fn LessEq(a: Core.FloatLiteral, b: Core.FloatLiteral) -> bool = "float.less_eq";
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %LessEq.call: init bool = call %LessEq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %LessEq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -77,10 +77,14 @@ var dyn: Float(dyn_size);
// CHECK:STDOUT: %dyn_size.ref: %i32 = name_ref dyn_size, %dyn_size
// CHECK:STDOUT: %Float.call: init type = call %Float.ref(%dyn_size.ref)
// CHECK:STDOUT: return %Float.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -93,10 +93,14 @@ fn MulLiteral(a: Literal(), b: Literal()) -> Literal() = "float.mul";
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Mul.call: init %f64.dc1 = call %Mul.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Mul.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -81,10 +81,14 @@ fn RuntimeCallIsValidBadReturnType(a: f64) -> bool {
// CHECK:STDOUT: %a.ref: %f64.dc1 = name_ref a, %a
// CHECK:STDOUT: %Negate.call: init %f64.dc1 = call %Negate.ref(%a.ref)
// CHECK:STDOUT: return %Negate.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -56,5 +56,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq";
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Neq.call: init bool = call %Neq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Neq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -93,10 +93,14 @@ fn SubLiteral(a: Literal(), b: Literal()) -> Literal() = "float.sub";
// CHECK:STDOUT: %b.ref: %f64.dc1 = name_ref b, %b
// CHECK:STDOUT: %Sub.call: init %f64.dc1 = call %Sub.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Sub.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -51,5 +51,7 @@ let f: FloatLiteral = 1.0;
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -55,5 +55,7 @@ let f: Form = form(var ());
// CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %.loc7_20: Core.Form = init_form %.loc7_25.2 [concrete = constants.%.262]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -101,5 +101,7 @@ let c: CharLiteral = AddIntChar(Negate(98), 'a');
// CHECK:STDOUT: %.loc12: Core.CharLiteral = char_value U+0061 [concrete = constants.%.54f]
// CHECK:STDOUT: %AddIntChar.call: init Core.CharLiteral = call %AddIntChar.ref(%int_1, %.loc12) [concrete = constants.%.711]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -139,10 +139,14 @@ fn Test(n: Core.IntLiteral) {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %And.call: init %i32 = call %And.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %And.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -72,5 +72,7 @@ fn MixedTypes(ref a: i32, b: i64) = "int.and_assign";
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Builtin.call: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -77,10 +77,14 @@ fn F(a: Core.IntLiteral) -> Core.IntLiteral {
// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a
// CHECK:STDOUT: %Complement.call: init %i32 = call %Complement.ref(%a.ref)
// CHECK:STDOUT: return %Complement.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+6
View File
@@ -317,6 +317,8 @@ fn F() {
// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a
// CHECK:STDOUT: %Int32ToUint32.call: init %u32 = call %Int32ToUint32.ref(%a.ref)
// CHECK:STDOUT: return %Int32ToUint32.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Narrowing(%a.param: %i32) -> out %return.param: %i16 {
@@ -325,6 +327,8 @@ fn F() {
// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a
// CHECK:STDOUT: %Int32ToInt16.call: init %i16 = call %Int32ToInt16.ref(%a.ref)
// CHECK:STDOUT: return %Int32ToInt16.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Widening(%a.param: %i32) -> out %return.param: %i64 {
@@ -333,5 +337,7 @@ fn F() {
// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a
// CHECK:STDOUT: %Int32ToInt64.call: init %i64 = call %Int32ToInt64.ref(%a.ref)
// CHECK:STDOUT: return %Int32ToInt64.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -166,5 +166,7 @@ let c: CharLiteral = ConvertFromIntLiteral(0x110000);
// CHECK:STDOUT: %.loc16_37.2: %u32 = converted %int_99, %.loc16_37.1 [concrete = constants.%int_99.d4e]
// CHECK:STDOUT: %ConvertFromU32.call: init Core.CharLiteral = call %ConvertFromU32.ref(%.loc16_37.2) [concrete = constants.%.b9b]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -370,5 +370,7 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant);
// CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_1.loc8, %.loc8_34.1 [concrete = constants.%int_1.0c6]
// CHECK:STDOUT: %Int32ToInt64.call: init %i64 = call %Int32ToInt64.ref(%.loc8_34.2) [concrete = constants.%int_1.d98]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -99,6 +99,8 @@ let invalid: f64 = ConvertIntLiteralToFloatLiteral(-1) as f64;
// CHECK:STDOUT: %int_1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000: Core.IntLiteral = int_value 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [concrete = constants.%int_1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000]
// CHECK:STDOUT: %ConvertIntLiteralToF64.call: init %f64.dc1 = call %ConvertIntLiteralToF64.ref(%int_1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_todo_negative_literal.carbon
@@ -171,5 +173,7 @@ let invalid: f64 = ConvertIntLiteralToFloatLiteral(-1) as f64;
// CHECK:STDOUT: %.loc9_56.1: %f64.dc1 = value_of_initializer %Core.FloatLiteral.as.As.impl.Convert.call [concrete = <error>]
// CHECK:STDOUT: %.loc9_56.2: %f64.dc1 = converted %ConvertIntLiteralToFloatLiteral.call, %.loc9_56.1 [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -75,5 +75,7 @@ let lossy: f32 = ConvertIntLiteralToF32(123456789);
// CHECK:STDOUT: %int_123456789: Core.IntLiteral = int_value 123456789 [concrete = constants.%int_123456789]
// CHECK:STDOUT: %ConvertIntLiteralToF32.call: init %f32.c73 = call %ConvertIntLiteralToF32.ref(%int_123456789) [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -123,5 +123,7 @@ fn Test(n: Core.IntLiteral) {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Eq.call: init bool = call %Eq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Eq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -48,5 +48,7 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Greater.call: init bool = call %Greater.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Greater.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -86,5 +86,7 @@ fn F() {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %GreaterEq.call: init bool = call %GreaterEq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %GreaterEq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -244,6 +244,8 @@ let bad4: Core.IntLiteral = LeftShiftOfLit(12, an_i32);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %LeftShift.call: init %i32 = call %LeftShift.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %LeftShift.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- u32.carbon
@@ -263,5 +265,7 @@ let bad4: Core.IntLiteral = LeftShiftOfLit(12, an_i32);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %LeftShift.call: init %u32 = call %LeftShift.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %LeftShift.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -72,6 +72,8 @@ fn NotRef(a: i32, b: i32) = "int.left_shift_assign";
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Builtin.call: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallMixed(%a.param: ref %i32, %b.param: %i64) {
@@ -82,5 +84,7 @@ fn NotRef(a: i32, b: i32) = "int.left_shift_assign";
// CHECK:STDOUT: %b.ref: %i64 = name_ref b, %b
// CHECK:STDOUT: %MixedTypes.call: init %empty_tuple.type = call %MixedTypes.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -48,5 +48,7 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Less.call: init bool = call %Less.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Less.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -121,5 +121,7 @@ fn Test(n: Core.IntLiteral) {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %LessEq.call: init bool = call %LessEq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %LessEq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -115,10 +115,14 @@ var m: Int(1000000000);
// CHECK:STDOUT: fn @F(%n.param: %i64.builtin) -> out %return.param: %i64.builtin {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%n.param: %i13.builtin) -> out %return.param: %i13.builtin {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -97,10 +97,14 @@ var m: UInt(1000000000);
// CHECK:STDOUT: fn @F(%n.param: %u64.builtin) -> out %return.param: %u64.builtin {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%n.param: %u13.builtin) -> out %return.param: %u13.builtin {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -44,5 +44,7 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Neq.call: init bool = call %Neq.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Neq.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -39,10 +39,14 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Or.call: init %i32 = call %Or.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Or.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -66,5 +66,7 @@ fn MixedTypes(ref a: i32, b: i64) = "int.or_assign";
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Builtin.call: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -148,6 +148,8 @@ let negative_lit_zero: Core.IntLiteral = RightShiftLit(0, -1);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %RightShift.call: init %i32 = call %RightShift.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %RightShift.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- u32.carbon
@@ -167,5 +169,7 @@ let negative_lit_zero: Core.IntLiteral = RightShiftLit(0, -1);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %RightShift.call: init %u32 = call %RightShift.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %RightShift.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -72,6 +72,8 @@ fn NotRef(a: i32, b: i32) = "int.right_shift_assign";
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Builtin.call: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallMixed(%a.param: ref %i32, %b.param: %i64) {
@@ -82,5 +84,7 @@ fn NotRef(a: i32, b: i32) = "int.right_shift_assign";
// CHECK:STDOUT: %b.ref: %i64 = name_ref b, %b
// CHECK:STDOUT: %MixedTypes.call: init %empty_tuple.type = call %MixedTypes.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -177,5 +177,7 @@ let b: i32 = Add(0x7FFFFFFF, 1);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Add.call: init %i32 = call %Add.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Add.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -108,10 +108,14 @@ let d: Core.IntLiteral = DivLit(0, 0);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Div.call: init %i32 = call %Div.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Div.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -66,5 +66,7 @@ fn MixedTypes(ref a: i32, b: i64) = "int.sdiv_assign";
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Builtin.call: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4
View File
@@ -83,10 +83,14 @@ let b: i32 = Mod(0, 0);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Mod.call: init %i32 = call %Mod.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Mod.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -66,5 +66,7 @@ fn MixedTypes(ref a: i32, b: i64) = "int.smod_assign";
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Builtin.call: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2
View File
@@ -90,5 +90,7 @@ let b: i32 = Mul(0x8000, 0x10000);
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Mul.call: init %i32 = call %Mul.ref(%a.ref, %b.ref)
// CHECK:STDOUT: return %Mul.call
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -66,5 +66,7 @@ fn MixedTypes(ref a: i32, b: i64) = "int.smul_assign";
// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b
// CHECK:STDOUT: %Builtin.call: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT:
// CHECK:STDOUT: !observes:
// CHECK:STDOUT: }
// CHECK:STDOUT:

Some files were not shown because too many files have changed in this diff Show More