Remove ImportRefUsed (#3934)

This was to track use of a declaration after import, prior to a
redeclaration. Per [discussion on
Discord](https://discord.com/channels/655572317891461132/1217182321933815820/1236016521059237962),
we likely don't need this check due to the change in behavior of
`extern`.

Rather than potentially getting one of many `extern` decls and depending
on it by accident, it is now planned to be _required_ to be imported,
and the library doing a non-`extern` decl must _know_ it's importing the
`extern` decl. The stricter requirement on the library means it now
seems more reasonable to use the `extern` decl.

So kind of rolling back #3831, though keeping `ImportIRInstId` (at least
for now) and keeping `Loaded`/`Unloaded` terminology (seems a nicer
fit).
This commit is contained in:
Jon Ross-Perkins
2024-05-03 23:33:42 +00:00
committed by GitHub
parent 76ed3c73cb
commit 92fa0ac1ac
76 changed files with 361 additions and 475 deletions
+13 -20
View File
@@ -211,8 +211,7 @@ auto Context::AddNameToLookup(SemIR::NameId name_id, SemIR::InstId target_id)
}
auto Context::LookupNameInDecl(SemIR::LocId loc_id, SemIR::NameId name_id,
SemIR::NameScopeId scope_id,
bool mark_imports_used) -> SemIR::InstId {
SemIR::NameScopeId scope_id) -> SemIR::InstId {
if (!scope_id.is_valid()) {
// Look for a name in the current scope only. There are two cases where the
// name would be in an outer scope:
@@ -248,8 +247,7 @@ auto Context::LookupNameInDecl(SemIR::LocId loc_id, SemIR::NameId name_id,
//
// // Error, no `F` in `B`.
// fn B.F() {}
return LookupNameInExactScope(loc_id, name_id, name_scopes().Get(scope_id),
mark_imports_used);
return LookupNameInExactScope(loc_id, name_id, name_scopes().Get(scope_id));
}
}
@@ -284,8 +282,8 @@ auto Context::LookupUnqualifiedName(Parse::NodeId node_id,
// Handles lookup through the import_ir_scopes for LookupNameInExactScope.
static auto LookupInImportIRScopes(Context& context, SemIRLoc loc,
SemIR::NameId name_id,
const SemIR::NameScope& scope,
bool mark_imports_used) -> SemIR::InstId {
const SemIR::NameScope& scope)
-> SemIR::InstId {
auto identifier_id = name_id.AsIdentifierId();
llvm::StringRef identifier;
if (identifier_id.is_valid()) {
@@ -328,8 +326,7 @@ static auto LookupInImportIRScopes(Context& context, SemIRLoc loc,
if (result_id.is_valid()) {
context.DiagnoseDuplicateName(import_inst_id, result_id);
} else {
LoadImportRef(context, import_inst_id,
mark_imports_used ? loc : SemIR::LocId::Invalid);
LoadImportRef(context, import_inst_id);
result_id = import_inst_id;
}
}
@@ -338,16 +335,14 @@ static auto LookupInImportIRScopes(Context& context, SemIRLoc loc,
}
auto Context::LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id,
const SemIR::NameScope& scope,
bool mark_imports_used) -> SemIR::InstId {
const SemIR::NameScope& scope)
-> SemIR::InstId {
if (auto it = scope.names.find(name_id); it != scope.names.end()) {
LoadImportRef(*this, it->second,
mark_imports_used ? loc : SemIR::LocId::Invalid);
LoadImportRef(*this, it->second);
return it->second;
}
if (!scope.import_ir_scopes.empty()) {
return LookupInImportIRScopes(*this, loc, name_id, scope,
mark_imports_used);
return LookupInImportIRScopes(*this, loc, name_id, scope);
}
return SemIR::InstId::Invalid;
}
@@ -364,8 +359,7 @@ auto Context::LookupQualifiedName(Parse::NodeId node_id, SemIR::NameId name_id,
const auto& scope = name_scopes().Get(scope_ids.pop_back_val());
has_error |= scope.has_error;
auto scope_result_id = LookupNameInExactScope(node_id, name_id, scope,
/*mark_imports_used=*/true);
auto scope_result_id = LookupNameInExactScope(node_id, name_id, scope);
if (!scope_result_id.is_valid()) {
// Nothing found in this scope: also look in its extended scopes.
auto extended = llvm::reverse(scope.extended_scopes);
@@ -415,8 +409,8 @@ static auto GetCorePackage(Context& context, SemIRLoc loc)
// Look up `package.Core`.
auto core_inst_id = context.LookupNameInExactScope(
loc, core_name_id, context.name_scopes().Get(SemIR::NameScopeId::Package),
/*mark_imports_used=*/true);
loc, core_name_id,
context.name_scopes().Get(SemIR::NameScopeId::Package));
if (!core_inst_id.is_valid()) {
context.DiagnoseNameNotFound(loc, core_name_id);
return SemIR::NameScopeId::Invalid;
@@ -441,8 +435,7 @@ auto Context::LookupNameInCore(SemIRLoc loc, llvm::StringRef name)
auto name_id = SemIR::NameId::ForIdentifier(identifiers().Add(name));
auto inst_id =
LookupNameInExactScope(loc, name_id, name_scopes().Get(core_package_id),
/*mark_imports_used=*/true);
LookupNameInExactScope(loc, name_id, name_scopes().Get(core_package_id));
if (!inst_id.is_valid()) {
DiagnoseNameNotFound(loc, name_id);
return SemIR::InstId::BuiltinError;
+2 -4
View File
@@ -99,8 +99,7 @@ class Context {
// declaration, returning the referenced instruction. If scope_id is invalid,
// uses the current contextual scope.
auto LookupNameInDecl(SemIR::LocId loc_id, SemIR::NameId name_id,
SemIR::NameScopeId scope_id, bool mark_imports_used)
-> SemIR::InstId;
SemIR::NameScopeId scope_id) -> SemIR::InstId;
// Performs an unqualified name lookup, returning the referenced instruction.
auto LookupUnqualifiedName(Parse::NodeId node_id, SemIR::NameId name_id)
@@ -110,8 +109,7 @@ class Context {
// instruction. Does not look into extended scopes. Returns an invalid
// instruction if the name is not found.
auto LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id,
const SemIR::NameScope& scope,
bool mark_imports_used) -> SemIR::InstId;
const SemIR::NameScope& scope) -> SemIR::InstId;
// Performs a qualified name lookup in a specified scope and in scopes that
// it extends, returning the referenced instruction.
+1 -2
View File
@@ -195,8 +195,7 @@ auto DeclNameStack::ApplyNameQualifierTo(NameContext& name_context,
if (TryResolveQualifier(name_context, loc_id)) {
// For identifier nodes, we need to perform a lookup on the identifier.
auto resolved_inst_id = context_->LookupNameInDecl(
name_context.loc_id, name_id, name_context.target_scope_id,
/*mark_imports_used=*/false);
name_context.loc_id, name_id, name_context.target_scope_id);
if (!resolved_inst_id.is_valid()) {
// Invalid indicates an unresolved name. Store it and return.
name_context.state = NameContext::State::Unresolved;
-1
View File
@@ -1036,7 +1036,6 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
case SemIR::BindValue::Kind:
case SemIR::Deref::Kind:
case SemIR::ImportRefLoaded::Kind:
case SemIR::ImportRefUsed::Kind:
case SemIR::Temporary::Kind:
case SemIR::TemporaryStorage::Kind:
case SemIR::ValueAsRef::Kind:
+1 -2
View File
@@ -49,8 +49,7 @@ static auto MergeOrAddName(Context& context, Parse::AnyClassDeclId node_id,
auto prev_id =
context.decl_name_stack().LookupOrAddName(name_context, class_decl_id);
if (prev_id.is_valid()) {
auto prev_inst_for_merge =
ResolvePrevInstForMerge(context, node_id, prev_id);
auto prev_inst_for_merge = ResolvePrevInstForMerge(context, prev_id);
auto prev_class_id = SemIR::ClassId::Invalid;
CARBON_KIND_SWITCH(prev_inst_for_merge.inst) {
+1 -1
View File
@@ -93,7 +93,7 @@ static auto TryMergeRedecl(Context& context, Parse::AnyFunctionDeclId node_id,
return;
}
auto prev_inst_for_merge = ResolvePrevInstForMerge(context, node_id, prev_id);
auto prev_inst_for_merge = ResolvePrevInstForMerge(context, prev_id);
auto prev_function_id =
GetRedeclFunctionId(context, prev_inst_for_merge.inst);
if (!prev_function_id.is_valid()) {
+3 -3
View File
@@ -90,7 +90,7 @@ static auto BuildInterfaceWitness(
.replacement_id = context.types().GetConstantId(impl.self_id)}};
for (auto decl_id : assoc_entities) {
LoadImportRef(context, decl_id, impl.definition_id);
LoadImportRef(context, decl_id);
auto const_id = context.constant_values().Get(decl_id);
CARBON_CHECK(const_id.is_constant()) << "Non-constant associated entity";
auto decl = context.insts().Get(const_id.inst_id());
@@ -105,8 +105,8 @@ static auto BuildInterfaceWitness(
CARBON_FATAL() << "Unexpected type: " << type_inst;
}
auto& fn = context.functions().Get(fn_type->function_id);
auto impl_decl_id = context.LookupNameInExactScope(
decl_id, fn.name_id, impl_scope, /*mark_imports_used=*/true);
auto impl_decl_id =
context.LookupNameInExactScope(decl_id, fn.name_id, impl_scope);
if (impl_decl_id.is_valid()) {
used_decl_ids.push_back(impl_decl_id);
table.push_back(CheckAssociatedFunctionImplementation(
+23 -54
View File
@@ -552,7 +552,7 @@ class ImportRefResolver {
case CARBON_KIND(SemIR::FunctionType inst): {
return TryResolveTypedInst(inst);
}
case CARBON_KIND(SemIR::ImportRefUsed inst): {
case CARBON_KIND(SemIR::ImportRefLoaded inst): {
return TryResolveTypedInst(inst, inst_id);
}
case CARBON_KIND(SemIR::InterfaceDecl inst): {
@@ -900,8 +900,8 @@ class ImportRefResolver {
return {context_.types().GetConstantId(fn_val.type_id())};
}
auto TryResolveTypedInst(SemIR::ImportRefUsed /*inst*/, SemIR::InstId inst_id)
-> ResolveResult {
auto TryResolveTypedInst(SemIR::ImportRefLoaded /*inst*/,
SemIR::InstId inst_id) -> ResolveResult {
auto initial_work = work_stack_.size();
// Return the constant for the instruction of the imported constant.
auto constant_id = import_ir_.constant_values().Get(inst_id);
@@ -909,7 +909,8 @@ class ImportRefResolver {
return {SemIR::ConstantId::Error};
}
if (!constant_id.is_constant()) {
context_.TODO(inst_id, "Non-constant ImportRefUsed (comes up with var)");
context_.TODO(inst_id,
"Non-constant ImportRefLoaded (comes up with var)");
return {SemIR::ConstantId::Error};
}
@@ -1139,61 +1140,29 @@ class ImportRefResolver {
llvm::SmallVector<Work> work_stack_;
};
// Returns the LocId corresponding to the input location.
static auto SemIRLocToLocId(Context& context, SemIRLoc loc) -> SemIR::LocId {
if (loc.is_inst_id) {
return context.insts().GetLocId(loc.inst_id);
} else {
return loc.loc_id;
auto LoadImportRef(Context& context, SemIR::InstId inst_id) -> void {
auto inst = context.insts().TryGetAs<SemIR::ImportRefUnloaded>(inst_id);
if (!inst) {
return;
}
}
auto import_ir_inst = context.import_ir_insts().Get(inst->import_ir_inst_id);
// Replace the ImportRefUnloaded instruction with an appropriate ImportRef. This
// doesn't use ReplaceInstBeforeConstantUse because it would trigger
// TryEvalInst, which we want to avoid with ImportRefs.
static auto SetInst(Context& context, SemIR::InstId inst_id,
SemIR::TypeId type_id,
SemIR::ImportIRInstId import_ir_inst_id, SemIRLoc loc,
bool set_if_invalid_loc) -> void {
if (auto loc_id = SemIRLocToLocId(context, loc); loc_id.is_valid()) {
context.sem_ir().insts().Set(
inst_id, SemIR::ImportRefUsed{type_id, import_ir_inst_id, loc_id});
} else if (set_if_invalid_loc) {
context.sem_ir().insts().Set(
inst_id, SemIR::ImportRefLoaded{type_id, import_ir_inst_id});
}
}
const SemIR::File& import_ir =
*context.import_irs().Get(import_ir_inst.ir_id).sem_ir;
auto import_inst = import_ir.insts().Get(import_ir_inst.inst_id);
auto LoadImportRef(Context& context, SemIR::InstId inst_id, SemIRLoc loc)
-> void {
CARBON_KIND_SWITCH(context.insts().Get(inst_id)) {
case CARBON_KIND(SemIR::ImportRefLoaded inst): {
SetInst(context, inst_id, inst.type_id, inst.import_ir_inst_id, loc,
/*set_if_invalid_loc=*/false);
return;
}
case CARBON_KIND(SemIR::ImportRefUnloaded inst): {
auto import_ir_inst =
context.import_ir_insts().Get(inst.import_ir_inst_id);
ImportRefResolver resolver(context, import_ir_inst.ir_id);
auto type_id = resolver.ResolveType(import_inst.type_id());
auto constant_id = resolver.Resolve(import_ir_inst.inst_id);
const SemIR::File& import_ir =
*context.import_irs().Get(import_ir_inst.ir_id).sem_ir;
auto import_inst = import_ir.insts().Get(import_ir_inst.inst_id);
// Replace the ImportRefUnloaded instruction with ImportRefLoaded. This
// doesn't use ReplaceInstBeforeConstantUse because it would trigger
// TryEvalInst, which we want to avoid with ImportRefs.
context.sem_ir().insts().Set(
inst_id, SemIR::ImportRefLoaded{type_id, inst->import_ir_inst_id});
ImportRefResolver resolver(context, import_ir_inst.ir_id);
auto type_id = resolver.ResolveType(import_inst.type_id());
auto constant_id = resolver.Resolve(import_ir_inst.inst_id);
SetInst(context, inst_id, type_id, inst.import_ir_inst_id, loc,
/*set_if_invalid_loc=*/true);
// Store the constant for both the ImportRefUsed and imported instruction.
context.constant_values().Set(inst_id, constant_id);
return;
}
default:
return;
}
// Store the constant for both the ImportRefLoaded and imported instruction.
context.constant_values().Set(inst_id, constant_id);
}
// Imports the impl `import_impl_id` from the imported IR `import_ir`.
+3 -4
View File
@@ -24,10 +24,9 @@ auto AddImportIR(Context& context, SemIR::ImportIR import_ir)
auto AddImportRef(Context& context, SemIR::ImportIRInst import_ir_inst)
-> SemIR::InstId;
// If the passed in instruction ID is an ImportRefUnloaded, loads it for use.
// The result will be an ImportRefUsed.
auto LoadImportRef(Context& context, SemIR::InstId inst_id, SemIRLoc loc)
-> void;
// If the passed in instruction ID is an ImportRefUnloaded, turns it into an
// ImportRefLoaded for use.
auto LoadImportRef(Context& context, SemIR::InstId inst_id) -> void;
// Load all impls declared in IRs imported into this context.
auto ImportImpls(Context& context) -> void;
+4 -4
View File
@@ -122,7 +122,7 @@ static auto ScopeNeedsImplLookup(Context& context,
// Given a type and an interface, searches for an impl that describes how that
// type implements that interface, and returns the corresponding witness.
// Returns an invalid InstId if no matching impl is found.
static auto LookupInterfaceWitness(Context& context, SemIRLoc loc,
static auto LookupInterfaceWitness(Context& context,
SemIR::ConstantId type_const_id,
SemIR::InterfaceId interface_id)
-> SemIR::InstId {
@@ -147,7 +147,7 @@ static auto LookupInterfaceWitness(Context& context, SemIRLoc loc,
// TODO: Diagnose if the impl isn't defined yet?
return SemIR::InstId::Invalid;
}
LoadImportRef(context, impl.witness_id, loc);
LoadImportRef(context, impl.witness_id);
return impl.witness_id;
}
return SemIR::InstId::Invalid;
@@ -160,8 +160,8 @@ static auto PerformImplLookup(Context& context, Parse::NodeId node_id,
SemIR::AssociatedEntityType assoc_type,
SemIR::InstId member_id) -> SemIR::InstId {
auto& interface = context.interfaces().Get(assoc_type.interface_id);
auto witness_id = LookupInterfaceWitness(context, node_id, type_const_id,
assoc_type.interface_id);
auto witness_id =
LookupInterfaceWitness(context, type_const_id, assoc_type.interface_id);
if (!witness_id.is_valid()) {
CARBON_DIAGNOSTIC(MissingImplInMemberAccess, Error,
"Cannot access member of interface {0} in type {1} "
+7 -26
View File
@@ -125,35 +125,16 @@ auto CheckIsAllowedRedecl(Context& context, Lex::TokenKind decl_kind,
}
}
auto ResolvePrevInstForMerge(Context& context, Parse::NodeId node_id,
SemIR::InstId prev_inst_id) -> InstForMerge {
auto ResolvePrevInstForMerge(Context& context, SemIR::InstId prev_inst_id)
-> InstForMerge {
InstForMerge result = {.inst = context.insts().Get(prev_inst_id),
.import_ir_inst_id = SemIR::ImportIRInstId::Invalid};
CARBON_KIND_SWITCH(result.inst) {
case CARBON_KIND(SemIR::ImportRefUsed import_ref): {
CARBON_DIAGNOSTIC(
RedeclOfUsedImport, Error,
"Redeclaration of imported entity that was previously used.");
CARBON_DIAGNOSTIC(UsedImportLoc, Note, "Import used here.");
context.emitter()
.Build(node_id, RedeclOfUsedImport)
.Note(import_ref.used_id, UsedImportLoc)
.Emit();
[[fallthrough]];
}
case SemIR::ImportRefLoaded::Kind: {
// Follow the import ref.
auto import_ref = result.inst.As<SemIR::AnyImportRef>();
result.import_ir_inst_id = import_ref.import_ir_inst_id;
result.inst = context.insts().Get(
context.constant_values().Get(prev_inst_id).inst_id());
break;
}
default:
break;
if (auto import_ref = result.inst.TryAs<SemIR::ImportRefLoaded>()) {
// Follow the import ref.
result.import_ir_inst_id = import_ref->import_ir_inst_id;
result.inst = context.insts().Get(
context.constant_values().Get(prev_inst_id).inst_id());
}
return result;
}
+2 -2
View File
@@ -46,8 +46,8 @@ struct InstForMerge {
// to return the instruction relevant for a merge. If an import is found and was
// previously used, it notes it, although an invalid redeclaration may diagnose
// for other reasons too.
auto ResolvePrevInstForMerge(Context& context, Parse::NodeId node_id,
SemIR::InstId prev_inst_id) -> InstForMerge;
auto ResolvePrevInstForMerge(Context& context, SemIR::InstId prev_inst_id)
-> InstForMerge;
// When the prior name lookup result is an import and we are successfully
// merging, replace the name lookup result with the reference in the current
+5 -5
View File
@@ -57,7 +57,7 @@ library "var3" api;
// CHECK:STDERR: fail_var3.carbon:[[@LINE+6]]:1: In import.
// CHECK:STDERR: import library "var2";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: var2.carbon:8:5: ERROR: Semantics TODO: `Non-constant ImportRefUsed (comes up with var)`.
// CHECK:STDERR: var2.carbon:8:5: ERROR: Semantics TODO: `Non-constant ImportRefLoaded (comes up with var)`.
// CHECK:STDERR: var b: () = a_alias;
// CHECK:STDERR: ^
import library "var2";
@@ -109,7 +109,7 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_12 [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded
@@ -140,7 +140,7 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: .b = %import_ref.2
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+9, loc_11 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+9, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+14, unloaded
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded
@@ -199,7 +199,7 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+5, unloaded
// CHECK:STDOUT: %import_ref.2: ref () = import_ref ir1, inst+12, loc_12
// CHECK:STDOUT: %import_ref.2: ref () = import_ref ir1, inst+12, loaded
// CHECK:STDOUT: %a_alias.ref: ref () = name_ref a_alias, %import_ref.2
// CHECK:STDOUT: %a_alias_alias: ref () = bind_alias a_alias_alias, %import_ref.2
// CHECK:STDOUT: %.loc8_9.1: () = tuple_literal ()
@@ -230,7 +230,7 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: .b = %import_ref.2
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: ref () = import_ref ir1, inst+5, loc_15 [template = <error>]
// CHECK:STDOUT: %import_ref.1: ref () = import_ref ir1, inst+5, loaded [template = <error>]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %.loc12_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1]
@@ -89,12 +89,12 @@ var a_val: a = {.v = b_val.v};
// CHECK:STDOUT: .a_val = %a_val
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+12, loc_52 [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+14, loc_38 [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+16, loc_24 [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir1, inst+18, loc_11 [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+12, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+14, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+16, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir1, inst+18, loaded [template = constants.%C]
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.6: <unbound element of class C> = import_ref ir1, inst+7, loc_32 [template = imports.%.1]
// CHECK:STDOUT: %import_ref.6: <unbound element of class C> = import_ref ir1, inst+7, loaded [template = imports.%.1]
// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %d.ref: type = name_ref d, %import_ref.5 [template = constants.%C]
// CHECK:STDOUT: %d_val.var: ref C = var d_val
+1 -1
View File
@@ -54,7 +54,7 @@ var b: Bool() = false;
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Bool = import_ref ir1, inst+3, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: Bool = import_ref ir1, inst+3, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Bool.ref: Bool = name_ref Bool, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %bool.make_type: init type = call %Bool.ref() [template = bool]
+2 -2
View File
@@ -82,7 +82,7 @@ var dyn: Float(dyn_size);
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: .GetFloat = %GetFloat.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loc_11 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Float.ref: Float = name_ref Float, %import_ref [template = constants.%struct.1]
// CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.2]
@@ -135,7 +135,7 @@ var dyn: Float(dyn_size);
// CHECK:STDOUT: .dyn_size = %dyn_size
// CHECK:STDOUT: .dyn = %dyn
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: Float = import_ref ir1, inst+5, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Float.ref.loc10: Float = name_ref Float, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %.loc10_26: i32 = int_literal 32 [template = constants.%.2]
+1 -1
View File
@@ -54,7 +54,7 @@ var i: Int() = 0;
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .i = %i
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+3, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+3, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Int.ref: Int = name_ref Int, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %int.make_type_32: init type = call %Int.ref() [template = i32]
@@ -116,7 +116,7 @@ var m: Int(1000000000);
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: .Symbolic = %Symbolic.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_13 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {
// CHECK:STDOUT: %Int.ref.loc6_9: Int = name_ref Int, %import_ref [template = constants.%struct.1]
@@ -202,7 +202,7 @@ var m: Int(1000000000);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .n = %n
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Int.ref: Int = name_ref Int, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %.loc10_12: i32 = int_literal 0 [template = constants.%.2]
@@ -234,7 +234,7 @@ var m: Int(1000000000);
// CHECK:STDOUT: .Negate = %Negate.decl
// CHECK:STDOUT: .n = %n.loc12
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_23 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Negate.decl: Negate = fn_decl @Negate [template = constants.%struct.1] {
// CHECK:STDOUT: %n.loc6_11.1: i32 = param n
@@ -273,7 +273,7 @@ var m: Int(1000000000);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .m = %m
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: Int = import_ref ir1, inst+5, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Int.ref: Int = name_ref Int, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %.loc9_12: i32 = int_literal 1000000000 [template = constants.%.2]
@@ -116,7 +116,7 @@ var m: UInt(1000000000);
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: .Symbolic = %Symbolic.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_13 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {
// CHECK:STDOUT: %UInt.ref.loc6_9: UInt = name_ref UInt, %import_ref [template = constants.%struct.1]
@@ -202,7 +202,7 @@ var m: UInt(1000000000);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .n = %n
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %UInt.ref: UInt = name_ref UInt, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %.loc10_13: i32 = int_literal 0 [template = constants.%.2]
@@ -234,7 +234,7 @@ var m: UInt(1000000000);
// CHECK:STDOUT: .Negate = %Negate.decl
// CHECK:STDOUT: .n = %n.loc12
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_23 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Negate.decl: Negate = fn_decl @Negate [template = constants.%struct.1] {
// CHECK:STDOUT: %n.loc6_11.1: i32 = param n
@@ -273,7 +273,7 @@ var m: UInt(1000000000);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .m = %m
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: UInt = import_ref ir1, inst+5, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %UInt.ref: UInt = name_ref UInt, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %.loc9_13: i32 = int_literal 1000000000 [template = constants.%.2]
+4 -4
View File
@@ -184,7 +184,7 @@ var c: Other.C = {};
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, %Other [template = %Other]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_14 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C]
@@ -222,7 +222,7 @@ var c: Other.C = {};
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, %Other [template = %Other]
// CHECK:STDOUT: %import_ref: type = import_ref ir2, inst+2, loc_14 [template = constants.%C]
// CHECK:STDOUT: %import_ref: type = import_ref ir2, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref [template = constants.%C]
// CHECK:STDOUT: %c.var: ref <error> = var c
@@ -257,7 +257,7 @@ var c: Other.C = {};
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, %Other [template = %Other]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_19 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+2, unloaded
@@ -299,7 +299,7 @@ var c: Other.C = {};
// CHECK:STDOUT: %Other: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, %Other [template = %Other]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_19 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded
+1 -1
View File
@@ -85,7 +85,7 @@ var a: Incomplete;
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%Empty]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_15 [template = constants.%Incomplete]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%Incomplete]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %Empty.decl.loc16: type = class_decl @Empty [template = constants.%Empty] {
+7 -7
View File
@@ -156,18 +156,18 @@ fn Run() {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_16 [template = constants.%Empty]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_24 [template = constants.%Field]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loc_42 [template = constants.%ForwardDeclared.1]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+31, loc_71 [template = constants.%Incomplete]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%Empty]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%Field]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loaded [template = constants.%ForwardDeclared.1]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+31, loaded [template = constants.%Incomplete]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+6, unloaded
// CHECK:STDOUT: %import_ref.7: <unbound element of class Field> = import_ref ir1, inst+8, loc_36 [template = imports.%.1]
// CHECK:STDOUT: %import_ref.7: <unbound element of class Field> = import_ref ir1, inst+8, loaded [template = imports.%.1]
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+13, unloaded
// CHECK:STDOUT: %import_ref.9: G = import_ref ir1, inst+28, loc_56 [template = constants.%struct.6]
// CHECK:STDOUT: %import_ref.10: F = import_ref ir1, inst+18, loc_50 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.9: G = import_ref ir1, inst+28, loaded [template = constants.%struct.6]
// CHECK:STDOUT: %import_ref.10: F = import_ref ir1, inst+18, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.11 = import_ref ir1, inst+13, unloaded
// CHECK:STDOUT: %import_ref.12 = import_ref ir1, inst+28, unloaded
// CHECK:STDOUT: %import_ref.13 = import_ref ir1, inst+18, unloaded
+3 -3
View File
@@ -129,12 +129,12 @@ fn Run() {
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+25, loc_16 [template = constants.%Child]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+25, loaded [template = constants.%Child]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref.3: F = import_ref ir1, inst+7, loc_44 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.3: F = import_ref ir1, inst+7, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.5: <unbound element of class Base> = import_ref ir1, inst+18, loc_38 [template = imports.%.1]
// CHECK:STDOUT: %import_ref.5: <unbound element of class Base> = import_ref ir1, inst+18, loaded [template = imports.%.1]
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+14, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+26, unloaded
+10 -10
View File
@@ -136,7 +136,7 @@ var ptr: E* = &val;
// CHECK:STDOUT: .b_val = %b_val
// CHECK:STDOUT: .b_ptr = %b_ptr
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_12 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded
@@ -187,7 +187,7 @@ var ptr: E* = &val;
// CHECK:STDOUT: .c_val = %c_val
// CHECK:STDOUT: .c_ptr = %c_ptr
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_12 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded
@@ -240,8 +240,8 @@ var ptr: E* = &val;
// CHECK:STDOUT: .val = %val
// CHECK:STDOUT: .ptr = %ptr
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_15 [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+8, loc_23 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+13, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+23, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
@@ -294,10 +294,10 @@ var ptr: E* = &val;
// CHECK:STDOUT: .val = %val
// CHECK:STDOUT: .ptr = %ptr
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loc_23 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+13, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+2, loc_15 [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+2, loaded [template = constants.%C]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+3, unloaded
@@ -350,10 +350,10 @@ var ptr: E* = &val;
// CHECK:STDOUT: .val = %val
// CHECK:STDOUT: .ptr = %ptr
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loc_15 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+13, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loc_23 [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+13, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+23, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
@@ -408,10 +408,10 @@ var ptr: E* = &val;
// CHECK:STDOUT: .val = %val
// CHECK:STDOUT: .ptr = %ptr
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loc_23 [template = constants.%C]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+13, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loc_15 [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+13, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+23, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
+1 -1
View File
@@ -67,7 +67,7 @@ fn Run() {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loc_16 [template = constants.%Cycle]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+2, loaded [template = constants.%Cycle]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct] {}
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+8, unloaded
+2 -2
View File
@@ -86,11 +86,11 @@ fn Run() {
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.2: ref {.b: Cycle*} = import_ref ir1, inst+12, loc_14
// CHECK:STDOUT: %import_ref.2: ref {.b: Cycle*} = import_ref ir1, inst+12, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct] {}
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: <unbound element of class Cycle> = import_ref ir1, inst+19, loc_24 [template = imports.%.1]
// CHECK:STDOUT: %import_ref.4: <unbound element of class Cycle> = import_ref ir1, inst+19, loaded [template = imports.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Cycle {
+2 -2
View File
@@ -83,8 +83,8 @@ var a_ptr: const i32* = a_ptr_ref;
// CHECK:STDOUT: .a_ptr = %a_ptr
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+5, unloaded
// CHECK:STDOUT: %import_ref.2: ref const i32 = import_ref ir0, inst+11, loc_12
// CHECK:STDOUT: %import_ref.3: ref const i32* = import_ref ir0, inst+19, loc_22
// CHECK:STDOUT: %import_ref.2: ref const i32 = import_ref ir0, inst+11, loaded
// CHECK:STDOUT: %import_ref.3: ref const i32* = import_ref ir0, inst+19, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_8: type = const_type i32 [template = constants.%.1]
// CHECK:STDOUT: %.loc6_17: type = ptr_type const i32 [template = constants.%.2]
@@ -104,10 +104,10 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_9 [template = constants.%.1]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir2, inst+24, loc_36 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.1]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir2, inst+24, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_10 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.1] {}
@@ -115,7 +115,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_36 [template = constants.%.1]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.1]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %.1: Op = interface_witness_access @impl.%.1, element0 [template = constants.%struct.1]
// CHECK:STDOUT: %.loc10_18: <bound method> = bound_method %.loc10_16, %.1 [template = constants.%.8]
@@ -123,7 +123,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.10]
// CHECK:STDOUT: %arr.var: ref [i32; 3] = var arr
// CHECK:STDOUT: %arr: ref [i32; 3] = bind_name arr, %arr.var
// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_47 [template = constants.%.1]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loaded [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Add {
+1 -1
View File
@@ -64,7 +64,7 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %import_ref: Add = import_ref ir2, inst+6, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: Add = import_ref ir2, inst+6, loaded [template = constants.%struct]
// CHECK:STDOUT: %Add.ref: Add = name_ref Add, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %.loc4_25: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_28: i32 = int_literal 2 [template = constants.%.3]
+27 -48
View File
@@ -240,7 +240,7 @@ var c: {.c: i32} = C((1,));
var d: () = D();
var e: () = NS.E();
// --- fail_decl_after_use.carbon
// --- decl_after_use.carbon
library "decl_after_use" api;
@@ -248,34 +248,20 @@ import library "extern_api";
var a: () = A();
// CHECK:STDERR: fail_decl_after_use.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of imported entity that was previously used.
// CHECK:STDERR: fn A();
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_decl_after_use.carbon:[[@LINE-5]]:13: Import used here.
// CHECK:STDERR: var a: () = A();
// CHECK:STDERR: ^
// CHECK:STDERR:
fn A();
// --- fail_decl_after_use_two_errors.carbon
// --- fail_redecl_mismatch_after_use.carbon
library "decl_after_use_two_errors" api;
library "redecl_mismatch_after_use" api;
import library "extern_api";
var a: () = A();
// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE+17]]:1: ERROR: Redeclaration of imported entity that was previously used.
// CHECK:STDERR: fail_redecl_mismatch_after_use.carbon:[[@LINE+10]]:1: ERROR: Function redeclaration differs because return type is `i32`.
// CHECK:STDERR: fn A() -> i32;
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE-5]]:13: Import used here.
// CHECK:STDERR: var a: () = A();
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE+10]]:1: ERROR: Function redeclaration differs because return type is `i32`.
// CHECK:STDERR: fn A() -> i32;
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_decl_after_use_two_errors.carbon:[[@LINE-14]]:1: In import.
// CHECK:STDERR: fail_redecl_mismatch_after_use.carbon:[[@LINE-7]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:4:1: Previously declared with no return type.
@@ -284,7 +270,7 @@ var a: () = A();
// CHECK:STDERR:
fn A() -> i32;
// --- fail_extern_after_use.carbon
// --- todo_fail_extern_after_use.carbon
library "extern_after_use" api;
@@ -292,13 +278,6 @@ import library "api";
var a: () = A();
// CHECK:STDERR: fail_extern_after_use.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of imported entity that was previously used.
// CHECK:STDERR: extern fn A();
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_extern_after_use.carbon:[[@LINE-5]]:13: Import used here.
// CHECK:STDERR: var a: () = A();
// CHECK:STDERR: ^
// CHECK:STDERR:
extern fn A();
// --- unloaded.carbon
@@ -538,15 +517,15 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_24 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_39 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_53 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_65 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
@@ -869,15 +848,15 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_19 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_28 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_43 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_57 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_69 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+9, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+23, unloaded
@@ -973,15 +952,15 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_19 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_28 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_43 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_57 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_69 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+9, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+23, unloaded
@@ -1043,7 +1022,7 @@ import library "extern_api";
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_decl_after_use.carbon
// CHECK:STDOUT: --- decl_after_use.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type () [template]
@@ -1061,7 +1040,7 @@ import library "extern_api";
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct]
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
@@ -1088,7 +1067,7 @@ import library "extern_api";
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_decl_after_use_two_errors.carbon
// CHECK:STDOUT: --- fail_redecl_mismatch_after_use.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type () [template]
@@ -1108,7 +1087,7 @@ import library "extern_api";
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
@@ -1139,7 +1118,7 @@ import library "extern_api";
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_extern_after_use.carbon
// CHECK:STDOUT: --- todo_fail_extern_after_use.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type () [template]
@@ -1157,7 +1136,7 @@ import library "extern_api";
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct]
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
@@ -179,10 +179,10 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3: ReturnCUnused = import_ref ir1, inst+7, loc_14 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: ReturnCUsed = import_ref ir1, inst+13, loc_18 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.5: ReturnDUnused = import_ref ir1, inst+18, loc_22 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.6: ReturnDUsed = import_ref ir1, inst+23, loc_26 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.3: ReturnCUnused = import_ref ir1, inst+7, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: ReturnCUsed = import_ref ir1, inst+13, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.5: ReturnDUnused = import_ref ir1, inst+18, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.6: ReturnDUsed = import_ref ir1, inst+23, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %CallFAndGIncomplete.decl: CallFAndGIncomplete = fn_decl @CallFAndGIncomplete [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+4, unloaded
+3 -3
View File
@@ -204,9 +204,9 @@ fn D() {}
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loc_24 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+26, loc_39 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+26, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+38, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
+4 -4
View File
@@ -121,18 +121,18 @@ fn G(c: Impl.C) {
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+14, unloaded
// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.2] {}
// CHECK:STDOUT: %import_ref.2: <associated F in HasF> = import_ref ir1, inst+11, loc_20 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.2: <associated F in HasF> = import_ref ir1, inst+11, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+4, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+6, unloaded
// CHECK:STDOUT: %import_ref.5: <witness> = import_ref ir1, inst+22, loc_22 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+13, loc_10 [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: <witness> = import_ref ir1, inst+22, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+13, loaded [template = constants.%C]
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.1] {
// CHECK:STDOUT: %Impl.ref: <namespace> = name_ref Impl, %Impl [template = %Impl]
// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.6 [template = constants.%C]
// CHECK:STDOUT: %c.loc4_6.1: C = param c
// CHECK:STDOUT: @G.%c: C = bind_name c, %c.loc4_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+2, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+2, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+6, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -117,18 +117,18 @@ fn G(c: Impl.C) {
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+13, unloaded
// CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.2] {}
// CHECK:STDOUT: %import_ref.2: <associated F in HasF> = import_ref ir1, inst+10, loc_20 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.2: <associated F in HasF> = import_ref ir1, inst+10, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+5, unloaded
// CHECK:STDOUT: %import_ref.5: <witness> = import_ref ir1, inst+21, loc_22 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+12, loc_10 [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: <witness> = import_ref ir1, inst+21, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+12, loaded [template = constants.%C]
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.1] {
// CHECK:STDOUT: %Impl.ref: <namespace> = name_ref Impl, %Impl [template = %Impl]
// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.6 [template = constants.%C]
// CHECK:STDOUT: %c.loc4_6.1: C = param c
// CHECK:STDOUT: @G.%c: C = bind_name c, %c.loc4_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+5, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -96,10 +96,10 @@ fn F(x: (), y: ()) -> () {
// CHECK:STDOUT: .Add = %import_ref.1
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loc_13 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir1, inst+24, loc_58 [template = constants.%.5]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir1, inst+24, loaded [template = constants.%.5]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir1, inst+19, loc_14 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir1, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %.loc6_7.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.1 [template = constants.%.1]
@@ -174,10 +174,10 @@ var f: ForwardDeclared* = &f_ref.f;
// CHECK:STDOUT: .UseForwardDeclaredF = %UseForwardDeclaredF
// CHECK:STDOUT: .f = %f.loc16
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loc_13 [template = constants.%.1]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loc_22 [template = constants.%.3]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+20, loc_31 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir1, inst+42, loc_70
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.1]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%.3]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+20, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir1, inst+42, loaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %UseEmpty.decl: UseEmpty = fn_decl @UseEmpty [template = constants.%struct.1] {
// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {}
@@ -186,8 +186,8 @@ var f: ForwardDeclared* = &f_ref.f;
// CHECK:STDOUT: @UseEmpty.%e: Empty = bind_name e, %e.loc6_13.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+7, unloaded
// CHECK:STDOUT: %import_ref.7: <associated F in Basic> = import_ref ir1, inst+18, loc_48 [template = constants.%.8]
// CHECK:STDOUT: %import_ref.8: <associated type in Basic> = import_ref ir1, inst+11, loc_41 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.7: <associated F in Basic> = import_ref ir1, inst+18, loaded [template = constants.%.8]
// CHECK:STDOUT: %import_ref.8: <associated type in Basic> = import_ref ir1, inst+11, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.9 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir1, inst+13, unloaded
// CHECK:STDOUT: %UseBasic.decl: UseBasic = fn_decl @UseBasic [template = constants.%struct.2] {
@@ -197,8 +197,8 @@ var f: ForwardDeclared* = &f_ref.f;
// CHECK:STDOUT: @UseBasic.%e: Basic = bind_name e, %e.loc7_13.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.12: <associated F in ForwardDeclared> = import_ref ir1, inst+32, loc_62 [template = constants.%.12]
// CHECK:STDOUT: %import_ref.13: <associated type in ForwardDeclared> = import_ref ir1, inst+26, loc_55 [template = constants.%.10]
// CHECK:STDOUT: %import_ref.12: <associated F in ForwardDeclared> = import_ref ir1, inst+32, loaded [template = constants.%.12]
// CHECK:STDOUT: %import_ref.13: <associated type in ForwardDeclared> = import_ref ir1, inst+26, loaded [template = constants.%.10]
// CHECK:STDOUT: %import_ref.14 = import_ref ir1, inst+24, unloaded
// CHECK:STDOUT: %import_ref.15 = import_ref ir1, inst+28, unloaded
// CHECK:STDOUT: %UseForwardDeclared.decl: UseForwardDeclared = fn_decl @UseForwardDeclared [template = constants.%struct.3] {
+1 -1
View File
@@ -46,7 +46,7 @@ let a: T = 0;
// CHECK:STDOUT: .T = %import_ref
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loc_7 [symbolic = constants.%T]
// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loaded [symbolic = constants.%T]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %T.ref: type = name_ref T, %import_ref [symbolic = constants.%T]
// CHECK:STDOUT: %.loc8: i32 = int_literal 0 [template = constants.%.1]
+1 -1
View File
@@ -45,7 +45,7 @@ var b: T = *a;
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loc_7 [symbolic = constants.%T]
// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+2, loaded [symbolic = constants.%T]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %import_ref [symbolic = constants.%T]
// CHECK:STDOUT: %.loc4: type = ptr_type T [symbolic = constants.%.1]
+1 -1
View File
@@ -44,7 +44,7 @@ let b:! bool = a;
// CHECK:STDOUT: .a = %import_ref
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: bool = import_ref ir0, inst+2, loc_10 [symbolic = constants.%a]
// CHECK:STDOUT: %import_ref: bool = import_ref ir0, inst+2, loaded [symbolic = constants.%a]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %a.ref: bool = name_ref a, %import_ref [symbolic = constants.%a]
// CHECK:STDOUT: %b: bool = bind_symbolic_name b 0, %a.ref [symbolic = constants.%b]
+2 -2
View File
@@ -83,8 +83,8 @@ var package_b: () = package.NS.ChildNS.B();
// CHECK:STDOUT: %ChildNS: <namespace> = namespace %import_ref.2, [template] {
// CHECK:STDOUT: .B = %import_ref.4
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.3: A = import_ref ir0, inst+4, loc_13 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.4: B = import_ref ir0, inst+8, loc_27 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: A = import_ref ir0, inst+4, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.4: B = import_ref ir0, inst+8, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc4_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
@@ -143,7 +143,7 @@ var e: () = A.B.C.D();
// CHECK:STDOUT: %C: <namespace> = namespace %import_ref.3, [template] {
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+8, loc_23 [template = constants.%struct]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+8, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc5_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc5_9.2: type = converted %.loc5_9.1, constants.%.1 [template = constants.%.1]
+3 -3
View File
@@ -131,9 +131,9 @@ fn Run() {
// CHECK:STDOUT: .B2 = %import_ref.4
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.2: A = import_ref ir1, inst+3, loc_33 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: B1 = import_ref ir2, inst+3, loc_39 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4: B2 = import_ref ir2, inst+9, loc_45 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.2: A = import_ref ir1, inst+3, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: B1 = import_ref ir2, inst+3, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4: B2 = import_ref ir2, inst+9, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc7: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.1] {}
+8 -8
View File
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {}
// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in AddAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in AddAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitAnd> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitAnd> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %BitAnd.decl: type = interface_decl @BitAnd [template = constants.%.2] {}
// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in BitAndAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in BitAndAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -103,10 +103,10 @@ fn TestOp(a: C) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitComplement> = import_ref ir2, inst+19, loc_50 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitComplement> = import_ref ir2, inst+19, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
@@ -120,7 +120,7 @@ fn TestOp(a: C) -> C {
// CHECK:STDOUT: %C.ref.loc14_20: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_50 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+14, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitOr> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitOr> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %BitOr.decl: type = interface_decl @BitOr [template = constants.%.2] {}
// CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in BitOrAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in BitOrAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitXor> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in BitXor> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %BitXor.decl: type = interface_decl @BitXor [template = constants.%.2] {}
// CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in BitXorAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in BitXorAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4 -4
View File
@@ -103,10 +103,10 @@ fn TestOp() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Dec> = import_ref ir2, inst+18, loc_47 [template = constants.%.9]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Dec> = import_ref ir2, inst+18, loaded [template = constants.%.9]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
@@ -114,7 +114,7 @@ fn TestOp() {
// CHECK:STDOUT: %Dec.ref: type = name_ref Dec, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %TestOp.decl: TestOp = fn_decl @TestOp [template = constants.%struct.3] {}
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_47 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+13, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+8 -8
View File
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Div> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Div> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Div.decl: type = interface_decl @Div [template = constants.%.2] {}
// CHECK:STDOUT: %Div.ref: type = name_ref Div, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in DivAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in DivAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+18 -18
View File
@@ -194,12 +194,12 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3: <associated Equal in Eq> = import_ref ir2, inst+21, loc_68 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.4: <associated NotEqual in Eq> = import_ref ir2, inst+38, loc_88 [template = constants.%.9]
// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loc_19 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loc_19 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.3: <associated Equal in Eq> = import_ref ir2, inst+21, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.4: <associated NotEqual in Eq> = import_ref ir2, inst+38, loaded [template = constants.%.9]
// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loaded [template = constants.%struct.4]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
@@ -215,7 +215,7 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: @TestEqual.%b: C = bind_name b, %b.loc13_20.1
// CHECK:STDOUT: @TestEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_68 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+16, unloaded
// CHECK:STDOUT: %TestNotEqual.decl: TestNotEqual = fn_decl @TestNotEqual [template = constants.%struct.6] {
// CHECK:STDOUT: %C.ref.loc17_20: type = name_ref C, %C.decl [template = constants.%C]
@@ -226,7 +226,7 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: @TestNotEqual.%b: C = bind_name b, %b.loc17_23.1
// CHECK:STDOUT: @TestNotEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_88 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+34, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -343,10 +343,10 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: @TestEqual.%b: D = bind_name b, %b.loc8_20.1
// CHECK:STDOUT: @TestEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_30 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3: <associated Equal in Eq> = import_ref ir2, inst+21, loc_30 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.4: <associated NotEqual in Eq> = import_ref ir2, inst+38, loc_50 [template = constants.%.8]
// CHECK:STDOUT: %import_ref.3: <associated Equal in Eq> = import_ref ir2, inst+21, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.4: <associated NotEqual in Eq> = import_ref ir2, inst+38, loaded [template = constants.%.8]
// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+16, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+34, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+16, unloaded
@@ -359,7 +359,7 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: @TestNotEqual.%b: D = bind_name b, %b.loc16_23.1
// CHECK:STDOUT: @TestNotEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.8: type = import_ref ir2, inst+1, loc_50 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.8: type = import_ref ir2, inst+1, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+34, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -435,12 +435,12 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_23 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3: <associated Equal in Eq> = import_ref ir2, inst+21, loc_73 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.4: <associated NotEqual in Eq> = import_ref ir2, inst+38, loc_93 [template = constants.%.9]
// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loc_24 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loc_24 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.3: <associated Equal in Eq> = import_ref ir2, inst+21, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.4: <associated NotEqual in Eq> = import_ref ir2, inst+38, loaded [template = constants.%.9]
// CHECK:STDOUT: %import_ref.5: Equal = import_ref ir2, inst+16, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.6: NotEqual = import_ref ir2, inst+34, loaded [template = constants.%struct.4]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
@@ -456,7 +456,7 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: @TestRhsBad.%b: D = bind_name b, %b.loc14_21.1
// CHECK:STDOUT: @TestRhsBad.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_73 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+16, unloaded
// CHECK:STDOUT: %TestLhsBad.decl: TestLhsBad = fn_decl @TestLhsBad [template = constants.%struct.6] {
// CHECK:STDOUT: %D.ref.loc25: type = name_ref D, %D.decl [template = constants.%D]
@@ -467,7 +467,7 @@ fn TestLhsBad(a: D, b: C) -> bool {
// CHECK:STDOUT: @TestLhsBad.%b: C = bind_name b, %b.loc25_21.1
// CHECK:STDOUT: @TestLhsBad.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_93 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+34, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -170,20 +170,20 @@ fn TestAddAssignNonRef(a: C, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Inc> = import_ref ir2, inst+18, loc_65 [template = constants.%.12]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Inc> = import_ref ir2, inst+18, loaded [template = constants.%.12]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Inc.decl: type = interface_decl @Inc [template = constants.%.2] {}
// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+20, loc_38 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: <associated Op in AddAssign> = import_ref ir2, inst+41, loc_82 [template = constants.%.14]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+20, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: <associated Op in AddAssign> = import_ref ir2, inst+41, loaded [template = constants.%.14]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+37, loc_39 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+37, loaded [template = constants.%struct.4]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc11: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc11: <namespace> = name_ref Core, %Core [template = %Core]
@@ -195,7 +195,7 @@ fn TestAddAssignNonRef(a: C, b: C) {
// CHECK:STDOUT: %a.loc15_18.1: C = param a
// CHECK:STDOUT: @TestIncNonRef.%a: C = bind_name a, %a.loc15_18.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_65 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+13, unloaded
// CHECK:STDOUT: %TestAddAssignNonRef.decl: TestAddAssignNonRef = fn_decl @TestAddAssignNonRef [template = constants.%struct.6] {
// CHECK:STDOUT: %C.ref.loc26_27: type = name_ref C, %C.decl [template = constants.%C]
@@ -205,7 +205,7 @@ fn TestAddAssignNonRef(a: C, b: C) {
// CHECK:STDOUT: %b.loc26_30.1: C = param b
// CHECK:STDOUT: @TestAddAssignNonRef.%b: C = bind_name b, %b.loc26_30.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+20, loc_82 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+20, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+37, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -256,8 +256,8 @@ fn TestRef(b: C) {
// CHECK:STDOUT: %C.ref.loc8_23: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestUnary.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_25 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.2: <associated Op in Negate> = import_ref ir2, inst+15, loc_25 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.2: <associated Op in Negate> = import_ref ir2, inst+15, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+10, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+10, unloaded
@@ -271,8 +271,8 @@ fn TestRef(b: C) {
// CHECK:STDOUT: %C.ref.loc16_30: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestBinary.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: type = import_ref ir2, inst+17, loc_45 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.7: <associated Op in Add> = import_ref ir2, inst+39, loc_45 [template = constants.%.9]
// CHECK:STDOUT: %import_ref.6: type = import_ref ir2, inst+17, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.7: <associated Op in Add> = import_ref ir2, inst+39, loaded [template = constants.%.9]
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+35, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+35, unloaded
@@ -281,13 +281,13 @@ fn TestRef(b: C) {
// CHECK:STDOUT: %b.loc24_12.1: C = param b
// CHECK:STDOUT: @TestRef.%b: C = bind_name b, %b.loc24_12.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+41, loc_66 [template = constants.%.10]
// CHECK:STDOUT: %import_ref.12: <associated Op in AddAssign> = import_ref ir2, inst+62, loc_66 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+41, loaded [template = constants.%.10]
// CHECK:STDOUT: %import_ref.12: <associated Op in AddAssign> = import_ref ir2, inst+62, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+58, unloaded
// CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+58, unloaded
// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+64, loc_69 [template = constants.%.14]
// CHECK:STDOUT: %import_ref.17: <associated Op in Inc> = import_ref ir2, inst+80, loc_69 [template = constants.%.17]
// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+64, loaded [template = constants.%.14]
// CHECK:STDOUT: %import_ref.17: <associated Op in Inc> = import_ref ir2, inst+80, loaded [template = constants.%.17]
// CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+66, unloaded
// CHECK:STDOUT: %import_ref.19 = import_ref ir2, inst+76, unloaded
// CHECK:STDOUT: %import_ref.20 = import_ref ir2, inst+76, unloaded
@@ -181,20 +181,20 @@ fn TestAssign(b: D) {
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_23 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir2, inst+24, loc_81 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_24 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc9: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {}
// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.5]
// CHECK:STDOUT: %import_ref.6: <associated Op in AddAssign> = import_ref ir2, inst+47, loc_102 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.5]
// CHECK:STDOUT: %import_ref.6: <associated Op in AddAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.4]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc12: <namespace> = name_ref Core, %Core [template = %Core]
@@ -211,14 +211,14 @@ fn TestAssign(b: D) {
// CHECK:STDOUT: %C.ref.loc16_24: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @Test.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_81 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.6] {
// CHECK:STDOUT: %D.ref.loc27: type = name_ref D, %D.decl [template = constants.%D]
// CHECK:STDOUT: %b.loc27_15.1: D = param b
// CHECK:STDOUT: @TestAssign.%b: D = bind_name b, %b.loc27_15.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_102 [template = constants.%.5]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.5]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4 -4
View File
@@ -103,10 +103,10 @@ fn TestOp() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Inc> = import_ref ir2, inst+18, loc_47 [template = constants.%.9]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Inc> = import_ref ir2, inst+18, loaded [template = constants.%.9]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+13, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
@@ -114,7 +114,7 @@ fn TestOp() {
// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %TestOp.decl: TestOp = fn_decl @TestOp [template = constants.%struct.3] {}
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_47 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+13, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in LeftShift> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in LeftShift> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %LeftShift.decl: type = interface_decl @LeftShift [template = constants.%.2] {}
// CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in LeftShiftAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in LeftShiftAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+8 -8
View File
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Mod> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Mod> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Mod.decl: type = interface_decl @Mod [template = constants.%.2] {}
// CHECK:STDOUT: %Mod.ref: type = name_ref Mod, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in ModAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in ModAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+8 -8
View File
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Mul> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Mul> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Mul.decl: type = interface_decl @Mul [template = constants.%.2] {}
// CHECK:STDOUT: %Mul.ref: type = name_ref Mul, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in MulAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in MulAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -103,10 +103,10 @@ fn TestOp(a: C) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Negate> = import_ref ir2, inst+19, loc_50 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Negate> = import_ref ir2, inst+19, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+14, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
@@ -120,7 +120,7 @@ fn TestOp(a: C) -> C {
// CHECK:STDOUT: %C.ref.loc14_20: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_50 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+14, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+21 -21
View File
@@ -250,16 +250,16 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated GreaterOrEquivalent in Ordered> = import_ref ir2, inst+72, loc_158 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated GreaterOrEquivalent in Ordered> = import_ref ir2, inst+72, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: <associated Greater in Ordered> = import_ref ir2, inst+55, loc_138 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.5: <associated Less in Ordered> = import_ref ir2, inst+21, loc_98 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: <associated LessOrEquivalent in Ordered> = import_ref ir2, inst+38, loc_118 [template = constants.%.9]
// CHECK:STDOUT: %import_ref.7: Less = import_ref ir2, inst+16, loc_19 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: LessOrEquivalent = import_ref ir2, inst+34, loc_19 [template = constants.%struct.6]
// CHECK:STDOUT: %import_ref.9: Greater = import_ref ir2, inst+51, loc_19 [template = constants.%struct.7]
// CHECK:STDOUT: %import_ref.10: GreaterOrEquivalent = import_ref ir2, inst+68, loc_19 [template = constants.%struct.8]
// CHECK:STDOUT: %import_ref.4: <associated Greater in Ordered> = import_ref ir2, inst+55, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.5: <associated Less in Ordered> = import_ref ir2, inst+21, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.6: <associated LessOrEquivalent in Ordered> = import_ref ir2, inst+38, loaded [template = constants.%.9]
// CHECK:STDOUT: %import_ref.7: Less = import_ref ir2, inst+16, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: LessOrEquivalent = import_ref ir2, inst+34, loaded [template = constants.%struct.6]
// CHECK:STDOUT: %import_ref.9: Greater = import_ref ir2, inst+51, loaded [template = constants.%struct.7]
// CHECK:STDOUT: %import_ref.10: GreaterOrEquivalent = import_ref ir2, inst+68, loaded [template = constants.%struct.8]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
@@ -275,7 +275,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestLess.%b: C = bind_name b, %b.loc15_19.1
// CHECK:STDOUT: @TestLess.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+1, loc_98 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+16, unloaded
// CHECK:STDOUT: %TestLessEqual.decl: TestLessEqual = fn_decl @TestLessEqual [template = constants.%struct.10] {
// CHECK:STDOUT: %C.ref.loc19_21: type = name_ref C, %C.decl [template = constants.%C]
@@ -286,7 +286,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestLessEqual.%b: C = bind_name b, %b.loc19_24.1
// CHECK:STDOUT: @TestLessEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.13: type = import_ref ir2, inst+1, loc_118 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.13: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+34, unloaded
// CHECK:STDOUT: %TestGreater.decl: TestGreater = fn_decl @TestGreater [template = constants.%struct.11] {
// CHECK:STDOUT: %C.ref.loc23_19: type = name_ref C, %C.decl [template = constants.%C]
@@ -297,7 +297,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestGreater.%b: C = bind_name b, %b.loc23_22.1
// CHECK:STDOUT: @TestGreater.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.15: type = import_ref ir2, inst+1, loc_138 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.15: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.16 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: %TestGreaterEqual.decl: TestGreaterEqual = fn_decl @TestGreaterEqual [template = constants.%struct.12] {
// CHECK:STDOUT: %C.ref.loc27_24: type = name_ref C, %C.decl [template = constants.%C]
@@ -308,7 +308,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestGreaterEqual.%b: C = bind_name b, %b.loc27_27.1
// CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.17: type = import_ref ir2, inst+1, loc_158 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.17: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+68, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -493,12 +493,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestLess.%b: D = bind_name b, %b.loc8_19.1
// CHECK:STDOUT: @TestLess.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_30 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.2: <associated GreaterOrEquivalent in Ordered> = import_ref ir2, inst+72, loc_90 [template = constants.%.12]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.2: <associated GreaterOrEquivalent in Ordered> = import_ref ir2, inst+72, loaded [template = constants.%.12]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: <associated Greater in Ordered> = import_ref ir2, inst+55, loc_70 [template = constants.%.10]
// CHECK:STDOUT: %import_ref.5: <associated Less in Ordered> = import_ref ir2, inst+21, loc_30 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated LessOrEquivalent in Ordered> = import_ref ir2, inst+38, loc_50 [template = constants.%.8]
// CHECK:STDOUT: %import_ref.4: <associated Greater in Ordered> = import_ref ir2, inst+55, loaded [template = constants.%.10]
// CHECK:STDOUT: %import_ref.5: <associated Less in Ordered> = import_ref ir2, inst+21, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated LessOrEquivalent in Ordered> = import_ref ir2, inst+38, loaded [template = constants.%.8]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+16, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+34, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+51, unloaded
@@ -513,7 +513,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestLessEqual.%b: D = bind_name b, %b.loc16_24.1
// CHECK:STDOUT: @TestLessEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.12: type = import_ref ir2, inst+1, loc_50 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.12: type = import_ref ir2, inst+1, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+34, unloaded
// CHECK:STDOUT: %TestGreater.decl: TestGreater = fn_decl @TestGreater [template = constants.%struct.5] {
// CHECK:STDOUT: %D.ref.loc24_19: type = name_ref D, %D.decl [template = constants.%D]
@@ -524,7 +524,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestGreater.%b: D = bind_name b, %b.loc24_22.1
// CHECK:STDOUT: @TestGreater.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.14: type = import_ref ir2, inst+1, loc_70 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.14: type = import_ref ir2, inst+1, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: %TestGreaterEqual.decl: TestGreaterEqual = fn_decl @TestGreaterEqual [template = constants.%struct.7] {
// CHECK:STDOUT: %D.ref.loc32_24: type = name_ref D, %D.decl [template = constants.%D]
@@ -535,7 +535,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
// CHECK:STDOUT: @TestGreaterEqual.%b: D = bind_name b, %b.loc32_27.1
// CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+1, loc_90 [template = constants.%.4]
// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+1, loaded [template = constants.%.4]
// CHECK:STDOUT: %import_ref.17 = import_ref ir2, inst+68, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in RightShift> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in RightShift> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %RightShift.decl: type = interface_decl @RightShift [template = constants.%.2] {}
// CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in RightShiftAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in RightShiftAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
+8 -8
View File
@@ -167,20 +167,20 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Sub> = import_ref ir2, inst+24, loc_82 [template = constants.%.11]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.2: <associated Op in Sub> = import_ref ir2, inst+24, loaded [template = constants.%.11]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_19 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl.1 {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc8: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Sub.decl: type = interface_decl @Sub [template = constants.%.2] {}
// CHECK:STDOUT: %Sub.ref: type = name_ref Sub, %import_ref.1 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loc_46 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in SubAssign> = import_ref ir2, inst+47, loc_101 [template = constants.%.13]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.6: <associated Op in SubAssign> = import_ref ir2, inst+47, loaded [template = constants.%.13]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+28, unloaded
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loc_47 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.8: Op = import_ref ir2, inst+43, loaded [template = constants.%struct.5]
// CHECK:STDOUT: impl_decl @impl.2 {
// CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %Core.ref.loc13: <namespace> = name_ref Core, %Core [template = %Core]
@@ -197,7 +197,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @TestOp.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %TestAssign.decl: TestAssign = fn_decl @TestAssign [template = constants.%struct.7] {
// CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C]
@@ -208,7 +208,7 @@ fn TestAssign(a: C*, b: C) {
// CHECK:STDOUT: %b.loc21_22.1: C = param b
// CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loc_101 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+26, loaded [template = constants.%.6]
// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -296,8 +296,8 @@ fn Other.G() {}
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loc_22 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.2: F2 = import_ref ir3, inst+2, loc_28 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.2: F2 = import_ref ir3, inst+2, loaded [template = constants.%struct.3]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
@@ -334,7 +334,7 @@ fn Other.G() {}
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loc_22 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -378,7 +378,7 @@ fn Other.G() {}
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Other: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loc_22 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.1: F = import_ref ir2, inst+2, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+4, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -81,10 +81,10 @@ var d: i32 = d_ref;
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: ref <error> = import_ref ir0, inst+4, loc_10
// CHECK:STDOUT: %import_ref.2: ref <error> = import_ref ir0, inst+9, loc_17
// CHECK:STDOUT: %import_ref.3: ref <error> = import_ref ir0, inst+13, loc_24
// CHECK:STDOUT: %import_ref.4: ref <error> = import_ref ir0, inst+17, loc_31
// CHECK:STDOUT: %import_ref.1: ref <error> = import_ref ir0, inst+4, loaded
// CHECK:STDOUT: %import_ref.2: ref <error> = import_ref ir0, inst+9, loaded
// CHECK:STDOUT: %import_ref.3: ref <error> = import_ref ir0, inst+13, loaded
// CHECK:STDOUT: %import_ref.4: ref <error> = import_ref ir0, inst+17, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %a.var: ref i32 = var a
// CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var
+2 -2
View File
@@ -68,7 +68,7 @@ var package_b: () = package.B();
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .package_a = %package_a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+2, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+2, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc4_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
@@ -128,7 +128,7 @@ var package_b: () = package.B();
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: .package_b = %package_b
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: B = import_ref ir1, inst+2, loc_17 [template = constants.%struct]
// CHECK:STDOUT: %import_ref: B = import_ref ir1, inst+2, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
+1 -1
View File
@@ -62,7 +62,7 @@ var a: i32* = a_ref;
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2: ref i32* = import_ref ir0, inst+10, loc_11
// CHECK:STDOUT: %import_ref.2: ref i32* = import_ref ir0, inst+10, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc4: type = ptr_type i32 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref i32* = var a
+2 -2
View File
@@ -106,8 +106,8 @@ var b: {.a: {.b: i32, .c: (i32,)}, .d: i32} = b_ref;
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: ref {.a: i32} = import_ref ir0, inst+7, loc_15
// CHECK:STDOUT: %import_ref.2: ref {.a: {.b: i32, .c: (i32,)}, .d: i32} = import_ref ir0, inst+38, loc_45
// CHECK:STDOUT: %import_ref.1: ref {.a: i32} = import_ref ir0, inst+7, loaded
// CHECK:STDOUT: %import_ref.2: ref {.a: {.b: i32, .c: (i32,)}, .d: i32} = import_ref ir0, inst+38, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc4: type = struct_type {.a: i32} [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref {.a: i32} = var a
+2 -2
View File
@@ -128,8 +128,8 @@ var b: (((i32,), i32), (i32, i32)) = b_ref;
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: ref (i32,) = import_ref ir0, inst+7, loc_13
// CHECK:STDOUT: %import_ref.2: ref (((i32,), i32), (i32, i32)) = import_ref ir0, inst+35, loc_35
// CHECK:STDOUT: %import_ref.1: ref (i32,) = import_ref ir0, inst+7, loaded
// CHECK:STDOUT: %import_ref.2: ref (((i32,), i32), (i32, i32)) = import_ref ir0, inst+35, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc4_13.1: (type,) = tuple_literal (i32)
// CHECK:STDOUT: %.loc4_13.2: type = converted %.loc4_13.1, constants.%.2 [template = constants.%.2]
+1 -1
View File
@@ -54,7 +54,7 @@ var a: () = a_ref;
// CHECK:STDOUT: .a_ref = %import_ref
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: ref () = import_ref ir0, inst+5, loc_11
// CHECK:STDOUT: %import_ref: ref () = import_ref ir0, inst+5, loaded
// CHECK:STDOUT: %.loc4_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
@@ -148,10 +148,8 @@ CARBON_DIAGNOSTIC_KIND(ImportSelf)
CARBON_DIAGNOSTIC_KIND(ExplicitImportApi)
CARBON_DIAGNOSTIC_KIND(RepeatedImport)
CARBON_DIAGNOSTIC_KIND(FirstImported)
CARBON_DIAGNOSTIC_KIND(UsedImportLoc)
// Merge-related redeclaration checking.
CARBON_DIAGNOSTIC_KIND(RedeclOfUsedImport)
CARBON_DIAGNOSTIC_KIND(RedeclPrevDecl)
CARBON_DIAGNOSTIC_KIND(RedeclRedundant)
CARBON_DIAGNOSTIC_KIND(RedeclNonExtern)
-6
View File
@@ -492,12 +492,6 @@ auto HandleImportRefLoaded(FunctionContext& /*context*/,
FatalErrorIfEncountered(inst);
}
auto HandleImportRefUsed(FunctionContext& /*context*/,
SemIR::InstId /*inst_id*/, SemIR::ImportRefUsed inst)
-> void {
FatalErrorIfEncountered(inst);
}
auto HandleInitializeFrom(FunctionContext& context, SemIR::InstId /*inst_id*/,
SemIR::InitializeFrom inst) -> void {
auto storage_type_id = context.sem_ir().insts().Get(inst.dest_id).type_id();
+2 -5
View File
@@ -438,7 +438,6 @@ static auto StringifyTypeExprImpl(const SemIR::File& outer_sem_ir,
case ImplDecl::Kind:
case ImportRefLoaded::Kind:
case ImportRefUnloaded::Kind:
case ImportRefUsed::Kind:
case InitializeFrom::Kind:
case InterfaceDecl::Kind:
case InterfaceWitness::Kind:
@@ -511,10 +510,8 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory {
case StructTypeField::Kind:
return ExprCategory::NotExpr;
case ImportRefLoaded::Kind:
case ImportRefUsed::Kind: {
auto import_ir_inst = ir->import_ir_insts().Get(
untyped_inst.As<AnyImportRef>().import_ir_inst_id);
case CARBON_KIND(ImportRefLoaded inst): {
auto import_ir_inst = ir->import_ir_insts().Get(inst.import_ir_inst_id);
ir = ir->import_irs().Get(import_ir_inst.ir_id).sem_ir;
inst_id = import_ir_inst.inst_id;
continue;
-4
View File
@@ -637,10 +637,6 @@ class Formatter {
out_ << ", loaded";
}
auto FormatInstructionRHS(ImportRefUsed inst) -> void {
FormatArgs(inst.import_ir_inst_id, inst.used_id);
}
auto FormatInstructionRHS(SpliceBlock inst) -> void {
FormatArgs(inst.result_id);
FormatTrailingBlock(inst.block_id);
+1 -1
View File
@@ -43,7 +43,7 @@ struct InstId : public IdBase, public Printable<InstId> {
static const InstId PackageNamespace;
// Returns the instruction ID for a builtin. This relies on File guarantees
// for builtin ImportRefUsed placement.
// for builtin placement.
static constexpr auto ForBuiltin(BuiltinKind kind) -> InstId {
return InstId(kind.AsInt());
}
-1
View File
@@ -113,7 +113,6 @@ CARBON_SEM_IR_INST_KIND_IMPL(FunctionType, TYPE_ALWAYS, CONSTANT_CONDITIONAL)
CARBON_SEM_IR_INST_KIND_IMPL(ImplDecl, TYPE_NEVER, CONSTANT_NEVER)
CARBON_SEM_IR_INST_KIND_IMPL(ImportRefUnloaded, TYPE_NEVER, CONSTANT_NEVER)
CARBON_SEM_IR_INST_KIND_IMPL(ImportRefLoaded, TYPE_NEVER, CONSTANT_NEVER)
CARBON_SEM_IR_INST_KIND_IMPL(ImportRefUsed, TYPE_NEVER, CONSTANT_NEVER)
CARBON_SEM_IR_INST_KIND_IMPL(InitializeFrom, TYPE_NEVER, CONSTANT_NEVER)
CARBON_SEM_IR_INST_KIND_IMPL(InterfaceDecl, TYPE_NEVER, CONSTANT_NEVER)
CARBON_SEM_IR_INST_KIND_IMPL(InterfaceType, TYPE_ALWAYS, CONSTANT_CONDITIONAL)
+1 -2
View File
@@ -440,8 +440,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id,
break;
}
case ImportRefUnloaded::Kind:
case ImportRefLoaded::Kind:
case ImportRefUsed::Kind: {
case ImportRefLoaded::Kind: {
add_inst_name("import_ref");
// When building import refs, we frequently add instructions without
// a block. Constants that refer to them need to be separately
+2 -15
View File
@@ -506,8 +506,7 @@ struct ImplDecl {
// Common representation for all kinds of `ImportRef*` node.
struct AnyImportRef {
static constexpr InstKind Kinds[] = {InstKind::ImportRefUnloaded,
InstKind::ImportRefLoaded,
InstKind::ImportRefUsed};
InstKind::ImportRefLoaded};
InstKind kind;
ImportIRInstId import_ir_inst_id;
@@ -522,7 +521,7 @@ struct ImportRefUnloaded {
ImportIRInstId import_ir_inst_id;
};
// A imported entity that is loaded, but has not yet had a use associated.
// A imported entity that is loaded, and may be used.
struct ImportRefLoaded {
// No parse node: any parse node logic must use the referenced IR.
static constexpr auto Kind =
@@ -532,18 +531,6 @@ struct ImportRefLoaded {
ImportIRInstId import_ir_inst_id;
};
// An imported entity that has a reference, and thus should be emitted.
struct ImportRefUsed {
// No parse node: any parse node logic must use the referenced IR.
static constexpr auto Kind =
InstKind::ImportRefUsed.Define<Parse::InvalidNodeId>("import_ref");
TypeId type_id;
ImportIRInstId import_ir_inst_id;
// A location to reference for queries about the use.
LocId used_id;
};
// Finalizes the initialization of `dest_id` from the initializer expression
// `src_id`, by performing a final copy from source to destination, for types
// whose initialization is not in-place.