Assign a constant to ClassDecl/InterfaceDecl for name references. (#3722)

By adding a constant to ClassDecl/InterfaceDecl, we're able to remove
name reference special-casing. Use TryEvalInst on the Decl to generate
the Type. For ClassDecl, then use the generated constant for
self_type_id.
This commit is contained in:
Jon Ross-Perkins
2024-02-24 00:00:18 +00:00
committed by GitHub
parent 8e8eeb3243
commit 364ea5d3f2
109 changed files with 420 additions and 429 deletions
-4
View File
@@ -1015,10 +1015,6 @@ auto Context::GetBuiltinType(SemIR::BuiltinKind kind) -> SemIR::TypeId {
return type_id;
}
auto Context::GetClassType(SemIR::ClassId class_id) -> SemIR::TypeId {
return GetTypeImpl<SemIR::ClassType>(*this, class_id);
}
auto Context::GetPointerType(SemIR::TypeId pointee_type_id) -> SemIR::TypeId {
return GetTypeImpl<SemIR::PointerType>(*this, pointee_type_id);
}
-4
View File
@@ -237,10 +237,6 @@ class Context {
// Gets a builtin type. The returned type will be complete.
auto GetBuiltinType(SemIR::BuiltinKind kind) -> SemIR::TypeId;
// Returns a class type for the class described by `class_id`.
// TODO: Support generic arguments.
auto GetClassType(SemIR::ClassId class_id) -> SemIR::TypeId;
// Returns a pointer type whose pointee type is `pointee_type_id`.
auto GetPointerType(SemIR::TypeId pointee_type_id) -> SemIR::TypeId;
+21 -5
View File
@@ -364,12 +364,30 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
case SemIR::TupleInit::Kind:
return RebuildInitAsValue(context, inst, SemIR::TupleValue::Kind);
// These cases are always template constants.
case SemIR::Builtin::Kind:
// Builtins are always template constants.
return MakeConstantResult(context, inst, Phase::Template);
case SemIR::ClassDecl::Kind:
// TODO: Once classes have generic arguments, handle them.
return MakeConstantResult(
context,
SemIR::ClassType{SemIR::TypeId::TypeType,
inst.As<SemIR::ClassDecl>().class_id},
Phase::Template);
case SemIR::InterfaceDecl::Kind:
// TODO: Once interfaces have generic arguments, handle them.
return MakeConstantResult(
context,
SemIR::InterfaceType{SemIR::TypeId::TypeType,
inst.As<SemIR::InterfaceDecl>().interface_id},
Phase::Template);
case SemIR::ClassType::Kind:
case SemIR::InterfaceType::Kind:
// TODO: Once classes and interfaces have generic arguments, handle them.
return MakeConstantResult(context, inst, Phase::Template);
CARBON_FATAL() << inst.kind()
<< " is only created during corresponding Decl handling.";
// These cases are treated as being the unique canonical definition of the
// corresponding constant value.
@@ -475,10 +493,8 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
case SemIR::Branch::Kind:
case SemIR::BranchIf::Kind:
case SemIR::BranchWithArg::Kind:
case SemIR::ClassDecl::Kind:
case SemIR::ImplDecl::Kind:
case SemIR::Import::Kind:
case SemIR::InterfaceDecl::Kind:
case SemIR::Param::Kind:
case SemIR::ReturnExpr::Kind:
case SemIR::Return::Kind:
+12 -7
View File
@@ -56,7 +56,8 @@ static auto BuildClassDecl(Context& context, Parse::AnyClassDeclId parse_node)
auto decl_block_id = context.inst_block_stack().Pop();
// Add the class declaration.
auto class_decl = SemIR::ClassDecl{SemIR::ClassId::Invalid, decl_block_id};
auto class_decl = SemIR::ClassDecl{SemIR::TypeId::TypeType,
SemIR::ClassId::Invalid, decl_block_id};
auto class_decl_id = context.AddPlaceholderInst({parse_node, class_decl});
// Check whether this is a redeclaration.
@@ -91,26 +92,30 @@ static auto BuildClassDecl(Context& context, Parse::AnyClassDeclId parse_node)
}
// Create a new class if this isn't a valid redeclaration.
if (!class_decl.class_id.is_valid()) {
bool is_new_class = !class_decl.class_id.is_valid();
if (is_new_class) {
// TODO: If this is an invalid redeclaration of a non-class entity or there
// was an error in the qualifier, we will have lost track of the class name
// here. We should keep track of it even if the name is invalid.
class_decl.class_id = context.classes().Add(
{.name_id = name_context.name_id_for_new_inst(),
.enclosing_scope_id = name_context.enclosing_scope_id_for_new_inst(),
// `.self_type_id` depends on `class_id`, so is set below.
// `.self_type_id` depends on the ClassType, so is set below.
.self_type_id = SemIR::TypeId::Invalid,
.decl_id = class_decl_id,
.inheritance_kind = inheritance_kind});
// Build the `Self` type.
auto& class_info = context.classes().Get(class_decl.class_id);
class_info.self_type_id = context.GetClassType(class_decl.class_id);
}
// Write the class ID into the ClassDecl.
context.ReplaceInstBeforeConstantUse(class_decl_id, {parse_node, class_decl});
if (is_new_class) {
// Build the `Self` type using the resulting type constant.
auto& class_info = context.classes().Get(class_decl.class_id);
class_info.self_type_id = context.GetTypeIdForTypeConstant(
context.constant_values().Get(class_decl_id));
}
return {class_decl.class_id, class_decl_id};
}
+2 -2
View File
@@ -51,8 +51,8 @@ static auto BuildInterfaceDecl(Context& context,
auto decl_block_id = context.inst_block_stack().Pop();
// Add the interface declaration.
auto interface_decl =
SemIR::InterfaceDecl{SemIR::InterfaceId::Invalid, decl_block_id};
auto interface_decl = SemIR::InterfaceDecl{
SemIR::TypeId::TypeType, SemIR::InterfaceId::Invalid, decl_block_id};
auto interface_decl_id =
context.AddPlaceholderInst({parse_node, interface_decl});
-46
View File
@@ -42,49 +42,6 @@ static auto GetAsNameScope(Context& context, SemIR::InstId base_id)
return std::nullopt;
}
// Given an instruction produced by a name lookup, get the value to use for that
// result in an expression.
static auto GetExprValueForLookupResult(Context& context,
SemIR::InstId lookup_result_id)
-> SemIR::InstId {
// If lookup finds a class declaration, the value is its `Self` type.
auto lookup_result = context.insts().Get(lookup_result_id);
switch (lookup_result.kind()) {
case SemIR::ClassDecl::Kind: {
auto class_decl = lookup_result.As<SemIR::ClassDecl>();
return context.types().GetInstId(
context.classes().Get(class_decl.class_id).self_type_id);
}
case SemIR::InterfaceDecl::Kind: {
auto interface_decl = lookup_result.As<SemIR::InterfaceDecl>();
return TryEvalInst(context, SemIR::InstId::Invalid,
SemIR::InterfaceType{SemIR::TypeId::TypeType,
interface_decl.interface_id})
.inst_id();
}
case SemIR::ImportRefUsed::Kind: {
auto import_ref = lookup_result.As<SemIR::ImportRefUsed>();
const auto* import_ir = context.import_irs().Get(import_ref.ir_id);
auto import_kind = import_ir->insts().Get(import_ref.inst_id).kind();
// For a declared type, recurse to get the appropriate type value.
// Otherwise, the ImportRefUsed is sufficient.
if (import_kind == SemIR::ClassDecl::Kind ||
import_kind == SemIR::InterfaceDecl::Kind) {
return GetExprValueForLookupResult(
context, context.constant_values().Get(lookup_result_id).inst_id());
} else {
return lookup_result_id;
}
}
default:
// Anything else should be a typed value already.
CARBON_CHECK(lookup_result.kind().value_kind() ==
SemIR::InstValueKind::Typed)
<< "Unexpected kind for lookup result, " << lookup_result;
return lookup_result_id;
}
}
static auto GetClassElementIndex(Context& context, SemIR::InstId element_id)
-> SemIR::ElementIndex {
auto element_inst = context.insts().Get(element_id);
@@ -127,7 +84,6 @@ auto HandleMemberAccessExpr(Context& context,
name_scope_id->is_valid()
? context.LookupQualifiedName(parse_node, name_id, *name_scope_id)
: SemIR::InstId::BuiltinError;
inst_id = GetExprValueForLookupResult(context, inst_id);
auto inst = context.insts().Get(inst_id);
// TODO: Track that this instruction was named within `base_id`.
context.AddInstAndPush(
@@ -161,7 +117,6 @@ auto HandleMemberAccessExpr(Context& context,
.scope_id;
auto member_id =
context.LookupQualifiedName(parse_node, name_id, class_scope_id);
member_id = GetExprValueForLookupResult(context, member_id);
// Perform instance binding if we found an instance member.
auto member_type_id = context.insts().Get(member_id).type_id();
@@ -288,7 +243,6 @@ static auto GetIdentifierAsName(Context& context, Parse::NodeId parse_node)
static auto HandleNameAsExpr(Context& context, Parse::NodeId parse_node,
SemIR::NameId name_id) -> bool {
auto value_id = context.LookupUnqualifiedName(parse_node, name_id);
value_id = GetExprValueForLookupResult(context, value_id);
auto value = context.insts().Get(value_id);
context.AddInstAndPush(
{parse_node, SemIR::NameRef{value.type_id(), name_id, value_id}});
+10 -13
View File
@@ -344,7 +344,8 @@ class ImportRefResolver {
const SemIR::Class& import_class)
-> SemIR::ConstantId {
auto class_decl =
SemIR::ClassDecl{SemIR::ClassId::Invalid, SemIR::InstBlockId::Empty};
SemIR::ClassDecl{SemIR::TypeId::Invalid, SemIR::ClassId::Invalid,
SemIR::InstBlockId::Empty};
auto class_decl_id =
context_.AddPlaceholderInst({Parse::NodeId::Invalid, class_decl});
// Regardless of whether ClassDecl is a complete type, we first need an
@@ -352,28 +353,24 @@ class ImportRefResolver {
class_decl.class_id = context_.classes().Add({
.name_id = GetLocalNameId(import_class.name_id),
.enclosing_scope_id = NoEnclosingScopeForImports,
// `.self_type_id` depends on `class_id`, so is set below.
// `.self_type_id` depends on the ClassType, so is set below.
.self_type_id = SemIR::TypeId::Invalid,
.decl_id = class_decl_id,
.inheritance_kind = import_class.inheritance_kind,
});
// Write the function ID into the ClassDecl.
context_.ReplaceInstBeforeConstantUse(class_decl_id,
{Parse::NodeId::Invalid, class_decl});
auto self_const_id = context_.constant_values().Get(class_decl_id);
// Build the `Self` type.
auto type_id = context_.GetClassType(class_decl.class_id);
context_.classes().Get(class_decl.class_id).self_type_id = type_id;
// Build the `Self` type using the resulting type constant.
auto& class_info = context_.classes().Get(class_decl.class_id);
class_info.self_type_id = context_.GetTypeIdForTypeConstant(self_const_id);
// Set a constant corresponding to the incomplete class.
// TODO: This uses the self type's constant, but the underlying instruction
// is NotConstant. Need to discuss whether we want to add a type_id to
// ClassDecl/InterfaceDecl and change behavior, which would also help
// consistency with other types. See also GetExprValueForLookupResult in
// handle_name.cpp.
auto const_id = context_.types().GetConstantId(type_id);
import_ir_constant_values_.Set(inst_id, const_id);
return const_id;
import_ir_constant_values_.Set(inst_id, self_const_id);
return self_const_id;
}
// Fills out the class definition for an incomplete class.
@@ -28,13 +28,13 @@ var p: Incomplete* = &a[0];
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Incomplete = %Incomplete.decl, .a = %a, .p = %p} [template]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_ref Incomplete, constants.%Incomplete [template = constants.%Incomplete]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, () [template = constants.%Incomplete]
// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
// CHECK:STDOUT: %.loc15_21: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc15_22: type = array_type %.loc15_21, Incomplete [template = constants.%.2]
// CHECK:STDOUT: %a.var: ref <error> = var a
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
// CHECK:STDOUT: %Incomplete.ref.loc17: type = name_ref Incomplete, constants.%Incomplete [template = constants.%Incomplete]
// CHECK:STDOUT: %Incomplete.ref.loc17: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
// CHECK:STDOUT: %.loc17: type = ptr_type Incomplete [template = constants.%.3]
// CHECK:STDOUT: %p.var: ref Incomplete* = var p
// CHECK:STDOUT: %p: ref Incomplete* = bind_name p, %p.var
+7 -7
View File
@@ -36,7 +36,7 @@ fn Initializing() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.X = %X.decl, .Value = %Value, .Reference = %Reference, .Make = %Make, .Initializing = %Initializing} [template]
// CHECK:STDOUT: %X.decl = class_decl @X, ()
// CHECK:STDOUT: %X.decl = class_decl @X, () [template = constants.%X]
// CHECK:STDOUT: %Value: <function> = fn_decl @Value [template]
// CHECK:STDOUT: %Reference: <function> = fn_decl @Reference [template]
// CHECK:STDOUT: %Make: <function> = fn_decl @Make [template]
@@ -50,20 +50,20 @@ fn Initializing() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Value(%n: X) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %X.ref.loc14_10: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc14_10: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %n.ref: X = name_ref n, %n
// CHECK:STDOUT: %X.ref.loc14_19: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc14_19: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %m: X = bind_name m, %n.ref
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Reference(%p: X*) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %X.ref.loc18_10: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc18_10: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc18_11: type = ptr_type X [template = constants.%.4]
// CHECK:STDOUT: %p.ref: X* = name_ref p, %p
// CHECK:STDOUT: %.loc18_17: ref X = deref %p.ref
// CHECK:STDOUT: %X.ref.loc18_23: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc18_23: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc18_15: X* = addr_of %.loc18_17
// CHECK:STDOUT: %q: X* = bind_name q, %.loc18_15
// CHECK:STDOUT: return
@@ -73,13 +73,13 @@ fn Initializing() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Initializing() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %X.ref.loc24_10: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc24_10: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %x.var: ref X = var x
// CHECK:STDOUT: %x: ref X = bind_name x, %x.var
// CHECK:STDOUT: %Make.ref: <function> = name_ref Make, file.%Make [template = file.%Make]
// CHECK:STDOUT: %.loc24_7: ref X = splice_block %x.var {}
// CHECK:STDOUT: %.loc24_19: init X = call %Make.ref() to %.loc24_7
// CHECK:STDOUT: %X.ref.loc24_25: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc24_25: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: assign %x.var, %.loc24_19
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+9 -9
View File
@@ -35,7 +35,7 @@ fn Var() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.X = %X.decl, .Make = %Make, .Let = %Let, .Var = %Var} [template]
// CHECK:STDOUT: %X.decl = class_decl @X, ()
// CHECK:STDOUT: %X.decl = class_decl @X, () [template = constants.%X]
// CHECK:STDOUT: %Make: <function> = fn_decl @Make [template]
// CHECK:STDOUT: %Let: <function> = fn_decl @Let [template]
// CHECK:STDOUT: %Var: <function> = fn_decl @Var [template]
@@ -50,8 +50,8 @@ fn Var() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Let() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %X.ref.loc15_11: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc15_14: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc15_11: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc15_14: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc15_15.1: (type, type) = tuple_literal (%X.ref.loc15_11, %X.ref.loc15_14)
// CHECK:STDOUT: %.loc15_15.2: type = converted %.loc15_15.1, constants.%.5 [template = constants.%.5]
// CHECK:STDOUT: %Make.ref.loc15_20: <function> = name_ref Make, file.%Make [template = file.%Make]
@@ -61,8 +61,8 @@ fn Var() {
// CHECK:STDOUT: %.loc15_32.1: ref X = temporary_storage
// CHECK:STDOUT: %.loc15_32.2: init X = call %Make.ref.loc15_28() to %.loc15_32.1
// CHECK:STDOUT: %.loc15_34.1: (X, X) = tuple_literal (%.loc15_24.2, %.loc15_32.2)
// CHECK:STDOUT: %X.ref.loc15_40: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc15_43: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc15_40: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc15_43: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc15_44.1: (type, type) = tuple_literal (%X.ref.loc15_40, %X.ref.loc15_43)
// CHECK:STDOUT: %.loc15_44.2: type = converted %.loc15_44.1, constants.%.5 [template = constants.%.5]
// CHECK:STDOUT: %.loc15_24.3: ref X = temporary %.loc15_24.1, %.loc15_24.2
@@ -77,8 +77,8 @@ fn Var() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Var() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %X.ref.loc20_11: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc20_14: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc20_11: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc20_14: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc20_15.1: (type, type) = tuple_literal (%X.ref.loc20_11, %X.ref.loc20_14)
// CHECK:STDOUT: %.loc20_15.2: type = converted %.loc20_15.1, constants.%.5 [template = constants.%.5]
// CHECK:STDOUT: %b.var: ref (X, X) = var b
@@ -90,8 +90,8 @@ fn Var() {
// CHECK:STDOUT: %.loc20_34.2: ref X = tuple_access %b.var, element1
// CHECK:STDOUT: %.loc20_32: init X = call %Make.ref.loc20_28() to %.loc20_34.2
// CHECK:STDOUT: %.loc20_34.3: (X, X) = tuple_literal (%.loc20_24, %.loc20_32)
// CHECK:STDOUT: %X.ref.loc20_40: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc20_43: type = name_ref X, constants.%X [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc20_40: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %X.ref.loc20_43: type = name_ref X, file.%X.decl [template = constants.%X]
// CHECK:STDOUT: %.loc20_44.1: (type, type) = tuple_literal (%X.ref.loc20_40, %X.ref.loc20_43)
// CHECK:STDOUT: %.loc20_44.2: type = converted %.loc20_44.1, constants.%.5 [template = constants.%.5]
// CHECK:STDOUT: %.loc20_34.4: init (X, X) = tuple_init (%.loc20_24, %.loc20_32) to %b.var
+3 -3
View File
@@ -48,8 +48,8 @@ fn Access(d: Derived) -> (i32, i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %Base.decl, .Derived = %Derived.decl, .Make = %Make, .Access = %Access} [template]
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, () [template = constants.%Derived]
// CHECK:STDOUT: %Make: <function> = fn_decl @Make [template]
// CHECK:STDOUT: %Access: <function> = fn_decl @Access [template]
// CHECK:STDOUT: }
@@ -62,7 +62,7 @@ fn Access(d: Derived) -> (i32, i32) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
// CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base]
// CHECK:STDOUT: %.loc12: <unbound element of class Derived> = base_decl Base, element0 [template]
// CHECK:STDOUT: %.loc14: <unbound element of class Derived> = field_decl d, element1 [template]
// CHECK:STDOUT:
+3 -3
View File
@@ -41,8 +41,8 @@ fn Access(p: Derived*) -> i32* {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %Base.decl, .Derived = %Derived.decl, .Access = %Access} [template]
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, () [template = constants.%Derived]
// CHECK:STDOUT: %Access: <function> = fn_decl @Access [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -58,7 +58,7 @@ fn Access(p: Derived*) -> i32* {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
// CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base]
// CHECK:STDOUT: %.loc14: <unbound element of class Derived> = base_decl Base, element0 [template]
// CHECK:STDOUT: %.loc16: <unbound element of class Derived> = field_decl d, element1 [template]
// CHECK:STDOUT: %.loc17: <unbound element of class Derived> = field_decl e, element2 [template]
@@ -33,8 +33,8 @@ fn Derived.H() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %Base.decl, .Derived = %Derived.decl} [template]
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, () [template = constants.%Derived]
// CHECK:STDOUT: %H: <function> = fn_decl @H [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -46,7 +46,7 @@ fn Derived.H() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
// CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base]
// CHECK:STDOUT: %.loc12: <unbound element of class Derived> = base_decl Base, element0 [template]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: %H: <function> = fn_decl @H [template]
+3 -3
View File
@@ -42,9 +42,9 @@ fn Call(p: Derived*) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %Base.decl, .Derived = %Derived.decl, .Call = %Call} [template]
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, ()
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, () [template = constants.%Derived]
// CHECK:STDOUT: %Call: <function> = fn_decl @Call [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -58,7 +58,7 @@ fn Call(p: Derived*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
// CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base]
// CHECK:STDOUT: %.loc18: <unbound element of class Derived> = base_decl Base, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
+7 -7
View File
@@ -56,10 +56,10 @@ fn Call(a: A*, b: B*, c: C*, d: D*) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl, .B = %B.decl, .C = %C.decl, .D = %D.decl, .Call = %Call} [template]
// CHECK:STDOUT: %A.decl = class_decl @A, ()
// CHECK:STDOUT: %B.decl = class_decl @B, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %D.decl = class_decl @D, ()
// CHECK:STDOUT: %A.decl = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %B.decl = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %D.decl = class_decl @D, () [template = constants.%D]
// CHECK:STDOUT: %Call: <function> = fn_decl @Call [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -71,7 +71,7 @@ fn Call(a: A*, b: B*, c: C*, d: D*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %.loc12: <unbound element of class B> = base_decl A, element0 [template]
// CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template]
// CHECK:STDOUT:
@@ -82,7 +82,7 @@ fn Call(a: A*, b: B*, c: C*, d: D*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc17: <unbound element of class C> = base_decl B, element0 [template]
// CHECK:STDOUT: %F: <function> = fn_decl @F.3 [template]
// CHECK:STDOUT:
@@ -93,7 +93,7 @@ fn Call(a: A*, b: B*, c: C*, d: D*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @D {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc22: <unbound element of class D> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
+2 -2
View File
@@ -33,7 +33,7 @@ fn Run() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Run = %Run} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
// CHECK:STDOUT: }
@@ -63,7 +63,7 @@ fn Run() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %F.ref: <function> = name_ref F, @Class.%F [template = @Class.%F]
// CHECK:STDOUT: %.loc22_18: i32 = int_literal 4 [template = constants.%.3]
// CHECK:STDOUT: %.loc22_17.1: init i32 = call %F.ref(%.loc22_18)
+9 -9
View File
@@ -70,9 +70,9 @@ fn ConvertInit() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl, .B = %B.decl, .C = %C.decl, .ConvertCToB = %ConvertCToB, .ConvertBToA = %ConvertBToA, .ConvertCToA = %ConvertCToA, .ConvertValue = %ConvertValue, .ConvertRef = %ConvertRef, .ConvertInit = %ConvertInit} [template]
// CHECK:STDOUT: %A.decl = class_decl @A, ()
// CHECK:STDOUT: %B.decl = class_decl @B, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %A.decl = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %B.decl = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %ConvertCToB: <function> = fn_decl @ConvertCToB [template]
// CHECK:STDOUT: %ConvertBToA: <function> = fn_decl @ConvertBToA [template]
// CHECK:STDOUT: %ConvertCToA: <function> = fn_decl @ConvertCToA [template]
@@ -89,7 +89,7 @@ fn ConvertInit() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %.loc12: <unbound element of class B> = base_decl A, element0 [template]
// CHECK:STDOUT: %.loc13: <unbound element of class B> = field_decl b, element1 [template]
// CHECK:STDOUT:
@@ -100,7 +100,7 @@ fn ConvertInit() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc17: <unbound element of class C> = base_decl B, element0 [template]
// CHECK:STDOUT: %.loc18: <unbound element of class C> = field_decl c, element1 [template]
// CHECK:STDOUT:
@@ -143,7 +143,7 @@ fn ConvertInit() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @ConvertValue(%c: C) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %c.ref: C = name_ref c, %c
// CHECK:STDOUT: %.loc26_15.1: ref B = class_element_access %c.ref, element0
// CHECK:STDOUT: %.loc26_15.2: ref A = class_element_access %.loc26_15.1, element0
@@ -157,7 +157,7 @@ fn ConvertInit() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %c.ref: C* = name_ref c, %c
// CHECK:STDOUT: %.loc30_12.1: ref C = deref %c.ref
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %.loc30_15.1: ref B = class_element_access %.loc30_12.1, element0
// CHECK:STDOUT: %.loc30_15.2: ref A = class_element_access %.loc30_15.1, element0
// CHECK:STDOUT: %.loc30_12.2: ref A = converted %.loc30_12.1, %.loc30_15.2
@@ -167,14 +167,14 @@ fn ConvertInit() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @ConvertInit() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %.loc34_38: i32 = int_literal 1 [template = constants.%.19]
// CHECK:STDOUT: %.loc34_39.1: {.a: i32} = struct_literal (%.loc34_38)
// CHECK:STDOUT: %.loc34_47: i32 = int_literal 2 [template = constants.%.20]
// CHECK:STDOUT: %.loc34_48.1: {.base: {.a: i32}, .b: i32} = struct_literal (%.loc34_39.1, %.loc34_47)
// CHECK:STDOUT: %.loc34_56: i32 = int_literal 3 [template = constants.%.22]
// CHECK:STDOUT: %.loc34_57.1: {.base: {.base: {.a: i32}, .b: i32}, .c: i32} = struct_literal (%.loc34_48.1, %.loc34_56)
// CHECK:STDOUT: %C.ref: type = name_ref C, constants.%C [template = constants.%C]
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %.loc34_57.2: ref C = temporary_storage
// CHECK:STDOUT: %.loc34_57.3: ref B = class_element_access %.loc34_57.2, element0
// CHECK:STDOUT: %.loc34_48.2: ref A = class_element_access %.loc34_57.3, element0
+3 -3
View File
@@ -50,8 +50,8 @@ fn Access(d: Derived) -> (i32, i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Abstract = %Abstract.decl, .Derived = %Derived.decl, .Make = %Make, .Access = %Access} [template]
// CHECK:STDOUT: %Abstract.decl = class_decl @Abstract, ()
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, ()
// CHECK:STDOUT: %Abstract.decl = class_decl @Abstract, () [template = constants.%Abstract]
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, () [template = constants.%Derived]
// CHECK:STDOUT: %Make: <function> = fn_decl @Make [template]
// CHECK:STDOUT: %Access: <function> = fn_decl @Access [template]
// CHECK:STDOUT: }
@@ -64,7 +64,7 @@ fn Access(d: Derived) -> (i32, i32) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, constants.%Abstract [template = constants.%Abstract]
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
// CHECK:STDOUT: %.loc12: <unbound element of class Derived> = base_decl Abstract, element0 [template]
// CHECK:STDOUT: %.loc14: <unbound element of class Derived> = field_decl d, element1 [template]
// CHECK:STDOUT:
+1 -1
View File
@@ -26,7 +26,7 @@ class Class {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class {
+1 -1
View File
@@ -50,7 +50,7 @@ fn F(c: Class, p: Class*) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+13 -13
View File
@@ -161,26 +161,26 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %Base.decl, .Final = %Final.decl, .DeriveFromError = %DeriveFromError.decl, .AccessMemberWithInvalidBaseError = %AccessMemberWithInvalidBaseError, .DeriveFromNonType = %DeriveFromNonType.decl, .AccessMemberWithInvalidBasNonType = %AccessMemberWithInvalidBasNonType, .DeriveFromi32 = %DeriveFromi32.decl, .ConvertToBadBasei32 = %ConvertToBadBasei32, .AccessMemberWithInvalidBasei32 = %AccessMemberWithInvalidBasei32, .DeriveFromTuple = %DeriveFromTuple.decl, .ConvertToBadBaseTuple = %ConvertToBadBaseTuple, .AccessMemberWithInvalidBaseTuple = %AccessMemberWithInvalidBaseTuple, .DeriveFromStruct = %DeriveFromStruct.decl, .ConvertToBadBaseStruct = %ConvertToBadBaseStruct, .AccessMemberWithInvalidBaseStruct = %AccessMemberWithInvalidBaseStruct, .Incomplete = %Incomplete.decl, .DeriveFromIncomplete = %DeriveFromIncomplete.decl, .ConvertToBadBaseIncomplete = %ConvertToBadBaseIncomplete, .AccessMemberWithInvalidBaseIncomplete = %AccessMemberWithInvalidBaseIncomplete, .DeriveFromFinal = %DeriveFromFinal.decl, .ConvertToBadBaseFinal = %ConvertToBadBaseFinal, .AccessMemberWithInvalidBaseFinal_WithMember = %AccessMemberWithInvalidBaseFinal_WithMember, .AccessMemberWithInvalidBaseFinal_NoMember = %AccessMemberWithInvalidBaseFinal_NoMember} [template]
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Final.decl = class_decl @Final, ()
// CHECK:STDOUT: %DeriveFromError.decl = class_decl @DeriveFromError, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Final.decl = class_decl @Final, () [template = constants.%Final]
// CHECK:STDOUT: %DeriveFromError.decl = class_decl @DeriveFromError, () [template = constants.%DeriveFromError]
// CHECK:STDOUT: %AccessMemberWithInvalidBaseError: <function> = fn_decl @AccessMemberWithInvalidBaseError [template]
// CHECK:STDOUT: %DeriveFromNonType.decl = class_decl @DeriveFromNonType, ()
// CHECK:STDOUT: %DeriveFromNonType.decl = class_decl @DeriveFromNonType, () [template = constants.%DeriveFromNonType]
// CHECK:STDOUT: %AccessMemberWithInvalidBasNonType: <function> = fn_decl @AccessMemberWithInvalidBasNonType [template]
// CHECK:STDOUT: %DeriveFromi32.decl = class_decl @DeriveFromi32, ()
// CHECK:STDOUT: %DeriveFromi32.decl = class_decl @DeriveFromi32, () [template = constants.%DeriveFromi32]
// CHECK:STDOUT: %ConvertToBadBasei32: <function> = fn_decl @ConvertToBadBasei32 [template]
// CHECK:STDOUT: %AccessMemberWithInvalidBasei32: <function> = fn_decl @AccessMemberWithInvalidBasei32 [template]
// CHECK:STDOUT: %DeriveFromTuple.decl = class_decl @DeriveFromTuple, ()
// CHECK:STDOUT: %DeriveFromTuple.decl = class_decl @DeriveFromTuple, () [template = constants.%DeriveFromTuple]
// CHECK:STDOUT: %ConvertToBadBaseTuple: <function> = fn_decl @ConvertToBadBaseTuple [template]
// CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple: <function> = fn_decl @AccessMemberWithInvalidBaseTuple [template]
// CHECK:STDOUT: %DeriveFromStruct.decl = class_decl @DeriveFromStruct, ()
// CHECK:STDOUT: %DeriveFromStruct.decl = class_decl @DeriveFromStruct, () [template = constants.%DeriveFromStruct]
// CHECK:STDOUT: %ConvertToBadBaseStruct: <function> = fn_decl @ConvertToBadBaseStruct [template]
// CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct: <function> = fn_decl @AccessMemberWithInvalidBaseStruct [template]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %DeriveFromIncomplete.decl = class_decl @DeriveFromIncomplete, ()
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, () [template = constants.%Incomplete]
// CHECK:STDOUT: %DeriveFromIncomplete.decl = class_decl @DeriveFromIncomplete, () [template = constants.%DeriveFromIncomplete]
// CHECK:STDOUT: %ConvertToBadBaseIncomplete: <function> = fn_decl @ConvertToBadBaseIncomplete [template]
// CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete: <function> = fn_decl @AccessMemberWithInvalidBaseIncomplete [template]
// CHECK:STDOUT: %DeriveFromFinal.decl = class_decl @DeriveFromFinal, ()
// CHECK:STDOUT: %DeriveFromFinal.decl = class_decl @DeriveFromFinal, () [template = constants.%DeriveFromFinal]
// CHECK:STDOUT: %ConvertToBadBaseFinal: <function> = fn_decl @ConvertToBadBaseFinal [template]
// CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember: <function> = fn_decl @AccessMemberWithInvalidBaseFinal_WithMember [template]
// CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember: <function> = fn_decl @AccessMemberWithInvalidBaseFinal_NoMember [template]
@@ -225,7 +225,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @DeriveFromTuple {
// CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base]
// CHECK:STDOUT: %.loc51_22.1: (type,) = tuple_literal (%Base.ref)
// CHECK:STDOUT: %.loc51_22.2: type = converted %.loc51_22.1, constants.%.10 [template = constants.%.10]
// CHECK:STDOUT: %.loc51_23: <error> = base_decl <error>, element0 [template]
@@ -247,7 +247,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
// CHECK:STDOUT: class @Incomplete;
// CHECK:STDOUT:
// CHECK:STDOUT: class @DeriveFromIncomplete {
// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, constants.%Incomplete [template = constants.%Incomplete]
// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete]
// CHECK:STDOUT: %.loc87: <error> = base_decl <error>, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -256,7 +256,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @DeriveFromFinal {
// CHECK:STDOUT: %Final.ref: type = name_ref Final, constants.%Final [template = constants.%Final]
// CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final]
// CHECK:STDOUT: %.loc101: <unbound element of class DeriveFromFinal> = base_decl Final, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -41,15 +41,15 @@ fn D.C.F() {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.B = %B.decl, .D = %D.decl} [template]
// CHECK:STDOUT: %B.decl = class_decl @B, ()
// CHECK:STDOUT: %D.decl = class_decl @D, ()
// CHECK:STDOUT: %B.decl = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %D.decl = class_decl @D, () [template = constants.%D]
// CHECK:STDOUT: %F: <function> = fn_decl @F.3 [template]
// CHECK:STDOUT: %.loc27: <function> = fn_decl @.1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
// CHECK:STDOUT: %F: <function> = fn_decl @F.1 [template]
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %F
@@ -64,7 +64,7 @@ fn D.C.F() {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @D {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc16: <unbound element of class D> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
+9 -9
View File
@@ -63,11 +63,11 @@ class C4 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.B = %B.decl, .C1 = %C1.decl, .C2 = %C2.decl, .C3 = %C3.decl, .C4 = %C4.decl} [template]
// CHECK:STDOUT: %B.decl = class_decl @B, ()
// CHECK:STDOUT: %C1.decl = class_decl @C1, ()
// CHECK:STDOUT: %C2.decl = class_decl @C2, ()
// CHECK:STDOUT: %C3.decl = class_decl @C3, ()
// CHECK:STDOUT: %C4.decl = class_decl @C4, ()
// CHECK:STDOUT: %B.decl = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C1.decl = class_decl @C1, () [template = constants.%C1]
// CHECK:STDOUT: %C2.decl = class_decl @C2, () [template = constants.%C2]
// CHECK:STDOUT: %C3.decl = class_decl @C3, () [template = constants.%C3]
// CHECK:STDOUT: %C4.decl = class_decl @C4, () [template = constants.%C4]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
@@ -76,7 +76,7 @@ class C4 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C1 {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc13: <unbound element of class C1> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -85,7 +85,7 @@ class C4 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C2 {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc23: <unbound element of class C2> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -93,7 +93,7 @@ class C4 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C3 {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc33: <unbound element of class C3> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -102,7 +102,7 @@ class C4 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C4 {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc43: <unbound element of class C4> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
+3 -3
View File
@@ -27,8 +27,8 @@ class C {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.B = %B.decl, .C = %C.decl} [template]
// CHECK:STDOUT: %B.decl = class_decl @B, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %B.decl = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
@@ -37,7 +37,7 @@ class C {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc13: <unbound element of class C> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
+8 -8
View File
@@ -47,10 +47,10 @@ class D {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.B1 = %B1.decl, .B2 = %B2.decl, .C = %C.decl, .D = %D.decl} [template]
// CHECK:STDOUT: %B1.decl = class_decl @B1, ()
// CHECK:STDOUT: %B2.decl = class_decl @B2, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %D.decl = class_decl @D, ()
// CHECK:STDOUT: %B1.decl = class_decl @B1, () [template = constants.%B1]
// CHECK:STDOUT: %B2.decl = class_decl @B2, () [template = constants.%B2]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %D.decl = class_decl @D, () [template = constants.%D]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B1 {
@@ -64,9 +64,9 @@ class D {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %B1.ref: type = name_ref B1, constants.%B1 [template = constants.%B1]
// CHECK:STDOUT: %B1.ref: type = name_ref B1, file.%B1.decl [template = constants.%B1]
// CHECK:STDOUT: %.loc11: <unbound element of class C> = base_decl B1, element0 [template]
// CHECK:STDOUT: %B2.ref: type = name_ref B2, constants.%B2 [template = constants.%B2]
// CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [template = constants.%B2]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .base = %.loc11
@@ -74,9 +74,9 @@ class D {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @D {
// CHECK:STDOUT: %B1.ref.loc23: type = name_ref B1, constants.%B1 [template = constants.%B1]
// CHECK:STDOUT: %B1.ref.loc23: type = name_ref B1, file.%B1.decl [template = constants.%B1]
// CHECK:STDOUT: %.loc23: <unbound element of class D> = base_decl B1, element0 [template]
// CHECK:STDOUT: %B1.ref.loc30: type = name_ref B1, constants.%B1 [template = constants.%B1]
// CHECK:STDOUT: %B1.ref.loc30: type = name_ref B1, file.%B1.decl [template = constants.%B1]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .base = %.loc23
+5 -5
View File
@@ -29,10 +29,10 @@ let b: B = C.base;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.B = %B.decl, .C = %C.decl} [template]
// CHECK:STDOUT: %B.decl = class_decl @B, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %C.ref: type = name_ref C, constants.%C [template = constants.%C]
// CHECK:STDOUT: %B.decl = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B]
// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: %base.ref: <unbound element of class C> = name_ref base, @C.%.loc10 [template = @C.%.loc10]
// CHECK:STDOUT: %b: B = bind_name b, <error>
// CHECK:STDOUT: }
@@ -43,7 +43,7 @@ let b: B = C.base;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %B.ref: type = name_ref B, constants.%B [template = constants.%B]
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %.loc10: <unbound element of class C> = base_decl B, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -25,7 +25,7 @@ fn Make() -> C {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.C = %C.decl, .Make = %Make} [template]
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %Make: <function> = fn_decl @Make [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+5 -5
View File
@@ -54,11 +54,11 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A1 = %A1.decl, .A2 = %A2.decl, .B2 = %B2.decl, .ConvertUnrelated = %ConvertUnrelated, .Incomplete = %Incomplete.decl, .ConvertIncomplete = %ConvertIncomplete} [template]
// CHECK:STDOUT: %A1.decl = class_decl @A1, ()
// CHECK:STDOUT: %A2.decl = class_decl @A2, ()
// CHECK:STDOUT: %B2.decl = class_decl @B2, ()
// CHECK:STDOUT: %A1.decl = class_decl @A1, () [template = constants.%A1]
// CHECK:STDOUT: %A2.decl = class_decl @A2, () [template = constants.%A2]
// CHECK:STDOUT: %B2.decl = class_decl @B2, () [template = constants.%B2]
// CHECK:STDOUT: %ConvertUnrelated: <function> = fn_decl @ConvertUnrelated [template]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, () [template = constants.%Incomplete]
// CHECK:STDOUT: %ConvertIncomplete: <function> = fn_decl @ConvertIncomplete [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -77,7 +77,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B2 {
// CHECK:STDOUT: %A2.ref: type = name_ref A2, constants.%A2 [template = constants.%A2]
// CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2]
// CHECK:STDOUT: %.loc16: <unbound element of class B2> = base_decl A2, element0 [template]
// CHECK:STDOUT: %.loc17: <unbound element of class B2> = field_decl b, element1 [template]
// CHECK:STDOUT:
+1 -1
View File
@@ -39,7 +39,7 @@ class Class {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class {
+7 -7
View File
@@ -44,8 +44,8 @@ var a: Incomplete;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %Empty.decl, .Incomplete = %Incomplete.decl} [template]
// CHECK:STDOUT: %Empty.decl = class_decl @Empty, ()
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %Empty.decl = class_decl @Empty, () [template = constants.%Empty]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, () [template = constants.%Incomplete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Empty {
@@ -66,11 +66,11 @@ var a: Incomplete;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %import_ref.1, .Incomplete = %import_ref.2, .a = %a} [template]
// CHECK:STDOUT: %import_ref.1: invalid = import_ref ir1, inst+1, used [template = constants.%Empty]
// CHECK:STDOUT: %import_ref.2: invalid = import_ref ir1, inst+4, used [template = constants.%Incomplete]
// CHECK:STDOUT: %.decl = class_decl @.1, (<unexpected instref inst+3>)
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, constants.%Incomplete [template = constants.%Incomplete]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, used [template = constants.%Empty]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+4, used [template = constants.%Incomplete]
// CHECK:STDOUT: %.decl = class_decl @.1, (<unexpected instref inst+3>) [template = constants.%.2]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, () [template = constants.%Incomplete]
// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, %import_ref.2 [template = constants.%Incomplete]
// CHECK:STDOUT: %a.var: ref <error> = var a
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
// CHECK:STDOUT: }
+4 -4
View File
@@ -126,10 +126,10 @@ fn CallReturnIncomplete() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .CallClassFunction = %CallClassFunction, .global_var = %global_var, .ConvertFromStruct = %ConvertFromStruct, .MemberAccess = %MemberAccess, .Copy = %Copy, .Let = %Let, .TakeIncomplete = %TakeIncomplete, .ReturnIncomplete = %ReturnIncomplete, .CallTakeIncomplete = %CallTakeIncomplete, .CallReturnIncomplete = %CallReturnIncomplete} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %.loc15: <function> = fn_decl @.1 [template]
// CHECK:STDOUT: %CallClassFunction: <function> = fn_decl @CallClassFunction [template]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class]
// CHECK:STDOUT: %global_var.var: ref <error> = var global_var
// CHECK:STDOUT: %global_var: ref <error> = bind_name global_var, %global_var.var
// CHECK:STDOUT: %ConvertFromStruct: <function> = fn_decl @ConvertFromStruct [template]
@@ -151,7 +151,7 @@ fn CallReturnIncomplete() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallClassFunction() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %Function.ref: <error> = name_ref Function, <error> [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -178,7 +178,7 @@ fn CallReturnIncomplete() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Let(%p: Class*) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %p.ref: Class* = name_ref p, %p
// CHECK:STDOUT: %.loc75: ref Class = deref %p.ref
// CHECK:STDOUT: %c: <error> = bind_name c, <error>
+4 -4
View File
@@ -41,7 +41,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -58,14 +58,14 @@ fn F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc16_9: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc16_10.1: {.a: i32} = struct_literal (%.loc16_9)
// CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %.loc16_10.2: ref Class = temporary_storage
// CHECK:STDOUT: %.loc16_10.3: ref Class = temporary %.loc16_10.2, <error>
// CHECK:STDOUT: %.loc16_10.4: ref Class = converted %.loc16_10.1, %.loc16_10.3
// CHECK:STDOUT: %.loc20_9: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc20_17: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc20_18.1: {.a: i32, .c: i32} = struct_literal (%.loc20_9, %.loc20_17)
// CHECK:STDOUT: %Class.ref.loc20: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc20: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %.loc20_18.2: ref Class = temporary_storage
// CHECK:STDOUT: %.loc20_18.3: ref i32 = class_element_access %.loc20_18.2, element0
// CHECK:STDOUT: %.loc20_18.4: init i32 = initialize_from %.loc20_9 to %.loc20_18.3 [template = constants.%.3]
@@ -75,7 +75,7 @@ fn F() {
// CHECK:STDOUT: %.loc24_17: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc24_25: i32 = int_literal 3 [template = constants.%.8]
// CHECK:STDOUT: %.loc24_26.1: {.a: i32, .b: i32, .c: i32} = struct_literal (%.loc24_9, %.loc24_17, %.loc24_25)
// CHECK:STDOUT: %Class.ref.loc24: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc24: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %.loc24_26.2: ref Class = temporary_storage
// CHECK:STDOUT: %.loc24_26.3: ref Class = temporary %.loc24_26.2, <error>
// CHECK:STDOUT: %.loc24_26.4: ref Class = converted %.loc24_26.1, %.loc24_26.3
+3 -3
View File
@@ -38,7 +38,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G, .F = %F} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
@@ -56,13 +56,13 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref.loc21_10: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc21_10: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %c.var: ref Class = var c
// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var
// CHECK:STDOUT: %.loc21_24: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc21_32: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc21_33.1: {.a: i32, .b: i32} = struct_literal (%.loc21_24, %.loc21_32)
// CHECK:STDOUT: %Class.ref.loc21_38: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc21_38: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %.loc21_33.2: ref Class = temporary_storage
// CHECK:STDOUT: %.loc21_33.3: ref i32 = class_element_access %.loc21_33.2, element0
// CHECK:STDOUT: %.loc21_33.4: init i32 = initialize_from %.loc21_24 to %.loc21_33.3 [template = constants.%.5]
@@ -50,8 +50,8 @@ fn F(s: {.a: A}, b: B) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl, .B = %B.decl, .F = %F} [template]
// CHECK:STDOUT: %A.decl = class_decl @A, ()
// CHECK:STDOUT: %B.decl = class_decl @B, ()
// CHECK:STDOUT: %A.decl = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %B.decl = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -63,7 +63,7 @@ fn F(s: {.a: A}, b: B) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @B {
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %.loc12: <unbound element of class B> = field_decl a, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
+2 -2
View File
@@ -27,8 +27,8 @@ fn T.F() {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class]
// CHECK:STDOUT: %T: type = bind_name T, %Class.ref
// CHECK:STDOUT: %.loc19: <function> = fn_decl @.1 [template]
// CHECK:STDOUT: }
+5 -5
View File
@@ -51,8 +51,8 @@ fn F(c: Class) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .A = %A, .F = %F} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class]
// CHECK:STDOUT: %WithSelf.ref: <function> = name_ref WithSelf, @Class.%WithSelf [template = @Class.%WithSelf]
// CHECK:STDOUT: %A: <function> = bind_alias A, @Class.%WithSelf [template = @Class.%WithSelf]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
@@ -79,13 +79,13 @@ fn F(c: Class) {
// CHECK:STDOUT: %c.ref.loc16: Class = name_ref c, %c
// CHECK:STDOUT: %.loc16_4: <bound method> = bound_method %c.ref.loc16, @Class.%WithSelf
// CHECK:STDOUT: %.loc16_13: init () = call %.loc16_4(%c.ref.loc16)
// CHECK:STDOUT: %Class.ref.loc18: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc18: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %NoSelf.ref.loc18: <function> = name_ref NoSelf, @Class.%NoSelf [template = @Class.%NoSelf]
// CHECK:STDOUT: %.loc18: init () = call %NoSelf.ref.loc18()
// CHECK:STDOUT: %Class.ref.loc25: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc25: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %WithSelf.ref.loc25: <function> = name_ref WithSelf, @Class.%WithSelf [template = @Class.%WithSelf]
// CHECK:STDOUT: %.loc25: init () = call %WithSelf.ref.loc25(<invalid>)
// CHECK:STDOUT: %Class.ref.loc32: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc32: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %WithSelf.ref.loc32: <function> = name_ref WithSelf, @Class.%WithSelf [template = @Class.%WithSelf]
// CHECK:STDOUT: %c.ref.loc32: Class = name_ref c, %c
// CHECK:STDOUT: %.loc32: init () = call %WithSelf.ref.loc32(<invalid>)
@@ -58,9 +58,9 @@ base class BaseClass {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.FinalClass = %FinalClass.decl, .AbstractClass = %AbstractClass.decl, .BaseClass = %BaseClass.decl} [template]
// CHECK:STDOUT: %FinalClass.decl = class_decl @FinalClass, ()
// CHECK:STDOUT: %AbstractClass.decl = class_decl @AbstractClass, ()
// CHECK:STDOUT: %BaseClass.decl = class_decl @BaseClass, ()
// CHECK:STDOUT: %FinalClass.decl = class_decl @FinalClass, () [template = constants.%FinalClass]
// CHECK:STDOUT: %AbstractClass.decl = class_decl @AbstractClass, () [template = constants.%AbstractClass]
// CHECK:STDOUT: %BaseClass.decl = class_decl @BaseClass, () [template = constants.%BaseClass]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @FinalClass {
+6 -6
View File
@@ -78,12 +78,12 @@ abstract base class AbstractAndBase {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.DuplicatePrivate = %DuplicatePrivate.decl, .TwoAccess = %TwoAccess.decl, .TwoAbstract = %TwoAbstract.decl, .Virtual = %Virtual.decl, .WrongOrder = %WrongOrder.decl, .AbstractAndBase = %AbstractAndBase.decl} [template]
// CHECK:STDOUT: %DuplicatePrivate.decl = class_decl @DuplicatePrivate, ()
// CHECK:STDOUT: %TwoAccess.decl = class_decl @TwoAccess, ()
// CHECK:STDOUT: %TwoAbstract.decl = class_decl @TwoAbstract, ()
// CHECK:STDOUT: %Virtual.decl = class_decl @Virtual, ()
// CHECK:STDOUT: %WrongOrder.decl = class_decl @WrongOrder, ()
// CHECK:STDOUT: %AbstractAndBase.decl = class_decl @AbstractAndBase, ()
// CHECK:STDOUT: %DuplicatePrivate.decl = class_decl @DuplicatePrivate, () [template = constants.%DuplicatePrivate]
// CHECK:STDOUT: %TwoAccess.decl = class_decl @TwoAccess, () [template = constants.%TwoAccess]
// CHECK:STDOUT: %TwoAbstract.decl = class_decl @TwoAbstract, () [template = constants.%TwoAbstract]
// CHECK:STDOUT: %Virtual.decl = class_decl @Virtual, () [template = constants.%Virtual]
// CHECK:STDOUT: %WrongOrder.decl = class_decl @WrongOrder, () [template = constants.%WrongOrder]
// CHECK:STDOUT: %AbstractAndBase.decl = class_decl @AbstractAndBase, () [template = constants.%AbstractAndBase]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @DuplicatePrivate;
@@ -20,7 +20,7 @@ fn C.F() {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.C = %C.decl} [template]
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -89,21 +89,21 @@ base class G;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl.loc7, .B = %B.decl.loc16, .C = %C.decl.loc25, .D = %D.decl.loc34, .E = %E.decl.loc43, .F = %F.decl.loc52, .G = %G.decl.loc61} [template]
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A, ()
// CHECK:STDOUT: %A.decl.loc14 = class_decl @A, ()
// CHECK:STDOUT: %B.decl.loc16 = class_decl @B, ()
// CHECK:STDOUT: %B.decl.loc23 = class_decl @B, ()
// CHECK:STDOUT: %C.decl.loc25 = class_decl @C, ()
// CHECK:STDOUT: %C.decl.loc32 = class_decl @C, ()
// CHECK:STDOUT: %D.decl.loc34 = class_decl @D, ()
// CHECK:STDOUT: %D.decl.loc41 = class_decl @D, ()
// CHECK:STDOUT: %E.decl.loc43 = class_decl @E, ()
// CHECK:STDOUT: %E.decl.loc50 = class_decl @E, ()
// CHECK:STDOUT: %F.decl.loc52 = class_decl @F, ()
// CHECK:STDOUT: %F.decl.loc59 = class_decl @F, ()
// CHECK:STDOUT: %G.decl.loc61 = class_decl @G, ()
// CHECK:STDOUT: %G.decl.loc68 = class_decl @G, ()
// CHECK:STDOUT: %G.decl.loc75 = class_decl @G, ()
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %A.decl.loc14 = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %B.decl.loc16 = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %B.decl.loc23 = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C.decl.loc25 = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %C.decl.loc32 = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %D.decl.loc34 = class_decl @D, () [template = constants.%D]
// CHECK:STDOUT: %D.decl.loc41 = class_decl @D, () [template = constants.%D]
// CHECK:STDOUT: %E.decl.loc43 = class_decl @E, () [template = constants.%E]
// CHECK:STDOUT: %E.decl.loc50 = class_decl @E, () [template = constants.%E]
// CHECK:STDOUT: %F.decl.loc52 = class_decl @F, () [template = constants.%F]
// CHECK:STDOUT: %F.decl.loc59 = class_decl @F, () [template = constants.%F]
// CHECK:STDOUT: %G.decl.loc61 = class_decl @G, () [template = constants.%G]
// CHECK:STDOUT: %G.decl.loc68 = class_decl @G, () [template = constants.%G]
// CHECK:STDOUT: %G.decl.loc75 = class_decl @G, () [template = constants.%G]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @A {
@@ -36,29 +36,29 @@ class Y {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl.loc7, .X = %X.decl, .Y = %Y.decl} [template]
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A.1, ()
// CHECK:STDOUT: %X.decl = class_decl @X, ()
// CHECK:STDOUT: %A.decl.loc15 = class_decl @A.1, ()
// CHECK:STDOUT: %Y.decl = class_decl @Y, ()
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A.1, () [template = constants.%A.1]
// CHECK:STDOUT: %X.decl = class_decl @X, () [template = constants.%X]
// CHECK:STDOUT: %A.decl.loc15 = class_decl @A.1, () [template = constants.%A.1]
// CHECK:STDOUT: %Y.decl = class_decl @Y, () [template = constants.%Y]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @A.1 {
// CHECK:STDOUT: %B.decl = class_decl @B.2, ()
// CHECK:STDOUT: %B.decl = class_decl @B.2, () [template = constants.%B.2]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @X {
// CHECK:STDOUT: %A.decl = class_decl @A.2, ()
// CHECK:STDOUT: %B.decl = class_decl @B.1, ()
// CHECK:STDOUT: %A.decl = class_decl @A.2, () [template = constants.%A.2]
// CHECK:STDOUT: %B.decl = class_decl @B.1, () [template = constants.%B.1]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @A.2 {
// CHECK:STDOUT: %B.decl = class_decl @B.1, ()
// CHECK:STDOUT: %B.decl = class_decl @B.1, () [template = constants.%B.1]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .B = %B.decl
@@ -72,7 +72,7 @@ class Y {
// CHECK:STDOUT: class @B.2;
// CHECK:STDOUT:
// CHECK:STDOUT: class @Y {
// CHECK:STDOUT: %.decl = class_decl @.1, ()
// CHECK:STDOUT: %.decl = class_decl @.1, () [template = constants.%.2]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: }
+2 -2
View File
@@ -33,8 +33,8 @@ fn Class.H() {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl.loc7} [template]
// CHECK:STDOUT: %Class.decl.loc7 = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl.loc18 = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl.loc7 = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Class.decl.loc18 = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: %H: <function> = fn_decl @H [template]
+2 -2
View File
@@ -35,7 +35,7 @@ class Class {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class {
@@ -49,7 +49,7 @@ class Class {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %F.ref: <error> = name_ref F, <error> [template = <error>]
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
+1 -1
View File
@@ -27,7 +27,7 @@ fn G() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+3 -3
View File
@@ -62,10 +62,10 @@ fn CallWrongSelf(ws: WrongSelf) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .WrongSelf = %WrongSelf.decl, .CallWrongSelf = %CallWrongSelf} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F.1 [template]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: %WrongSelf.decl = class_decl @WrongSelf, ()
// CHECK:STDOUT: %WrongSelf.decl = class_decl @WrongSelf, () [template = constants.%WrongSelf]
// CHECK:STDOUT: %CallWrongSelf: <function> = fn_decl @CallWrongSelf [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -92,7 +92,7 @@ fn CallWrongSelf(ws: WrongSelf) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> %return: Class {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %self.var: ref Class = var self
// CHECK:STDOUT: %self: ref Class = bind_name self, %self.var
// CHECK:STDOUT: %self.ref: ref Class = name_ref self, %self
+1 -1
View File
@@ -20,7 +20,7 @@ class C[]();
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.C = %C.decl} [template]
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C;
@@ -33,7 +33,7 @@ fn Class(T:! type).F[self: Self](n: T) {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, (<unexpected instref inst+1>, <unexpected instref inst+2>)
// CHECK:STDOUT: %Class.decl = class_decl @Class, (<unexpected instref inst+1>, <unexpected instref inst+2>) [template = constants.%Class]
// CHECK:STDOUT: %.loc24: <function> = fn_decl @.1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -34,7 +34,7 @@ class ForwardDecl {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.ForwardDecl = %ForwardDecl.decl} [template]
// CHECK:STDOUT: %ForwardDecl.decl = class_decl @ForwardDecl, ()
// CHECK:STDOUT: %ForwardDecl.decl = class_decl @ForwardDecl, () [template = constants.%ForwardDecl]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @ForwardDecl;
@@ -49,8 +49,8 @@ class ForwardDecl {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.ForwardDecl = %import_ref} [template]
// CHECK:STDOUT: %import_ref: invalid = import_ref ir1, inst+1, used [template = constants.%ForwardDecl]
// CHECK:STDOUT: %.decl = class_decl @.1, (<unexpected instref inst+2>)
// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+1, used [template = constants.%ForwardDecl]
// CHECK:STDOUT: %.decl = class_decl @.1, (<unexpected instref inst+2>) [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @ForwardDecl;
+3 -3
View File
@@ -71,9 +71,9 @@ abstract class Abstract {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Access = %Access.decl, .Base = %Base.decl, .Abstract = %Abstract.decl} [template]
// CHECK:STDOUT: %Access.decl = class_decl @Access, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Abstract.decl = class_decl @Abstract, ()
// CHECK:STDOUT: %Access.decl = class_decl @Access, () [template = constants.%Access]
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Abstract.decl = class_decl @Abstract, () [template = constants.%Abstract]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Access {
+2 -2
View File
@@ -31,7 +31,7 @@ fn G() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -52,7 +52,7 @@ fn G() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %field.ref: <unbound element of class Class> = name_ref field, @Class.%.loc8 [template = @Class.%.loc8]
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
+1 -1
View File
@@ -27,7 +27,7 @@ fn G(c: Class) -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2 -2
View File
@@ -30,7 +30,7 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Run = %Run} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -45,7 +45,7 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %c.var: ref Class = var c
// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var
// CHECK:STDOUT: %c.ref.loc14: ref Class = name_ref c, %c
@@ -31,7 +31,7 @@ fn Test() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Test = %Test} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Test: <function> = fn_decl @Test [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -46,7 +46,7 @@ fn Test() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Test() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref.loc13: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc13: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %cv.var: ref Class = var cv
// CHECK:STDOUT: %cv: ref Class = bind_name cv, %cv.var
// CHECK:STDOUT: %cv.ref.loc14: ref Class = name_ref cv, %cv
@@ -57,7 +57,7 @@ fn Test() {
// CHECK:STDOUT: %.loc15_5: ref i32 = class_element_access %cv.ref.loc15, element1
// CHECK:STDOUT: %.loc15_10: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: assign %.loc15_5, %.loc15_10
// CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %cv.ref.loc16: ref Class = name_ref cv, %cv
// CHECK:STDOUT: %.loc16: Class = bind_value %cv.ref.loc16
// CHECK:STDOUT: %c: Class = bind_name c, %.loc16
+1 -1
View File
@@ -17,7 +17,7 @@ fn F(p: Class*) -> Class* { return p; }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+18 -18
View File
@@ -60,11 +60,11 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %Empty.decl, .Field = %Field.decl, .ForwardDeclared = %ForwardDeclared.decl.loc11, .Incomplete = %Incomplete.decl} [template]
// CHECK:STDOUT: %Empty.decl = class_decl @Empty, ()
// CHECK:STDOUT: %Field.decl = class_decl @Field, ()
// CHECK:STDOUT: %ForwardDeclared.decl.loc11 = class_decl @ForwardDeclared, ()
// CHECK:STDOUT: %ForwardDeclared.decl.loc13 = class_decl @ForwardDeclared, ()
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %Empty.decl = class_decl @Empty, () [template = constants.%Empty]
// CHECK:STDOUT: %Field.decl = class_decl @Field, () [template = constants.%Field]
// CHECK:STDOUT: %ForwardDeclared.decl.loc11 = class_decl @ForwardDeclared, () [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %ForwardDeclared.decl.loc13 = class_decl @ForwardDeclared, () [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, () [template = constants.%Incomplete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Empty {
@@ -118,10 +118,10 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %import_ref.1, .Field = %import_ref.2, .ForwardDeclared = %import_ref.3, .Incomplete = %import_ref.4, .Run = %Run} [template]
// CHECK:STDOUT: %import_ref.1: invalid = import_ref ir1, inst+1, used [template = constants.%Empty]
// CHECK:STDOUT: %import_ref.2: invalid = import_ref ir1, inst+4, used [template = constants.%Field]
// CHECK:STDOUT: %import_ref.3: invalid = import_ref ir1, inst+11, used [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %import_ref.4: invalid = import_ref ir1, inst+25, used [template = constants.%Incomplete]
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, used [template = constants.%Empty]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+4, used [template = constants.%Field]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+11, used [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+25, used [template = constants.%Incomplete]
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -150,16 +150,16 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Empty.decl = class_decl @Empty, ()
// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, constants.%Empty [template = constants.%Empty]
// CHECK:STDOUT: %Empty.decl = class_decl @Empty, () [template = constants.%Empty]
// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%import_ref.1 [template = constants.%Empty]
// CHECK:STDOUT: %a.var: ref Empty = var a
// CHECK:STDOUT: %a: ref Empty = bind_name a, %a.var
// CHECK:STDOUT: %.loc7_19.1: {} = struct_literal ()
// CHECK:STDOUT: %.loc7_19.2: init Empty = class_init (), %a.var [template = constants.%.4]
// CHECK:STDOUT: %.loc7_19.3: init Empty = converted %.loc7_19.1, %.loc7_19.2 [template = constants.%.4]
// CHECK:STDOUT: assign %a.var, %.loc7_19.3
// CHECK:STDOUT: %Field.decl = class_decl @Field, ()
// CHECK:STDOUT: %Field.ref: type = name_ref Field, constants.%Field [template = constants.%Field]
// CHECK:STDOUT: %Field.decl = class_decl @Field, () [template = constants.%Field]
// CHECK:STDOUT: %Field.ref: type = name_ref Field, file.%import_ref.2 [template = constants.%Field]
// CHECK:STDOUT: %b.var: ref Field = var b
// CHECK:STDOUT: %b: ref Field = bind_name b, %b.var
// CHECK:STDOUT: %.loc9_24: i32 = int_literal 1 [template = constants.%.7]
@@ -173,8 +173,8 @@ fn Run() {
// CHECK:STDOUT: %.loc10_4: ref i32 = class_element_access %b.ref, element0
// CHECK:STDOUT: %.loc10_9: i32 = int_literal 2 [template = constants.%.10]
// CHECK:STDOUT: assign %.loc10_4, %.loc10_9
// CHECK:STDOUT: %ForwardDeclared.decl = class_decl @ForwardDeclared, ()
// CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, constants.%ForwardDeclared [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %ForwardDeclared.decl = class_decl @ForwardDeclared, () [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, file.%import_ref.3 [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %c.var: ref ForwardDeclared = var c
// CHECK:STDOUT: %c: ref ForwardDeclared = bind_name c, %c.var
// CHECK:STDOUT: %.loc12_29.1: {} = struct_literal ()
@@ -189,15 +189,15 @@ fn Run() {
// CHECK:STDOUT: %.loc14_4: <bound method> = bound_method %c.ref.loc14, @ForwardDeclared.%import_ref.1
// CHECK:STDOUT: %.loc14_3: ForwardDeclared* = addr_of %c.ref.loc14
// CHECK:STDOUT: %.loc14_6: init () = call %.loc14_4(%.loc14_3)
// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, constants.%ForwardDeclared [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, file.%import_ref.3 [template = constants.%ForwardDeclared]
// CHECK:STDOUT: %.loc16_25: type = ptr_type ForwardDeclared [template = constants.%.12]
// CHECK:STDOUT: %d.var: ref ForwardDeclared* = var d
// CHECK:STDOUT: %d: ref ForwardDeclared* = bind_name d, %d.var
// CHECK:STDOUT: %c.ref.loc16: ref ForwardDeclared = name_ref c, %c
// CHECK:STDOUT: %.loc16_29: ForwardDeclared* = addr_of %c.ref.loc16
// CHECK:STDOUT: assign %d.var, %.loc16_29
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, constants.%Incomplete [template = constants.%Incomplete]
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, () [template = constants.%Incomplete]
// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%import_ref.4 [template = constants.%Incomplete]
// CHECK:STDOUT: %.loc18: type = ptr_type Incomplete [template = constants.%.13]
// CHECK:STDOUT: %e.var: ref Incomplete* = var e
// CHECK:STDOUT: %e: ref Incomplete* = bind_name e, %e.var
+7 -7
View File
@@ -46,8 +46,8 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %Base.decl, .Child = %Child.decl} [template]
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Child.decl = class_decl @Child, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Child.decl = class_decl @Child, () [template = constants.%Child]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Base {
@@ -64,7 +64,7 @@ fn Run() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Child {
// CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base]
// CHECK:STDOUT: %.loc13: <unbound element of class Child> = base_decl Base, element0 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -100,7 +100,7 @@ fn Run() {
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %import_ref.1, .Child = %import_ref.2, .Run = %Run} [template]
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unused
// CHECK:STDOUT: %import_ref.2: invalid = import_ref ir1, inst+19, used [template = constants.%Child]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+19, used [template = constants.%Child]
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -127,9 +127,9 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Child.decl = class_decl @Child, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Child.ref: type = name_ref Child, constants.%Child [template = constants.%Child]
// CHECK:STDOUT: %Child.decl = class_decl @Child, () [template = constants.%Child]
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Child.ref: type = name_ref Child, file.%import_ref.2 [template = constants.%Child]
// CHECK:STDOUT: %a.var: ref Child = var a
// CHECK:STDOUT: %a: ref Child = bind_name a, %a.var
// CHECK:STDOUT: %.loc7_33: i32 = int_literal 0 [template = constants.%.7]
+5 -5
View File
@@ -33,11 +33,11 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Cycle = %Cycle.decl} [template]
// CHECK:STDOUT: %Cycle.decl = class_decl @Cycle, ()
// CHECK:STDOUT: %Cycle.decl = class_decl @Cycle, () [template = constants.%Cycle]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Cycle {
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, constants.%Cycle [template = constants.%Cycle]
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%Cycle.decl [template = constants.%Cycle]
// CHECK:STDOUT: %.loc5_15: type = ptr_type Cycle [template = constants.%.1]
// CHECK:STDOUT: %.loc5_8: <unbound element of class Cycle> = field_decl a, element0 [template]
// CHECK:STDOUT:
@@ -55,7 +55,7 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Cycle = %import_ref, .Run = %Run} [template]
// CHECK:STDOUT: %import_ref: invalid = import_ref ir1, inst+1, used [template = constants.%Cycle]
// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+1, used [template = constants.%Cycle]
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -68,8 +68,8 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cycle.decl = class_decl @Cycle, ()
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, constants.%Cycle [template = constants.%Cycle]
// CHECK:STDOUT: %Cycle.decl = class_decl @Cycle, () [template = constants.%Cycle]
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%import_ref [template = constants.%Cycle]
// CHECK:STDOUT: %.loc7: type = ptr_type Cycle [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref Cycle* = var a
// CHECK:STDOUT: %a: ref Cycle* = bind_name a, %a.var
+5 -5
View File
@@ -39,17 +39,17 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Cycle = %Cycle.decl.loc4, .a = %a} [template]
// CHECK:STDOUT: %Cycle.decl.loc4 = class_decl @Cycle, ()
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, constants.%Cycle [template = constants.%Cycle]
// CHECK:STDOUT: %Cycle.decl.loc4 = class_decl @Cycle, () [template = constants.%Cycle]
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, %Cycle.decl.loc4 [template = constants.%Cycle]
// CHECK:STDOUT: %.loc6_18: type = ptr_type Cycle [template = constants.%.1]
// CHECK:STDOUT: %.loc6_19: type = struct_type {.b: Cycle*} [template = constants.%.2]
// CHECK:STDOUT: %a.var: ref {.b: Cycle*} = var a
// CHECK:STDOUT: %a: ref {.b: Cycle*} = bind_name a, %a.var
// CHECK:STDOUT: %Cycle.decl.loc8 = class_decl @Cycle, ()
// CHECK:STDOUT: %Cycle.decl.loc8 = class_decl @Cycle, () [template = constants.%Cycle]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Cycle {
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, constants.%Cycle [template = constants.%Cycle]
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%Cycle.decl.loc4 [template = constants.%Cycle]
// CHECK:STDOUT: %.loc10_20: type = ptr_type Cycle [template = constants.%.1]
// CHECK:STDOUT: %.loc10_21: type = struct_type {.b: Cycle*} [template = constants.%.2]
// CHECK:STDOUT: %.loc10_8: <unbound element of class Cycle> = field_decl c, element0 [template]
@@ -85,7 +85,7 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cycle.decl = class_decl @Cycle, ()
// CHECK:STDOUT: %Cycle.decl = class_decl @Cycle, () [template = constants.%Cycle]
// CHECK:STDOUT: %a.ref.loc7_3: ref {.b: Cycle*} = name_ref a, file.%import_ref.2
// CHECK:STDOUT: %.loc7_4: ref Cycle* = struct_access %a.ref.loc7_3, element0
// CHECK:STDOUT: %a.ref.loc7_11: ref {.b: Cycle*} = name_ref a, file.%import_ref.2
+2 -2
View File
@@ -31,14 +31,14 @@ fn MakeReorder(n: i32, next: Class*) -> Class {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Make = %Make, .MakeReorder = %MakeReorder} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Make: <function> = fn_decl @Make [template]
// CHECK:STDOUT: %MakeReorder: <function> = fn_decl @MakeReorder [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class {
// CHECK:STDOUT: %.loc8: <unbound element of class Class> = field_decl n, element0 [template]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %.loc9_18: type = ptr_type Class [template = constants.%.2]
// CHECK:STDOUT: %.loc9_11: <unbound element of class Class> = field_decl next, element1 [template]
// CHECK:STDOUT:
+2 -2
View File
@@ -27,7 +27,7 @@ fn F() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -45,7 +45,7 @@ fn F() -> i32 {
// CHECK:STDOUT: %.loc13_17: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc13_25: i32 = int_literal 2 [template = constants.%.4]
// CHECK:STDOUT: %.loc13_26.1: {.a: i32, .b: i32} = struct_literal (%.loc13_17, %.loc13_25)
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %.loc13_26.2: ref Class = temporary_storage
// CHECK:STDOUT: %.loc13_26.3: ref i32 = class_element_access %.loc13_26.2, element0
// CHECK:STDOUT: %.loc13_26.4: init i32 = initialize_from %.loc13_17 to %.loc13_26.3 [template = constants.%.3]
+4 -4
View File
@@ -37,9 +37,9 @@ fn MakeOuter() -> Outer {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Inner = %Inner.decl, .MakeInner = %MakeInner, .Outer = %Outer.decl, .MakeOuter = %MakeOuter} [template]
// CHECK:STDOUT: %Inner.decl = class_decl @Inner, ()
// CHECK:STDOUT: %Inner.decl = class_decl @Inner, () [template = constants.%Inner]
// CHECK:STDOUT: %MakeInner: <function> = fn_decl @MakeInner [template]
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, ()
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, () [template = constants.%Outer]
// CHECK:STDOUT: %MakeOuter: <function> = fn_decl @MakeOuter [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -53,9 +53,9 @@ fn MakeOuter() -> Outer {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Outer {
// CHECK:STDOUT: %Inner.ref.loc15: type = name_ref Inner, constants.%Inner [template = constants.%Inner]
// CHECK:STDOUT: %Inner.ref.loc15: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner]
// CHECK:STDOUT: %.loc15: <unbound element of class Outer> = field_decl c, element0 [template]
// CHECK:STDOUT: %Inner.ref.loc16: type = name_ref Inner, constants.%Inner [template = constants.%Inner]
// CHECK:STDOUT: %Inner.ref.loc16: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner]
// CHECK:STDOUT: %.loc16: <unbound element of class Outer> = field_decl d, element1 [template]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
+3 -3
View File
@@ -68,7 +68,7 @@ fn CallGOnInitializingExpr() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Call = %Call, .CallAlias = %CallAlias, .CallOnConstBoundMethod = %CallOnConstBoundMethod, .CallWithAddr = %CallWithAddr, .CallFThroughPointer = %CallFThroughPointer, .CallGThroughPointer = %CallGThroughPointer, .Make = %Make, .CallFOnInitializingExpr = %CallFOnInitializingExpr, .CallGOnInitializingExpr = %CallGOnInitializingExpr} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: %Call: <function> = fn_decl @Call [template]
// CHECK:STDOUT: %CallAlias: <function> = fn_decl @CallAlias [template]
@@ -129,7 +129,7 @@ fn CallGOnInitializingExpr() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc31_17: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc31_18.1: {.k: i32} = struct_literal (%.loc31_17)
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %.loc31_18.2: ref Class = temporary_storage
// CHECK:STDOUT: %.loc31_18.3: ref i32 = class_element_access %.loc31_18.2, element0
// CHECK:STDOUT: %.loc31_18.4: init i32 = initialize_from %.loc31_17 to %.loc31_18.3 [template = constants.%.5]
@@ -146,7 +146,7 @@ fn CallGOnInitializingExpr() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallWithAddr() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %c.var: ref Class = var c
// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var
// CHECK:STDOUT: %c.ref: ref Class = name_ref c, %c
+6 -6
View File
@@ -47,19 +47,19 @@ fn F(a: Outer*) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Outer = %Outer.decl, .F = %F} [template]
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, ()
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, () [template = constants.%Outer]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Outer {
// CHECK:STDOUT: %Inner.decl = class_decl @Inner, ()
// CHECK:STDOUT: %Inner.decl = class_decl @Inner, () [template = constants.%Inner]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer [template = constants.%Outer]
// CHECK:STDOUT: %.loc14_15: type = ptr_type Outer [template = constants.%.3]
// CHECK:STDOUT: %.loc14_9: <unbound element of class Outer> = field_decl po, element0 [template]
// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, constants.%Outer [template = constants.%Outer]
// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer]
// CHECK:STDOUT: %.loc15_16: type = ptr_type Outer [template = constants.%.3]
// CHECK:STDOUT: %.loc15_9: <unbound element of class Outer> = field_decl qo, element1 [template]
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, constants.%Inner [template = constants.%Inner]
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [template = constants.%Inner]
// CHECK:STDOUT: %.loc16_16: type = ptr_type Inner [template = constants.%.1]
// CHECK:STDOUT: %.loc16_9: <unbound element of class Outer> = field_decl pi, element2 [template]
// CHECK:STDOUT:
@@ -74,10 +74,10 @@ fn F(a: Outer*) {
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Inner [template = constants.%Inner]
// CHECK:STDOUT: %.loc9_17: type = ptr_type Inner [template = constants.%.1]
// CHECK:STDOUT: %.loc9_11: <unbound element of class Inner> = field_decl pi, element0 [template]
// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, constants.%Outer [template = constants.%Outer]
// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer]
// CHECK:STDOUT: %.loc10_18: type = ptr_type Outer [template = constants.%.3]
// CHECK:STDOUT: %.loc10_11: <unbound element of class Inner> = field_decl po, element1 [template]
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, constants.%Inner [template = constants.%Inner]
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner]
// CHECK:STDOUT: %.loc11_18: type = ptr_type Inner [template = constants.%.1]
// CHECK:STDOUT: %.loc11_11: <unbound element of class Inner> = field_decl qi, element2 [template]
// CHECK:STDOUT:
+3 -3
View File
@@ -33,13 +33,13 @@ fn G(o: Outer) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Outer = %Outer.decl, .F = %F, .G = %G} [template]
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, ()
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, () [template = constants.%Outer]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Outer {
// CHECK:STDOUT: %Inner.decl = class_decl @Inner, ()
// CHECK:STDOUT: %Inner.decl = class_decl @Inner, () [template = constants.%Inner]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Inner = %Inner.decl
@@ -63,7 +63,7 @@ fn G(o: Outer) {
// CHECK:STDOUT: fn @G(%o: Outer) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %o.ref: Outer = name_ref o, %o
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, constants.%Inner [template = constants.%Inner]
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner]
// CHECK:STDOUT: %i.var: ref Inner = var i
// CHECK:STDOUT: %i: ref Inner = bind_name i, %i.var
// CHECK:STDOUT: return
+1 -1
View File
@@ -33,7 +33,7 @@ fn Class.G[self: Class](r#self: i32) -> (i32, i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: }
+1 -1
View File
@@ -21,7 +21,7 @@ class Class {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class {
+2 -2
View File
@@ -21,8 +21,8 @@ fn Class.F() {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl.loc7} [template]
// CHECK:STDOUT: %Class.decl.loc7 = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl.loc9 = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl.loc7 = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Class.decl.loc9 = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -23,12 +23,12 @@ abstract class C {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl.loc7, .B = %B.decl.loc8, .C = %C.decl.loc9} [template]
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A, ()
// CHECK:STDOUT: %B.decl.loc8 = class_decl @B, ()
// CHECK:STDOUT: %C.decl.loc9 = class_decl @C, ()
// CHECK:STDOUT: %A.decl.loc11 = class_decl @A, ()
// CHECK:STDOUT: %B.decl.loc12 = class_decl @B, ()
// CHECK:STDOUT: %C.decl.loc13 = class_decl @C, ()
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %B.decl.loc8 = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C.decl.loc9 = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %A.decl.loc11 = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %B.decl.loc12 = class_decl @B, () [template = constants.%B]
// CHECK:STDOUT: %C.decl.loc13 = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @A {
+1 -1
View File
@@ -22,7 +22,7 @@ fn Class.F() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2 -2
View File
@@ -34,7 +34,7 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F, .Run = %Run} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template]
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
// CHECK:STDOUT: }
@@ -78,7 +78,7 @@ fn Run() {
// CHECK:STDOUT: assign %a.var, %.loc22
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %F.ref.loc23: <function> = name_ref F, @Class.%F [template = @Class.%F]
// CHECK:STDOUT: %.loc23: init i32 = call %F.ref.loc23()
// CHECK:STDOUT: assign %b.var, %.loc23
+1 -1
View File
@@ -31,7 +31,7 @@ fn Class.G[addr self: Class*]() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: }
+3 -3
View File
@@ -48,8 +48,8 @@ fn Call(p: Derived*) -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Base = %Base.decl, .Derived = %Derived.decl, .Call = %Call} [template]
// CHECK:STDOUT: %Base.decl = class_decl @Base, ()
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, ()
// CHECK:STDOUT: %Base.decl = class_decl @Base, () [template = constants.%Base]
// CHECK:STDOUT: %Derived.decl = class_decl @Derived, () [template = constants.%Derived]
// CHECK:STDOUT: %SelfBase: <function> = fn_decl @SelfBase [template]
// CHECK:STDOUT: %AddrSelfBase: <function> = fn_decl @AddrSelfBase [template]
// CHECK:STDOUT: %Call: <function> = fn_decl @Call [template]
@@ -63,7 +63,7 @@ fn Call(p: Derived*) -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
// CHECK:STDOUT: %Base.ref: type = name_ref Base, constants.%Base [template = constants.%Base]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base]
// CHECK:STDOUT: %.loc12: <unbound element of class Derived> = base_decl Base, element0 [template]
// CHECK:STDOUT: %SelfBase: <function> = fn_decl @SelfBase [template]
// CHECK:STDOUT: %AddrSelfBase: <function> = fn_decl @AddrSelfBase [template]
+1 -1
View File
@@ -28,7 +28,7 @@ fn Class.F[self: Class]() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+2 -2
View File
@@ -24,7 +24,7 @@ fn Run() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Run = %Run} [template]
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -39,7 +39,7 @@ fn Run() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Class.ref: type = name_ref Class, constants.%Class [template = constants.%Class]
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
// CHECK:STDOUT: %c.var: ref Class = var c
// CHECK:STDOUT: %c: ref Class = bind_name c, %c.var
// CHECK:STDOUT: %c.ref: ref Class = name_ref c, %c
+2 -2
View File
@@ -19,8 +19,8 @@ var a: A = {};
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl, .a = %a} [template]
// CHECK:STDOUT: %A.decl = class_decl @A, ()
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.decl = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A]
// CHECK:STDOUT: %a.var: ref A = var a
// CHECK:STDOUT: %a: ref A = bind_name a, %a.var
// CHECK:STDOUT: }
+2 -2
View File
@@ -23,9 +23,9 @@ var a: A = {};
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl, .ret_a = %ret_a, .a = %a} [template]
// CHECK:STDOUT: %A.decl = class_decl @A, ()
// CHECK:STDOUT: %A.decl = class_decl @A, () [template = constants.%A]
// CHECK:STDOUT: %ret_a: <function> = fn_decl @ret_a [template]
// CHECK:STDOUT: %A.ref: type = name_ref A, constants.%A [template = constants.%A]
// CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A]
// CHECK:STDOUT: %a.var: ref A = var a
// CHECK:STDOUT: %a: ref A = bind_name a, %a.var
// CHECK:STDOUT: }
@@ -45,7 +45,7 @@ class C {
// CHECK:STDOUT: file {
// CHECK:STDOUT: %.loc17: i32 = block_arg <unexpected instblockref block6>
// CHECK:STDOUT: %x: i32 = bind_name x, %.loc17
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
+1 -1
View File
@@ -20,7 +20,7 @@ impl i32 as Simple {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Simple = %Simple.decl} [template]
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, ()
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+4>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1 -1
View File
@@ -16,7 +16,7 @@ impl i32 as I;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+3>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1 -1
View File
@@ -18,7 +18,7 @@ impl i32 as Empty {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %Empty.decl} [template]
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, ()
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+3>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4 -4
View File
@@ -24,8 +24,8 @@ fn G(c: C) {
// CHECK:STDOUT: --- extend_impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.1: type = interface_type @HasF [template]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: %.3: type = tuple_type () [template]
// CHECK:STDOUT: %.4: type = ptr_type {} [template]
@@ -33,8 +33,8 @@ fn G(c: C) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.HasF = %HasF.decl, .C = %C.decl, .G = %G} [template]
// CHECK:STDOUT: %HasF.decl = interface_decl @HasF, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %HasF.decl = interface_decl @HasF, () [template = constants.%.1]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %G: <function> = fn_decl @G [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -68,7 +68,7 @@ fn G(c: C) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%c: C) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %C.ref: type = name_ref C, constants.%C [template = constants.%C]
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %F.ref.loc20: <function> = name_ref F, @HasF.%F [template = @HasF.%F]
// CHECK:STDOUT: %.loc20: init () = call %F.ref.loc20()
// CHECK:STDOUT: %c.ref: C = name_ref c, %c
@@ -26,15 +26,15 @@ class C {
// CHECK:STDOUT: --- fail_extend_impl_forall.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.1: type = interface_type @GenericInterface [template]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.GenericInterface = %GenericInterface.decl, .C = %C.decl} [template]
// CHECK:STDOUT: %GenericInterface.decl = interface_decl @GenericInterface, (<unexpected instref inst+1>, <unexpected instref inst+2>)
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %GenericInterface.decl = interface_decl @GenericInterface, (<unexpected instref inst+1>, <unexpected instref inst+2>) [template = constants.%.1]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @GenericInterface {
@@ -52,7 +52,7 @@ class C {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+10>, <unexpected instref inst+11>, <unexpected instref inst+13>, <unexpected instref inst+14>)
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+11>, <unexpected instref inst+12>, <unexpected instref inst+13>, <unexpected instref inst+14>)
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: has_error
@@ -19,7 +19,7 @@ extend impl i32 as I {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+3>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -36,8 +36,8 @@ class E {
// CHECK:STDOUT: --- fail_extend_impl_type_as.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.1: type = interface_type @I [template]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: %D: type = class_type @D [template]
// CHECK:STDOUT: %E: type = class_type @E [template]
@@ -45,10 +45,10 @@ class E {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl, .C = %C.decl, .D = %D.decl, .E = %E.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %D.decl = class_decl @D, ()
// CHECK:STDOUT: %E.decl = class_decl @E, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: %D.decl = class_decl @D, () [template = constants.%D]
// CHECK:STDOUT: %E.decl = class_decl @E, () [template = constants.%E]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I {
@@ -20,7 +20,7 @@ class C {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.C = %C.decl} [template]
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: C as i32;
@@ -19,18 +19,18 @@ interface I {
// CHECK:STDOUT: --- fail_extend_partially_defined_interface.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.1: type = interface_type @I [template]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I {
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .C = %C.decl
@@ -19,15 +19,15 @@ class C {
// CHECK:STDOUT: --- fail_extend_undefined_interface.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.1: type = interface_type @I [template]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl, .C = %C.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I;
+1 -1
View File
@@ -23,7 +23,7 @@ impl as Simple {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Simple = %Simple.decl} [template]
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, ()
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+4>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
+4 -4
View File
@@ -14,14 +14,14 @@ impl true as I {}
// CHECK:STDOUT: --- fail_impl_bad_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: bool = bool_literal true [template]
// CHECK:STDOUT: %.2: type = interface_type @I [template]
// CHECK:STDOUT: %.1: type = interface_type @I [template]
// CHECK:STDOUT: %.2: bool = bool_literal true [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+2>, <unexpected instref inst+5>)
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+3>, <unexpected instref inst+5>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I {
+1 -1
View File
@@ -24,7 +24,7 @@ impl i32 as I {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+3>)
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+5>)
// CHECK:STDOUT: }
+3 -3
View File
@@ -17,15 +17,15 @@ class C {
// CHECK:STDOUT: --- impl_as.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.1: type = interface_type @Simple [template]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Simple = %Simple.decl, .C = %C.decl} [template]
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, ()
// CHECK:STDOUT: %C.decl = class_decl @C, ()
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, () [template = constants.%.1]
// CHECK:STDOUT: %C.decl = class_decl @C, () [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Simple {
+2 -2
View File
@@ -20,8 +20,8 @@ impl forall [T:! type] T as Simple {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Simple = %Simple.decl} [template]
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, ()
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+3>, <unexpected instref inst+4>, <unexpected instref inst+5>, <unexpected instref inst+7>)
// CHECK:STDOUT: %Simple.decl = interface_decl @Simple, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+4>, <unexpected instref inst+5>, <unexpected instref inst+6>, <unexpected instref inst+7>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Simple {
+2 -2
View File
@@ -24,9 +24,9 @@ impl i32 as I {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl, .X = %X.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+3>)
// CHECK:STDOUT: %X.decl = class_decl @X, ()
// CHECK:STDOUT: %X.decl = class_decl @X, () [template = constants.%X]
// CHECK:STDOUT: impl_decl @impl, (<unexpected instref inst+10>)
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1 -1
View File
@@ -17,7 +17,7 @@ fn F(e: Empty) {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %Empty.decl, .F = %F} [template]
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, ()
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, () [template = constants.%.1]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+8 -3
View File
@@ -15,11 +15,16 @@ interface ForwardDeclared {
// CHECK:STDOUT: --- basic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @Empty [template]
// CHECK:STDOUT: %.2: type = interface_type @ForwardDeclared [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %Empty.decl, .ForwardDeclared = %ForwardDeclared.decl.loc10} [template]
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, ()
// CHECK:STDOUT: %ForwardDeclared.decl.loc10 = interface_decl @ForwardDeclared, ()
// CHECK:STDOUT: %ForwardDeclared.decl.loc12 = interface_decl @ForwardDeclared, ()
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, () [template = constants.%.1]
// CHECK:STDOUT: %ForwardDeclared.decl.loc10 = interface_decl @ForwardDeclared, () [template = constants.%.2]
// CHECK:STDOUT: %ForwardDeclared.decl.loc12 = interface_decl @ForwardDeclared, () [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Empty {
@@ -23,7 +23,7 @@ fn F(T:! Empty) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Empty = %Empty.decl, .F = %F} [template]
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, ()
// CHECK:STDOUT: %Empty.decl = interface_decl @Empty, () [template = constants.%.1]
// CHECK:STDOUT: %F: <function> = fn_decl @F [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+8 -5
View File
@@ -39,17 +39,20 @@ interface Class { }
// CHECK:STDOUT: --- fail_duplicate.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @Interface [template]
// CHECK:STDOUT: %.2: type = interface_type @.1 [template]
// CHECK:STDOUT: %Class: type = class_type @Class [template]
// CHECK:STDOUT: %.3: type = interface_type @.2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Interface = %Interface.decl.loc7, .Function = %Function, .Class = %Class.decl} [template]
// CHECK:STDOUT: %Interface.decl.loc7 = interface_decl @Interface, ()
// CHECK:STDOUT: %Interface.decl.loc15 = interface_decl @Interface, ()
// CHECK:STDOUT: %Interface.decl.loc7 = interface_decl @Interface, () [template = constants.%.1]
// CHECK:STDOUT: %Interface.decl.loc15 = interface_decl @Interface, () [template = constants.%.1]
// CHECK:STDOUT: %Function: <function> = fn_decl @Function [template]
// CHECK:STDOUT: %.decl.loc27 = interface_decl @.1, ()
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %.decl.loc37 = interface_decl @.2, ()
// CHECK:STDOUT: %.decl.loc27 = interface_decl @.1, () [template = constants.%.2]
// CHECK:STDOUT: %Class.decl = class_decl @Class, () [template = constants.%Class]
// CHECK:STDOUT: %.decl.loc37 = interface_decl @.2, () [template = constants.%.3]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Interface {
+11 -4
View File
@@ -28,12 +28,19 @@ protected interface Protected;
// CHECK:STDOUT: --- fail_modifiers.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @Abstract [template]
// CHECK:STDOUT: %.2: type = interface_type @Default [template]
// CHECK:STDOUT: %.3: type = interface_type @Virtual [template]
// CHECK:STDOUT: %.4: type = interface_type @Protected [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Abstract = %Abstract.decl, .Default = %Default.decl, .Virtual = %Virtual.decl, .Protected = %Protected.decl} [template]
// CHECK:STDOUT: %Abstract.decl = interface_decl @Abstract, ()
// CHECK:STDOUT: %Default.decl = interface_decl @Default, ()
// CHECK:STDOUT: %Virtual.decl = interface_decl @Virtual, ()
// CHECK:STDOUT: %Protected.decl = interface_decl @Protected, ()
// CHECK:STDOUT: %Abstract.decl = interface_decl @Abstract, () [template = constants.%.1]
// CHECK:STDOUT: %Default.decl = interface_decl @Default, () [template = constants.%.2]
// CHECK:STDOUT: %Virtual.decl = interface_decl @Virtual, () [template = constants.%.3]
// CHECK:STDOUT: %Protected.decl = interface_decl @Protected, () [template = constants.%.4]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Abstract {
@@ -14,9 +14,13 @@ interface I[]();
// CHECK:STDOUT: --- fail_todo_generic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @I [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.I = %I.decl} [template]
// CHECK:STDOUT: %I.decl = interface_decl @I, ()
// CHECK:STDOUT: %I.decl = interface_decl @I, () [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I;
@@ -23,10 +23,15 @@ private interface Private {
// CHECK:STDOUT: --- fail_todo_modifiers.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @Modifiers [template]
// CHECK:STDOUT: %.2: type = interface_type @Private [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Modifiers = %Modifiers.decl, .Private = %Private.decl} [template]
// CHECK:STDOUT: %Modifiers.decl = interface_decl @Modifiers, ()
// CHECK:STDOUT: %Private.decl = interface_decl @Private, ()
// CHECK:STDOUT: %Modifiers.decl = interface_decl @Modifiers, () [template = constants.%.1]
// CHECK:STDOUT: %Private.decl = interface_decl @Private, () [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Modifiers {

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