Replace builtin CppVoidType with a prelude type. (#6403)

Following #6357, map C++ `void` to a prelude class type
`Core.CppCompat.VoidBase`, not to a builtin type. This is mostly just
moving logic around, but does notably change `Cpp.void` from being an
incomplete type to being a complete-but-abstract type.

Also change `NullptrT` to be an adapter for `void*` instead of `()*`, to
follow the approved design.

Implicit conversions to `void` and to `void*` are still absent.

Part of #6280.
This commit is contained in:
Richard Smith
2025-11-19 20:40:17 +00:00
committed by GitHub
parent da8c9d6132
commit 0678501038
29 changed files with 2538 additions and 2364 deletions
+2 -1
View File
@@ -7,12 +7,13 @@ package Core library "prelude/types";
export import library "prelude/types/bool";
export import library "prelude/types/char";
export import library "prelude/types/cpp/int";
export import library "prelude/types/cpp/nullptr";
export import library "prelude/types/cpp/void";
export import library "prelude/types/float";
export import library "prelude/types/float_literal";
export import library "prelude/types/int";
export import library "prelude/types/int_literal";
export import library "prelude/types/maybe_unformed";
export import library "prelude/types/cpp/nullptr";
export import library "prelude/types/optional";
export import library "prelude/types/string";
export import library "prelude/types/uint";
+3 -2
View File
@@ -7,8 +7,9 @@ package Core library "prelude/types/cpp/nullptr";
import library "prelude/copy";
import library "prelude/destroy";
import library "prelude/operators/as";
import library "prelude/types/optional";
import library "prelude/types/cpp/void";
import library "prelude/types/maybe_unformed";
import library "prelude/types/optional";
namespace CppCompat;
@@ -26,7 +27,7 @@ class CppCompat.NullptrT {
// nullptr_t has the same size and alignment as a pointer, but the
// corresponding pointer is always unformed.
// TODO: Give this type a custom empty value representation.
adapt MaybeUnformed(()*);
adapt MaybeUnformed(VoidBase*);
fn Make() -> Self {
returned var s: Self;
+29
View File
@@ -0,0 +1,29 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
package Core library "prelude/types/cpp/void";
namespace CppCompat;
// C++ `void` as a Carbon type.
//
// This type represents a notional "base-most" object at the root of every
// inheritance hierarchy. There are no objects of type `VoidType`, but any value
// can be converted to a value of type `VoidType`.
//
// This type is used as the default mapping for C++ `void`, which is used in
// most contexts in which `void` can appear: for example, as a pointee of a
// pointer type, as the type of a typedef, or as a type template argument.
// However, in a function signature, a `void` return type maps to `()` instead,
// and a `(void)` parameter list maps to `()`.
//
// This type is also available via the alias `Cpp.void`.
abstract class CppCompat.VoidBase {
adapt ();
}
// TODO: An unqualified pointer to `T` should implicitly convert to a pointer to
// `<qualifiers> void` if `<qualifiers>` includes all of the qualifiers for `T`.
// Similarly, a value of type `T` should implicitly convert to a value of type
// `void`.
+9 -8
View File
@@ -1062,6 +1062,12 @@ static auto MakeIntType(Context& context, IntId size_id, bool is_signed)
return ExprAsType(context, Parse::NodeId::None, type_inst_id);
}
static auto MakeCppCompatType(Context& context, SemIR::LocId loc_id,
llvm::StringRef name) -> TypeExpr {
return ExprAsType(context, loc_id,
LookupNameInCore(context, loc_id, {"CppCompat", name}));
}
// Maps a C++ builtin integer type to a Carbon type.
// TODO: Handle integer types that map to named aliases.
static auto MapBuiltinIntegerType(Context& context, SemIR::LocId loc_id,
@@ -1090,17 +1096,13 @@ static auto MapBuiltinIntegerType(Context& context, SemIR::LocId loc_id,
}
if (clang::ASTContext::hasSameType(qual_type, ast_context.LongTy) &&
width == 32) {
return ExprAsType(context, Parse::NodeId::None,
LookupNameInCore(context, Parse::NodeId::None,
{"CppCompat", "Long32"}));
return MakeCppCompatType(context, loc_id, "Long32");
}
return TypeExpr::None;
}
static auto MapNullptrType(Context& context, SemIR::LocId loc_id) -> TypeExpr {
return ExprAsType(
context, loc_id,
LookupNameInCore(context, loc_id, {"CppCompat", "NullptrT"}));
return MakeCppCompatType(context, loc_id, "NullptrT");
}
// Maps a C++ builtin type to a Carbon type.
@@ -1129,8 +1131,7 @@ static auto MapBuiltinType(Context& context, SemIR::LocId loc_id,
}
// TODO: Handle floating-point types that map to named aliases.
} else if (type.isVoidType()) {
return ExprAsType(context, Parse::NodeId::None,
SemIR::CppVoidType::TypeInstId);
return MakeCppCompatType(context, loc_id, "VoidBase");
} else if (type.isNullPtrType()) {
return MapNullptrType(context, loc_id);
}
+5 -33
View File
@@ -161,6 +161,9 @@ static auto TryMapClassType(Context& context, SemIR::ClassType class_type)
case SemIR::RecognizedTypeInfo::CppNullptrT: {
return ast_context.NullPtrTy;
}
case SemIR::RecognizedTypeInfo::CppVoidBase: {
return ast_context.VoidTy;
}
case SemIR::RecognizedTypeInfo::Str: {
return LookupCppType(context, {"std", "string_view"});
}
@@ -207,33 +210,6 @@ static auto MapNonWrapperType(Context& context, SemIR::InstId inst_id,
}
}
// Returns `void*` if the type is a wrapped `Cpp.void*`, consuming the pointer
// from `wrapper_types`. Otherwise returns no type.
static auto TryMapVoidPointer(Context& context, SemIR::TypeId type_id,
llvm::SmallVector<SemIR::TypeId>& wrapper_types)
-> clang::QualType {
if (type_id != SemIR::CppVoidType::TypeId || wrapper_types.empty()) {
return clang::QualType();
}
if (context.types().Is<SemIR::PointerType>(wrapper_types.back())) {
// `void*`.
wrapper_types.pop_back();
} else if (wrapper_types.size() >= 2 &&
context.types().Is<SemIR::ConstType>(wrapper_types.back()) &&
context.types().Is<SemIR::PointerType>(
wrapper_types[wrapper_types.size() - 2])) {
// `const void*`.
wrapper_types.erase(wrapper_types.end() - 2);
} else {
return clang::QualType();
}
return context.ast_context().getAttributedType(
clang::attr::TypeNonNull, context.ast_context().VoidPtrTy,
context.ast_context().VoidPtrTy);
}
// Maps a Carbon type to a C++ type. Accepts an InstId, representing a value
// whose type is mapped to a C++ type. Returns `clang::QualType` if the mapping
// succeeds, or `clang::QualType::isNull()` if the type is not supported.
@@ -258,13 +234,9 @@ static auto MapToCppType(Context& context, SemIR::InstId inst_id)
wrapper_types.push_back(orig_type_id);
}
clang::QualType mapped_type =
TryMapVoidPointer(context, type_id, wrapper_types);
clang::QualType mapped_type = MapNonWrapperType(context, inst_id, type_id);
if (mapped_type.isNull()) {
mapped_type = MapNonWrapperType(context, inst_id, type_id);
if (mapped_type.isNull()) {
return mapped_type;
}
return mapped_type;
}
for (auto wrapper_type_id : llvm::reverse(wrapper_types)) {
+4 -6
View File
@@ -20,7 +20,7 @@
// CHECK:STDOUT: import_ir_insts: {}
// CHECK:STDOUT: clang_decls: {}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {}}
// CHECK:STDOUT: entity_names: {}
// CHECK:STDOUT: cpp_global_vars: {}
// CHECK:STDOUT: functions: {}
@@ -42,7 +42,6 @@
// CHECK:STDOUT: 'inst(BoolType)': {kind: BoolType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(BoundMethodType)': {kind: BoundMethodType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(CharLiteralType)': {kind: CharLiteralType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(CppVoidType)': {kind: CppVoidType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(ErrorInst)': {kind: ErrorInst, type: type(Error)}
// CHECK:STDOUT: 'inst(FloatLiteralType)': {kind: FloatLiteralType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(InstType)': {kind: InstType, type: type(TypeType)}
@@ -51,7 +50,7 @@
// CHECK:STDOUT: 'inst(SpecificFunctionType)': {kind: SpecificFunctionType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(VtableType)': {kind: VtableType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(WitnessType)': {kind: WitnessType, type: type(TypeType)}
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: 'inst(TypeType)': concrete_constant(inst(TypeType))
@@ -59,7 +58,6 @@
// CHECK:STDOUT: 'inst(BoolType)': concrete_constant(inst(BoolType))
// CHECK:STDOUT: 'inst(BoundMethodType)': concrete_constant(inst(BoundMethodType))
// CHECK:STDOUT: 'inst(CharLiteralType)': concrete_constant(inst(CharLiteralType))
// CHECK:STDOUT: 'inst(CppVoidType)': concrete_constant(inst(CppVoidType))
// CHECK:STDOUT: 'inst(ErrorInst)': concrete_constant(inst(ErrorInst))
// CHECK:STDOUT: 'inst(FloatLiteralType)': concrete_constant(inst(FloatLiteralType))
// CHECK:STDOUT: 'inst(InstType)': concrete_constant(inst(InstType))
@@ -68,7 +66,7 @@
// CHECK:STDOUT: 'inst(SpecificFunctionType)': concrete_constant(inst(SpecificFunctionType))
// CHECK:STDOUT: 'inst(VtableType)': concrete_constant(inst(VtableType))
// CHECK:STDOUT: 'inst(WitnessType)': concrete_constant(inst(WitnessType))
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
@@ -76,5 +74,5 @@
// CHECK:STDOUT: imports: {}
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block60000004:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: ...
+212 -214
View File
@@ -43,18 +43,18 @@ fn G(x: Cpp.X) {
// CHECK:STDOUT: import_ir_inst1: {ir_id: import_ir(Cpp), clang_source_loc_id: clang_source_loc60000001}
// CHECK:STDOUT: import_ir_inst2: {ir_id: import_ir(Cpp), clang_source_loc_id: clang_source_loc60000002}
// CHECK:STDOUT: clang_decls:
// CHECK:STDOUT: clang_decl_id60000000: {key: "<translation unit>", inst_id: inst60000010}
// CHECK:STDOUT: clang_decl_id60000001: {key: "struct X {}", inst_id: inst60000013}
// CHECK:STDOUT: clang_decl_id60000002: {key: "X * _Nonnull p", inst_id: inst60000021}
// CHECK:STDOUT: clang_decl_id60000003: {key: {decl: "void f(X x = {})", num_params: 0}, inst_id: inst6000002C}
// CHECK:STDOUT: clang_decl_id60000004: {key: {decl: "extern void f__carbon_thunk()", num_params: 0}, inst_id: inst6000002F}
// CHECK:STDOUT: clang_decl_id60000005: {key: {decl: "void f(X x = {})", num_params: 1}, inst_id: inst6000003A}
// CHECK:STDOUT: clang_decl_id60000006: {key: {decl: "extern void f__carbon_thunk(X * _Nonnull x)", num_params: 1}, inst_id: inst60000042}
// CHECK:STDOUT: clang_decl_id60000007: {key: "X * _Nonnull global", inst_id: inst6000004B}
// CHECK:STDOUT: clang_decl_id60000000: {key: "<translation unit>", inst_id: inst6000000F}
// CHECK:STDOUT: clang_decl_id60000001: {key: "struct X {}", inst_id: inst60000012}
// CHECK:STDOUT: clang_decl_id60000002: {key: "X * _Nonnull p", inst_id: inst60000020}
// CHECK:STDOUT: clang_decl_id60000003: {key: {decl: "void f(X x = {})", num_params: 0}, inst_id: inst6000002B}
// CHECK:STDOUT: clang_decl_id60000004: {key: {decl: "extern void f__carbon_thunk()", num_params: 0}, inst_id: inst6000002E}
// CHECK:STDOUT: clang_decl_id60000005: {key: {decl: "void f(X x = {})", num_params: 1}, inst_id: inst60000039}
// CHECK:STDOUT: clang_decl_id60000006: {key: {decl: "extern void f__carbon_thunk(X * _Nonnull x)", num_params: 1}, inst_id: inst60000041}
// CHECK:STDOUT: clang_decl_id60000007: {key: "X * _Nonnull global", inst_id: inst6000004A}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name(Cpp): inst60000010, name0: inst6000001C}}
// CHECK:STDOUT: name_scope60000001: {inst: inst60000010, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name2: inst60000013, name3: inst60000029, name4: inst6000004B}}
// CHECK:STDOUT: name_scope60000002: {inst: inst60000013, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name(Cpp): inst6000000F, name0: inst6000001B}}
// CHECK:STDOUT: name_scope60000001: {inst: inst6000000F, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name2: inst60000012, name3: inst60000028, name4: inst6000004A}}
// CHECK:STDOUT: name_scope60000002: {inst: inst60000012, parent_scope: name_scope60000001, has_error: false, extended_scopes: [], names: {}}
// CHECK:STDOUT: entity_names:
// CHECK:STDOUT: entity_name60000000: {name: name1, parent_scope: name_scope<none>, index: -1, is_template: 0}
// CHECK:STDOUT: entity_name60000001: {name: name1, parent_scope: name_scope<none>, index: -1, is_template: 0}
@@ -69,15 +69,15 @@ fn G(x: Cpp.X) {
// CHECK:STDOUT: function60000003: {name: name3, parent_scope: name_scope60000001, call_params_id: inst_block6000000D}
// CHECK:STDOUT: function60000004: {name: name6, parent_scope: name_scope60000001, call_params_id: inst_block60000012}
// CHECK:STDOUT: classes:
// CHECK:STDOUT: class60000000: {name: name2, parent_scope: name_scope60000001, self_type_id: type(inst60000014), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope60000002, body_block_id: inst_block6000000A, adapt_id: inst<none>, base_id: inst<none>, complete_type_witness_id: inst60000024, vtable_decl_id: inst<none>}}
// CHECK:STDOUT: class60000000: {name: name2, parent_scope: name_scope60000001, self_type_id: type(inst60000013), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope60000002, body_block_id: inst_block6000000A, adapt_id: inst<none>, base_id: inst<none>, complete_type_witness_id: inst60000023, vtable_decl_id: inst<none>}}
// CHECK:STDOUT: generics: {}
// CHECK:STDOUT: specifics: {}
// CHECK:STDOUT: struct_type_fields:
// CHECK:STDOUT: struct_type_fields_empty: {}
// CHECK:STDOUT: struct_type_fields60000001:
// CHECK:STDOUT: 0: {name_id: name5, type_inst_id: inst6000001F}
// CHECK:STDOUT: 0: {name_id: name5, type_inst_id: inst6000001E}
// CHECK:STDOUT: struct_type_fields60000002:
// CHECK:STDOUT: 0: {name_id: name5, type_inst_id: inst6000001F}
// CHECK:STDOUT: 0: {name_id: name5, type_inst_id: inst6000001E}
// CHECK:STDOUT: types:
// CHECK:STDOUT: 'type(TypeType)':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(TypeType)}
@@ -86,38 +86,37 @@ fn G(x: Cpp.X) {
// CHECK:STDOUT: 'type(inst(NamespaceType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
// CHECK:STDOUT: 'type(inst(InstType))':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst60000012)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst6000001D)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst6000001F)':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst6000001F)}
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst60000011)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst6000001C)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst6000001E)':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst6000001E)}
// CHECK:STDOUT: 'type(inst(WitnessType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(WitnessType))}
// CHECK:STDOUT: 'type(inst60000026)':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst60000026)}
// CHECK:STDOUT: 'type(inst60000023)':
// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000026)}
// CHECK:STDOUT: 'type(inst60000014)':
// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000026)}
// CHECK:STDOUT: 'type(inst60000028)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst6000002D)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst60000030)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst6000003B)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst60000043)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000012)}
// CHECK:STDOUT: 'type(inst60000025)':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst60000025)}
// CHECK:STDOUT: 'type(inst60000022)':
// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000025)}
// CHECK:STDOUT: 'type(inst60000013)':
// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000025)}
// CHECK:STDOUT: 'type(inst60000027)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst6000002C)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst6000002F)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst6000003A)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst60000042)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: 'inst(TypeType)': {kind: TypeType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(AutoType)': {kind: AutoType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(BoolType)': {kind: BoolType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(BoundMethodType)': {kind: BoundMethodType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(CharLiteralType)': {kind: CharLiteralType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(CppVoidType)': {kind: CppVoidType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(ErrorInst)': {kind: ErrorInst, type: type(Error)}
// CHECK:STDOUT: 'inst(FloatLiteralType)': {kind: FloatLiteralType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(InstType)': {kind: InstType, type: type(TypeType)}
@@ -126,79 +125,79 @@ fn G(x: Cpp.X) {
// CHECK:STDOUT: 'inst(SpecificFunctionType)': {kind: SpecificFunctionType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(VtableType)': {kind: VtableType, type: type(TypeType)}
// CHECK:STDOUT: 'inst(WitnessType)': {kind: WitnessType, type: type(TypeType)}
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000F: {kind: ImportCppDecl}
// CHECK:STDOUT: inst60000010: {kind: Namespace, arg0: name_scope60000001, arg1: inst6000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000011: {kind: NameRef, arg0: name(Cpp), arg1: inst60000010, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000012: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst60000013: {kind: ClassDecl, arg0: class60000000, arg1: inst_block<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000014: {kind: ClassType, arg0: class60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000015: {kind: NameRef, arg0: name2, arg1: inst60000013, type: type(TypeType)}
// CHECK:STDOUT: inst60000016: {kind: ValueBinding, arg0: entity_name60000000, arg1: inst6000001A, type: type(inst60000014)}
// CHECK:STDOUT: inst60000017: {kind: PatternType, arg0: inst60000014, type: type(TypeType)}
// CHECK:STDOUT: inst60000018: {kind: ValueBindingPattern, arg0: entity_name60000000, type: type(inst60000017)}
// CHECK:STDOUT: inst60000019: {kind: ValueParamPattern, arg0: inst60000018, arg1: call_param0, type: type(inst60000017)}
// CHECK:STDOUT: inst6000001A: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst60000014)}
// CHECK:STDOUT: inst6000001B: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000015, type: type(TypeType)}
// CHECK:STDOUT: inst6000001C: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000008, type: type(inst6000001D)}
// CHECK:STDOUT: inst6000001D: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst6000001E: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000001D)}
// CHECK:STDOUT: inst6000001F: {kind: PointerType, arg0: inst60000014, type: type(TypeType)}
// CHECK:STDOUT: inst60000020: {kind: UnboundElementType, arg0: inst60000014, arg1: inst6000001F, type: type(TypeType)}
// CHECK:STDOUT: inst60000021: {kind: FieldDecl, arg0: name5, arg1: element0, type: type(inst60000020)}
// CHECK:STDOUT: inst60000022: {kind: CustomLayoutType, arg0: struct_type_fields60000001, arg1: custom_layout60000001, type: type(TypeType)}
// CHECK:STDOUT: inst60000023: {kind: CustomLayoutType, arg0: struct_type_fields60000002, arg1: custom_layout60000001, type: type(TypeType)}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000E: {kind: ImportCppDecl}
// CHECK:STDOUT: inst6000000F: {kind: Namespace, arg0: name_scope60000001, arg1: inst6000000E, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000010: {kind: NameRef, arg0: name(Cpp), arg1: inst6000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000011: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst60000012: {kind: ClassDecl, arg0: class60000000, arg1: inst_block<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000013: {kind: ClassType, arg0: class60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000014: {kind: NameRef, arg0: name2, arg1: inst60000012, type: type(TypeType)}
// CHECK:STDOUT: inst60000015: {kind: ValueBinding, arg0: entity_name60000000, arg1: inst60000019, type: type(inst60000013)}
// CHECK:STDOUT: inst60000016: {kind: PatternType, arg0: inst60000013, type: type(TypeType)}
// CHECK:STDOUT: inst60000017: {kind: ValueBindingPattern, arg0: entity_name60000000, type: type(inst60000016)}
// CHECK:STDOUT: inst60000018: {kind: ValueParamPattern, arg0: inst60000017, arg1: call_param0, type: type(inst60000016)}
// CHECK:STDOUT: inst60000019: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst60000013)}
// CHECK:STDOUT: inst6000001A: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000014, type: type(TypeType)}
// CHECK:STDOUT: inst6000001B: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000008, type: type(inst6000001C)}
// CHECK:STDOUT: inst6000001C: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst6000001D: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000001C)}
// CHECK:STDOUT: inst6000001E: {kind: PointerType, arg0: inst60000013, type: type(TypeType)}
// CHECK:STDOUT: inst6000001F: {kind: UnboundElementType, arg0: inst60000013, arg1: inst6000001E, type: type(TypeType)}
// CHECK:STDOUT: inst60000020: {kind: FieldDecl, arg0: name5, arg1: element0, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000021: {kind: CustomLayoutType, arg0: struct_type_fields60000001, arg1: custom_layout60000001, type: type(TypeType)}
// CHECK:STDOUT: inst60000022: {kind: CustomLayoutType, arg0: struct_type_fields60000002, arg1: custom_layout60000001, type: type(TypeType)}
// CHECK:STDOUT: inst60000023: {kind: CompleteTypeWitness, arg0: inst60000021, type: type(inst(WitnessType))}
// CHECK:STDOUT: inst60000024: {kind: CompleteTypeWitness, arg0: inst60000022, type: type(inst(WitnessType))}
// CHECK:STDOUT: inst60000025: {kind: CompleteTypeWitness, arg0: inst60000023, type: type(inst(WitnessType))}
// CHECK:STDOUT: inst60000026: {kind: PointerType, arg0: inst60000023, type: type(TypeType)}
// CHECK:STDOUT: inst60000027: {kind: NameRef, arg0: name(Cpp), arg1: inst60000010, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000028: {kind: CppOverloadSetType, arg0: cpp_overload_set60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000029: {kind: CppOverloadSetValue, arg0: cpp_overload_set60000000, type: type(inst60000028)}
// CHECK:STDOUT: inst6000002A: {kind: CppOverloadSetValue, arg0: cpp_overload_set60000000, type: type(inst60000028)}
// CHECK:STDOUT: inst6000002B: {kind: NameRef, arg0: name3, arg1: inst60000029, type: type(inst60000028)}
// CHECK:STDOUT: inst6000002C: {kind: FunctionDecl, arg0: function60000001, arg1: inst_block_empty, type: type(inst6000002D)}
// CHECK:STDOUT: inst6000002D: {kind: FunctionType, arg0: function60000001, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst6000002E: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000002D)}
// CHECK:STDOUT: inst6000002F: {kind: FunctionDecl, arg0: function60000002, arg1: inst_block_empty, type: type(inst60000030)}
// CHECK:STDOUT: inst60000030: {kind: FunctionType, arg0: function60000002, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000031: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000030)}
// CHECK:STDOUT: inst60000032: {kind: Call, arg0: inst6000002F, arg1: inst_block_empty, type: type(inst60000012)}
// CHECK:STDOUT: inst60000033: {kind: NameRef, arg0: name(Cpp), arg1: inst60000010, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000034: {kind: NameRef, arg0: name3, arg1: inst60000029, type: type(inst60000028)}
// CHECK:STDOUT: inst60000035: {kind: NameRef, arg0: name1, arg1: inst60000016, type: type(inst60000014)}
// CHECK:STDOUT: inst60000036: {kind: ValueBinding, arg0: entity_name60000001, arg1: inst60000039, type: type(inst60000014)}
// CHECK:STDOUT: inst60000037: {kind: ValueBindingPattern, arg0: entity_name60000001, type: type(inst60000017)}
// CHECK:STDOUT: inst60000038: {kind: ValueParamPattern, arg0: inst60000037, arg1: call_param0, type: type(inst60000017)}
// CHECK:STDOUT: inst60000039: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst60000014)}
// CHECK:STDOUT: inst6000003A: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block6000000F, type: type(inst6000003B)}
// CHECK:STDOUT: inst6000003B: {kind: FunctionType, arg0: function60000003, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst6000003C: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000003B)}
// CHECK:STDOUT: inst6000003D: {kind: ValueBinding, arg0: entity_name60000002, arg1: inst60000041, type: type(inst6000001F)}
// CHECK:STDOUT: inst6000003E: {kind: PatternType, arg0: inst6000001F, type: type(TypeType)}
// CHECK:STDOUT: inst6000003F: {kind: ValueBindingPattern, arg0: entity_name60000002, type: type(inst6000003E)}
// CHECK:STDOUT: inst60000040: {kind: ValueParamPattern, arg0: inst6000003F, arg1: call_param0, type: type(inst6000003E)}
// CHECK:STDOUT: inst60000041: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000042: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block60000014, type: type(inst60000043)}
// CHECK:STDOUT: inst60000043: {kind: FunctionType, arg0: function60000004, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000044: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000043)}
// CHECK:STDOUT: inst60000045: {kind: ValueAsRef, arg0: inst60000035, type: type(inst60000014)}
// CHECK:STDOUT: inst60000046: {kind: AddrOf, arg0: inst60000045, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000047: {kind: Call, arg0: inst60000042, arg1: inst_block60000016, type: type(inst60000012)}
// CHECK:STDOUT: inst60000048: {kind: NameRef, arg0: name(Cpp), arg1: inst60000010, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000049: {kind: NameRef, arg0: name3, arg1: inst60000029, type: type(inst60000028)}
// CHECK:STDOUT: inst6000004A: {kind: NameRef, arg0: name(Cpp), arg1: inst60000010, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000004B: {kind: VarStorage, arg0: inst6000004D, type: type(inst6000001F)}
// CHECK:STDOUT: inst6000004C: {kind: RefBindingPattern, arg0: entity_name60000003, type: type(inst6000003E)}
// CHECK:STDOUT: inst6000004D: {kind: VarPattern, arg0: inst6000004C, type: type(inst6000003E)}
// CHECK:STDOUT: inst6000004E: {kind: NameBindingDecl, arg0: inst_block60000017}
// CHECK:STDOUT: inst6000004F: {kind: NameRef, arg0: name4, arg1: inst6000004B, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000050: {kind: AcquireValue, arg0: inst6000004F, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000051: {kind: Deref, arg0: inst60000050, type: type(inst60000014)}
// CHECK:STDOUT: inst60000052: {kind: AcquireValue, arg0: inst60000051, type: type(inst60000014)}
// CHECK:STDOUT: inst60000053: {kind: ValueAsRef, arg0: inst60000052, type: type(inst60000014)}
// CHECK:STDOUT: inst60000054: {kind: AddrOf, arg0: inst60000053, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000055: {kind: Call, arg0: inst60000042, arg1: inst_block60000019, type: type(inst60000012)}
// CHECK:STDOUT: inst60000056: {kind: Return}
// CHECK:STDOUT: inst60000025: {kind: PointerType, arg0: inst60000022, type: type(TypeType)}
// CHECK:STDOUT: inst60000026: {kind: NameRef, arg0: name(Cpp), arg1: inst6000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000027: {kind: CppOverloadSetType, arg0: cpp_overload_set60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000028: {kind: CppOverloadSetValue, arg0: cpp_overload_set60000000, type: type(inst60000027)}
// CHECK:STDOUT: inst60000029: {kind: CppOverloadSetValue, arg0: cpp_overload_set60000000, type: type(inst60000027)}
// CHECK:STDOUT: inst6000002A: {kind: NameRef, arg0: name3, arg1: inst60000028, type: type(inst60000027)}
// CHECK:STDOUT: inst6000002B: {kind: FunctionDecl, arg0: function60000001, arg1: inst_block_empty, type: type(inst6000002C)}
// CHECK:STDOUT: inst6000002C: {kind: FunctionType, arg0: function60000001, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst6000002D: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000002C)}
// CHECK:STDOUT: inst6000002E: {kind: FunctionDecl, arg0: function60000002, arg1: inst_block_empty, type: type(inst6000002F)}
// CHECK:STDOUT: inst6000002F: {kind: FunctionType, arg0: function60000002, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000030: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000002F)}
// CHECK:STDOUT: inst60000031: {kind: Call, arg0: inst6000002E, arg1: inst_block_empty, type: type(inst60000011)}
// CHECK:STDOUT: inst60000032: {kind: NameRef, arg0: name(Cpp), arg1: inst6000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000033: {kind: NameRef, arg0: name3, arg1: inst60000028, type: type(inst60000027)}
// CHECK:STDOUT: inst60000034: {kind: NameRef, arg0: name1, arg1: inst60000015, type: type(inst60000013)}
// CHECK:STDOUT: inst60000035: {kind: ValueBinding, arg0: entity_name60000001, arg1: inst60000038, type: type(inst60000013)}
// CHECK:STDOUT: inst60000036: {kind: ValueBindingPattern, arg0: entity_name60000001, type: type(inst60000016)}
// CHECK:STDOUT: inst60000037: {kind: ValueParamPattern, arg0: inst60000036, arg1: call_param0, type: type(inst60000016)}
// CHECK:STDOUT: inst60000038: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst60000013)}
// CHECK:STDOUT: inst60000039: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block6000000F, type: type(inst6000003A)}
// CHECK:STDOUT: inst6000003A: {kind: FunctionType, arg0: function60000003, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst6000003B: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000003A)}
// CHECK:STDOUT: inst6000003C: {kind: ValueBinding, arg0: entity_name60000002, arg1: inst60000040, type: type(inst6000001E)}
// CHECK:STDOUT: inst6000003D: {kind: PatternType, arg0: inst6000001E, type: type(TypeType)}
// CHECK:STDOUT: inst6000003E: {kind: ValueBindingPattern, arg0: entity_name60000002, type: type(inst6000003D)}
// CHECK:STDOUT: inst6000003F: {kind: ValueParamPattern, arg0: inst6000003E, arg1: call_param0, type: type(inst6000003D)}
// CHECK:STDOUT: inst60000040: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst6000001E)}
// CHECK:STDOUT: inst60000041: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block60000014, type: type(inst60000042)}
// CHECK:STDOUT: inst60000042: {kind: FunctionType, arg0: function60000004, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000043: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000042)}
// CHECK:STDOUT: inst60000044: {kind: ValueAsRef, arg0: inst60000034, type: type(inst60000013)}
// CHECK:STDOUT: inst60000045: {kind: AddrOf, arg0: inst60000044, type: type(inst6000001E)}
// CHECK:STDOUT: inst60000046: {kind: Call, arg0: inst60000041, arg1: inst_block60000016, type: type(inst60000011)}
// CHECK:STDOUT: inst60000047: {kind: NameRef, arg0: name(Cpp), arg1: inst6000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst60000048: {kind: NameRef, arg0: name3, arg1: inst60000028, type: type(inst60000027)}
// CHECK:STDOUT: inst60000049: {kind: NameRef, arg0: name(Cpp), arg1: inst6000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000004A: {kind: VarStorage, arg0: inst6000004C, type: type(inst6000001E)}
// CHECK:STDOUT: inst6000004B: {kind: RefBindingPattern, arg0: entity_name60000003, type: type(inst6000003D)}
// CHECK:STDOUT: inst6000004C: {kind: VarPattern, arg0: inst6000004B, type: type(inst6000003D)}
// CHECK:STDOUT: inst6000004D: {kind: NameBindingDecl, arg0: inst_block60000017}
// CHECK:STDOUT: inst6000004E: {kind: NameRef, arg0: name4, arg1: inst6000004A, type: type(inst6000001E)}
// CHECK:STDOUT: inst6000004F: {kind: AcquireValue, arg0: inst6000004E, type: type(inst6000001E)}
// CHECK:STDOUT: inst60000050: {kind: Deref, arg0: inst6000004F, type: type(inst60000013)}
// CHECK:STDOUT: inst60000051: {kind: AcquireValue, arg0: inst60000050, type: type(inst60000013)}
// CHECK:STDOUT: inst60000052: {kind: ValueAsRef, arg0: inst60000051, type: type(inst60000013)}
// CHECK:STDOUT: inst60000053: {kind: AddrOf, arg0: inst60000052, type: type(inst6000001E)}
// CHECK:STDOUT: inst60000054: {kind: Call, arg0: inst60000041, arg1: inst_block60000019, type: type(inst60000011)}
// CHECK:STDOUT: inst60000055: {kind: Return}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: 'inst(TypeType)': concrete_constant(inst(TypeType))
@@ -206,7 +205,6 @@ fn G(x: Cpp.X) {
// CHECK:STDOUT: 'inst(BoolType)': concrete_constant(inst(BoolType))
// CHECK:STDOUT: 'inst(BoundMethodType)': concrete_constant(inst(BoundMethodType))
// CHECK:STDOUT: 'inst(CharLiteralType)': concrete_constant(inst(CharLiteralType))
// CHECK:STDOUT: 'inst(CppVoidType)': concrete_constant(inst(CppVoidType))
// CHECK:STDOUT: 'inst(ErrorInst)': concrete_constant(inst(ErrorInst))
// CHECK:STDOUT: 'inst(FloatLiteralType)': concrete_constant(inst(FloatLiteralType))
// CHECK:STDOUT: 'inst(InstType)': concrete_constant(inst(InstType))
@@ -215,149 +213,149 @@ fn G(x: Cpp.X) {
// CHECK:STDOUT: 'inst(SpecificFunctionType)': concrete_constant(inst(SpecificFunctionType))
// CHECK:STDOUT: 'inst(VtableType)': concrete_constant(inst(VtableType))
// CHECK:STDOUT: 'inst(WitnessType)': concrete_constant(inst(WitnessType))
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: inst60000010: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000011: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000012: concrete_constant(inst60000012)
// CHECK:STDOUT: inst60000013: concrete_constant(inst60000014)
// CHECK:STDOUT: inst60000014: concrete_constant(inst60000014)
// CHECK:STDOUT: inst60000015: concrete_constant(inst60000014)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: inst6000000F: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000010: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000011: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000012: concrete_constant(inst60000013)
// CHECK:STDOUT: inst60000013: concrete_constant(inst60000013)
// CHECK:STDOUT: inst60000014: concrete_constant(inst60000013)
// CHECK:STDOUT: inst60000016: concrete_constant(inst60000016)
// CHECK:STDOUT: inst60000017: concrete_constant(inst60000017)
// CHECK:STDOUT: inst60000018: concrete_constant(inst60000018)
// CHECK:STDOUT: inst60000019: concrete_constant(inst60000019)
// CHECK:STDOUT: inst6000001B: concrete_constant(inst60000014)
// CHECK:STDOUT: inst6000001C: concrete_constant(inst6000001E)
// CHECK:STDOUT: inst6000001A: concrete_constant(inst60000013)
// CHECK:STDOUT: inst6000001B: concrete_constant(inst6000001D)
// CHECK:STDOUT: inst6000001C: concrete_constant(inst6000001C)
// CHECK:STDOUT: inst6000001D: concrete_constant(inst6000001D)
// CHECK:STDOUT: inst6000001E: concrete_constant(inst6000001E)
// CHECK:STDOUT: inst6000001F: concrete_constant(inst6000001F)
// CHECK:STDOUT: inst60000020: concrete_constant(inst60000020)
// CHECK:STDOUT: inst60000021: concrete_constant(inst60000021)
// CHECK:STDOUT: inst60000022: concrete_constant(inst60000023)
// CHECK:STDOUT: inst60000023: concrete_constant(inst60000023)
// CHECK:STDOUT: inst60000024: concrete_constant(inst60000025)
// CHECK:STDOUT: inst60000021: concrete_constant(inst60000022)
// CHECK:STDOUT: inst60000022: concrete_constant(inst60000022)
// CHECK:STDOUT: inst60000023: concrete_constant(inst60000024)
// CHECK:STDOUT: inst60000024: concrete_constant(inst60000024)
// CHECK:STDOUT: inst60000025: concrete_constant(inst60000025)
// CHECK:STDOUT: inst60000026: concrete_constant(inst60000026)
// CHECK:STDOUT: inst60000027: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000028: concrete_constant(inst60000028)
// CHECK:STDOUT: inst60000029: concrete_constant(inst6000002A)
// CHECK:STDOUT: inst6000002A: concrete_constant(inst6000002A)
// CHECK:STDOUT: inst6000002B: concrete_constant(inst6000002A)
// CHECK:STDOUT: inst6000002C: concrete_constant(inst6000002E)
// CHECK:STDOUT: inst60000026: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000027: concrete_constant(inst60000027)
// CHECK:STDOUT: inst60000028: concrete_constant(inst60000029)
// CHECK:STDOUT: inst60000029: concrete_constant(inst60000029)
// CHECK:STDOUT: inst6000002A: concrete_constant(inst60000029)
// CHECK:STDOUT: inst6000002B: concrete_constant(inst6000002D)
// CHECK:STDOUT: inst6000002C: concrete_constant(inst6000002C)
// CHECK:STDOUT: inst6000002D: concrete_constant(inst6000002D)
// CHECK:STDOUT: inst6000002E: concrete_constant(inst6000002E)
// CHECK:STDOUT: inst6000002F: concrete_constant(inst60000031)
// CHECK:STDOUT: inst6000002E: concrete_constant(inst60000030)
// CHECK:STDOUT: inst6000002F: concrete_constant(inst6000002F)
// CHECK:STDOUT: inst60000030: concrete_constant(inst60000030)
// CHECK:STDOUT: inst60000031: concrete_constant(inst60000031)
// CHECK:STDOUT: inst60000033: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000034: concrete_constant(inst6000002A)
// CHECK:STDOUT: inst60000032: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000033: concrete_constant(inst60000029)
// CHECK:STDOUT: inst60000036: concrete_constant(inst60000036)
// CHECK:STDOUT: inst60000037: concrete_constant(inst60000037)
// CHECK:STDOUT: inst60000038: concrete_constant(inst60000038)
// CHECK:STDOUT: inst6000003A: concrete_constant(inst6000003C)
// CHECK:STDOUT: inst60000039: concrete_constant(inst6000003B)
// CHECK:STDOUT: inst6000003A: concrete_constant(inst6000003A)
// CHECK:STDOUT: inst6000003B: concrete_constant(inst6000003B)
// CHECK:STDOUT: inst6000003C: concrete_constant(inst6000003C)
// CHECK:STDOUT: inst6000003D: concrete_constant(inst6000003D)
// CHECK:STDOUT: inst6000003E: concrete_constant(inst6000003E)
// CHECK:STDOUT: inst6000003F: concrete_constant(inst6000003F)
// CHECK:STDOUT: inst60000040: concrete_constant(inst60000040)
// CHECK:STDOUT: inst60000042: concrete_constant(inst60000044)
// CHECK:STDOUT: inst60000041: concrete_constant(inst60000043)
// CHECK:STDOUT: inst60000042: concrete_constant(inst60000042)
// CHECK:STDOUT: inst60000043: concrete_constant(inst60000043)
// CHECK:STDOUT: inst60000044: concrete_constant(inst60000044)
// CHECK:STDOUT: inst60000048: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000049: concrete_constant(inst6000002A)
// CHECK:STDOUT: inst6000004A: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000047: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000048: concrete_constant(inst60000029)
// CHECK:STDOUT: inst60000049: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst6000004A: concrete_constant(inst6000004A)
// CHECK:STDOUT: inst6000004B: concrete_constant(inst6000004B)
// CHECK:STDOUT: inst6000004C: concrete_constant(inst6000004C)
// CHECK:STDOUT: inst6000004D: concrete_constant(inst6000004D)
// CHECK:STDOUT: inst6000004F: concrete_constant(inst6000004B)
// CHECK:STDOUT: inst6000004E: concrete_constant(inst6000004A)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst6000001C
// CHECK:STDOUT: 0: inst6000001B
// CHECK:STDOUT: imports:
// CHECK:STDOUT: 0: inst60000010
// CHECK:STDOUT: 1: inst60000013
// CHECK:STDOUT: 2: inst60000029
// CHECK:STDOUT: 3: inst6000002C
// CHECK:STDOUT: 4: inst6000002F
// CHECK:STDOUT: 5: inst6000003A
// CHECK:STDOUT: 6: inst60000042
// CHECK:STDOUT: 7: inst6000004B
// CHECK:STDOUT: 8: inst6000004E
// CHECK:STDOUT: 0: inst6000000F
// CHECK:STDOUT: 1: inst60000012
// CHECK:STDOUT: 2: inst60000028
// CHECK:STDOUT: 3: inst6000002B
// CHECK:STDOUT: 4: inst6000002E
// CHECK:STDOUT: 5: inst60000039
// CHECK:STDOUT: 6: inst60000041
// CHECK:STDOUT: 7: inst6000004A
// CHECK:STDOUT: 8: inst6000004D
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block60000004:
// CHECK:STDOUT: 0: inst60000011
// CHECK:STDOUT: 1: inst60000015
// CHECK:STDOUT: 0: inst60000010
// CHECK:STDOUT: 1: inst60000014
// CHECK:STDOUT: inst_block60000005:
// CHECK:STDOUT: 0: inst60000019
// CHECK:STDOUT: inst_block60000006:
// CHECK:STDOUT: 0: inst6000001A
// CHECK:STDOUT: inst_block60000007:
// CHECK:STDOUT: 0: inst60000018
// CHECK:STDOUT: 1: inst60000019
// CHECK:STDOUT: inst_block60000006:
// CHECK:STDOUT: 0: inst60000019
// CHECK:STDOUT: inst_block60000007:
// CHECK:STDOUT: 0: inst60000017
// CHECK:STDOUT: 1: inst60000018
// CHECK:STDOUT: inst_block60000008:
// CHECK:STDOUT: 0: inst6000001A
// CHECK:STDOUT: 1: inst6000001B
// CHECK:STDOUT: 2: inst60000016
// CHECK:STDOUT: 0: inst60000019
// CHECK:STDOUT: 1: inst6000001A
// CHECK:STDOUT: 2: inst60000015
// CHECK:STDOUT: inst_block60000009:
// CHECK:STDOUT: 0: inst60000027
// CHECK:STDOUT: 1: inst6000002B
// CHECK:STDOUT: 2: inst60000032
// CHECK:STDOUT: 3: inst60000033
// CHECK:STDOUT: 4: inst60000034
// CHECK:STDOUT: 5: inst60000035
// CHECK:STDOUT: 6: inst60000045
// CHECK:STDOUT: 7: inst60000046
// CHECK:STDOUT: 8: inst60000047
// CHECK:STDOUT: 9: inst60000048
// CHECK:STDOUT: 10: inst60000049
// CHECK:STDOUT: 11: inst6000004A
// CHECK:STDOUT: 12: inst6000004F
// CHECK:STDOUT: 13: inst60000050
// CHECK:STDOUT: 14: inst60000051
// CHECK:STDOUT: 15: inst60000052
// CHECK:STDOUT: 16: inst60000053
// CHECK:STDOUT: 17: inst60000054
// CHECK:STDOUT: 18: inst60000055
// CHECK:STDOUT: 19: inst60000056
// CHECK:STDOUT: 0: inst60000026
// CHECK:STDOUT: 1: inst6000002A
// CHECK:STDOUT: 2: inst60000031
// CHECK:STDOUT: 3: inst60000032
// CHECK:STDOUT: 4: inst60000033
// CHECK:STDOUT: 5: inst60000034
// CHECK:STDOUT: 6: inst60000044
// CHECK:STDOUT: 7: inst60000045
// CHECK:STDOUT: 8: inst60000046
// CHECK:STDOUT: 9: inst60000047
// CHECK:STDOUT: 10: inst60000048
// CHECK:STDOUT: 11: inst60000049
// CHECK:STDOUT: 12: inst6000004E
// CHECK:STDOUT: 13: inst6000004F
// CHECK:STDOUT: 14: inst60000050
// CHECK:STDOUT: 15: inst60000051
// CHECK:STDOUT: 16: inst60000052
// CHECK:STDOUT: 17: inst60000053
// CHECK:STDOUT: 18: inst60000054
// CHECK:STDOUT: 19: inst60000055
// CHECK:STDOUT: inst_block6000000A:
// CHECK:STDOUT: 0: inst60000021
// CHECK:STDOUT: 1: inst60000022
// CHECK:STDOUT: 2: inst60000024
// CHECK:STDOUT: 0: inst60000020
// CHECK:STDOUT: 1: inst60000021
// CHECK:STDOUT: 2: inst60000023
// CHECK:STDOUT: inst_block6000000B: {}
// CHECK:STDOUT: inst_block6000000C:
// CHECK:STDOUT: 0: inst60000038
// CHECK:STDOUT: inst_block6000000D:
// CHECK:STDOUT: 0: inst60000039
// CHECK:STDOUT: inst_block6000000E:
// CHECK:STDOUT: 0: inst60000037
// CHECK:STDOUT: 1: inst60000038
// CHECK:STDOUT: inst_block6000000D:
// CHECK:STDOUT: 0: inst60000038
// CHECK:STDOUT: inst_block6000000E:
// CHECK:STDOUT: 0: inst60000036
// CHECK:STDOUT: 1: inst60000037
// CHECK:STDOUT: inst_block6000000F:
// CHECK:STDOUT: 0: inst60000039
// CHECK:STDOUT: 1: inst60000036
// CHECK:STDOUT: 0: inst60000038
// CHECK:STDOUT: 1: inst60000035
// CHECK:STDOUT: inst_block60000010: {}
// CHECK:STDOUT: inst_block60000011:
// CHECK:STDOUT: 0: inst60000040
// CHECK:STDOUT: inst_block60000012:
// CHECK:STDOUT: 0: inst60000041
// CHECK:STDOUT: inst_block60000013:
// CHECK:STDOUT: 0: inst6000003F
// CHECK:STDOUT: 1: inst60000040
// CHECK:STDOUT: inst_block60000012:
// CHECK:STDOUT: 0: inst60000040
// CHECK:STDOUT: inst_block60000013:
// CHECK:STDOUT: 0: inst6000003E
// CHECK:STDOUT: 1: inst6000003F
// CHECK:STDOUT: inst_block60000014:
// CHECK:STDOUT: 0: inst60000041
// CHECK:STDOUT: 1: inst6000003D
// CHECK:STDOUT: 0: inst60000040
// CHECK:STDOUT: 1: inst6000003C
// CHECK:STDOUT: inst_block60000015:
// CHECK:STDOUT: 0: inst60000035
// CHECK:STDOUT: 0: inst60000034
// CHECK:STDOUT: inst_block60000016:
// CHECK:STDOUT: 0: inst60000046
// CHECK:STDOUT: 0: inst60000045
// CHECK:STDOUT: inst_block60000017:
// CHECK:STDOUT: 0: inst6000004C
// CHECK:STDOUT: 1: inst6000004D
// CHECK:STDOUT: 0: inst6000004B
// CHECK:STDOUT: 1: inst6000004C
// CHECK:STDOUT: inst_block60000018:
// CHECK:STDOUT: 0: inst60000052
// CHECK:STDOUT: 0: inst60000051
// CHECK:STDOUT: inst_block60000019:
// CHECK:STDOUT: 0: inst60000054
// CHECK:STDOUT: 0: inst60000053
// CHECK:STDOUT: inst_block6000001A:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 1: inst6000000F
// CHECK:STDOUT: 2: inst6000001C
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: 1: inst6000000E
// CHECK:STDOUT: 2: inst6000001B
// CHECK:STDOUT: ...
+61 -61
View File
@@ -36,7 +36,7 @@ fn B() {
// CHECK:STDOUT: import_ir_insts: {}
// CHECK:STDOUT: clang_decls: {}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst6000000F}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst6000000E}}
// CHECK:STDOUT: entity_names: {}
// CHECK:STDOUT: cpp_global_vars: {}
// CHECK:STDOUT: functions:
@@ -53,37 +53,37 @@ fn B() {
// CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)}
// CHECK:STDOUT: 'type(inst(NamespaceType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
// CHECK:STDOUT: 'type(inst6000000F)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000010)}
// CHECK:STDOUT: 'type(inst60000010)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst60000011)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000010)}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000F: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block_empty, type: type(inst60000010)}
// CHECK:STDOUT: inst60000010: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000011: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst60000012: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000010)}
// CHECK:STDOUT: inst60000013: {kind: Return}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000E: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst6000000F: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000010: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst60000011: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000012: {kind: Return}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: inst6000000F: concrete_constant(inst60000012)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: inst6000000E: concrete_constant(inst60000011)
// CHECK:STDOUT: inst6000000F: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000010: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000011: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000012: concrete_constant(inst60000012)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst6000000F
// CHECK:STDOUT: 0: inst6000000E
// CHECK:STDOUT: imports: {}
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block60000004: {}
// CHECK:STDOUT: inst_block60000005:
// CHECK:STDOUT: 0: inst60000013
// CHECK:STDOUT: 0: inst60000012
// CHECK:STDOUT: inst_block60000006:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 1: inst6000000F
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: 1: inst6000000E
// CHECK:STDOUT: ...
// CHECK:STDOUT: ---
// CHECK:STDOUT: filename: b.carbon
@@ -91,14 +91,14 @@ fn B() {
// CHECK:STDOUT: import_irs:
// CHECK:STDOUT: 'import_ir(ApiForImpl)': {decl_id: inst<none>, is_export: false}
// CHECK:STDOUT: 'import_ir(Cpp)': {decl_id: inst<none>, is_export: false}
// CHECK:STDOUT: import_ir50000002: {decl_id: inst5000000F, is_export: false}
// CHECK:STDOUT: import_ir50000002: {decl_id: inst5000000E, is_export: false}
// CHECK:STDOUT: import_ir_insts:
// CHECK:STDOUT: import_ir_inst0: {ir_id: import_ir50000002, inst_id: inst6000000F}
// CHECK:STDOUT: import_ir_inst1: {ir_id: import_ir50000002, inst_id: inst6000000F}
// CHECK:STDOUT: import_ir_inst0: {ir_id: import_ir50000002, inst_id: inst6000000E}
// CHECK:STDOUT: import_ir_inst1: {ir_id: import_ir50000002, inst_id: inst6000000E}
// CHECK:STDOUT: clang_decls: {}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name1: inst50000010, name0: inst50000011}}
// CHECK:STDOUT: name_scope50000001: {inst: inst50000010, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst50000016}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name1: inst5000000F, name0: inst50000010}}
// CHECK:STDOUT: name_scope50000001: {inst: inst5000000F, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst50000015}}
// CHECK:STDOUT: entity_names:
// CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0}
// CHECK:STDOUT: cpp_global_vars: {}
@@ -117,60 +117,60 @@ fn B() {
// CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)}
// CHECK:STDOUT: 'type(inst(NamespaceType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
// CHECK:STDOUT: 'type(inst50000011)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000012)}
// CHECK:STDOUT: 'type(inst50000012)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)}
// CHECK:STDOUT: 'type(inst50000013)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)}
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000012)}
// CHECK:STDOUT: 'type(inst(InstType))':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)}
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000012)}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst5000000F: {kind: ImportDecl, arg0: name1}
// CHECK:STDOUT: inst50000010: {kind: Namespace, arg0: name_scope50000001, arg1: inst5000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000011: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block_empty, type: type(inst50000012)}
// CHECK:STDOUT: inst50000012: {kind: FunctionType, arg0: function50000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000013: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst50000014: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000012)}
// CHECK:STDOUT: inst50000015: {kind: NameRef, arg0: name1, arg1: inst50000010, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000016: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name50000000, type: type(inst50000018)}
// CHECK:STDOUT: inst50000017: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block_empty, type: type(inst50000018)}
// CHECK:STDOUT: inst50000018: {kind: FunctionType, arg0: function50000001, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000019: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000018)}
// CHECK:STDOUT: inst5000001A: {kind: NameRef, arg0: name1, arg1: inst50000016, type: type(inst50000018)}
// CHECK:STDOUT: inst5000001B: {kind: Call, arg0: inst5000001A, arg1: inst_block_empty, type: type(inst50000013)}
// CHECK:STDOUT: inst5000001C: {kind: Return}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst5000000E: {kind: ImportDecl, arg0: name1}
// CHECK:STDOUT: inst5000000F: {kind: Namespace, arg0: name_scope50000001, arg1: inst5000000E, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000010: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block_empty, type: type(inst50000011)}
// CHECK:STDOUT: inst50000011: {kind: FunctionType, arg0: function50000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000012: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst50000013: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000011)}
// CHECK:STDOUT: inst50000014: {kind: NameRef, arg0: name1, arg1: inst5000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000015: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name50000000, type: type(inst50000017)}
// CHECK:STDOUT: inst50000016: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block_empty, type: type(inst50000017)}
// CHECK:STDOUT: inst50000017: {kind: FunctionType, arg0: function50000001, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000018: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000017)}
// CHECK:STDOUT: inst50000019: {kind: NameRef, arg0: name1, arg1: inst50000015, type: type(inst50000017)}
// CHECK:STDOUT: inst5000001A: {kind: Call, arg0: inst50000019, arg1: inst_block_empty, type: type(inst50000012)}
// CHECK:STDOUT: inst5000001B: {kind: Return}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: inst50000010: concrete_constant(inst50000010)
// CHECK:STDOUT: inst50000011: concrete_constant(inst50000014)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: inst5000000F: concrete_constant(inst5000000F)
// CHECK:STDOUT: inst50000010: concrete_constant(inst50000013)
// CHECK:STDOUT: inst50000011: concrete_constant(inst50000011)
// CHECK:STDOUT: inst50000012: concrete_constant(inst50000012)
// CHECK:STDOUT: inst50000013: concrete_constant(inst50000013)
// CHECK:STDOUT: inst50000014: concrete_constant(inst50000014)
// CHECK:STDOUT: inst50000015: concrete_constant(inst50000010)
// CHECK:STDOUT: inst50000016: concrete_constant(inst50000019)
// CHECK:STDOUT: inst50000017: concrete_constant(inst50000019)
// CHECK:STDOUT: inst50000014: concrete_constant(inst5000000F)
// CHECK:STDOUT: inst50000015: concrete_constant(inst50000018)
// CHECK:STDOUT: inst50000016: concrete_constant(inst50000018)
// CHECK:STDOUT: inst50000017: concrete_constant(inst50000017)
// CHECK:STDOUT: inst50000018: concrete_constant(inst50000018)
// CHECK:STDOUT: inst50000019: concrete_constant(inst50000019)
// CHECK:STDOUT: inst5000001A: concrete_constant(inst50000019)
// CHECK:STDOUT: inst50000019: concrete_constant(inst50000018)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst50000011
// CHECK:STDOUT: imports:
// CHECK:STDOUT: 0: inst50000010
// CHECK:STDOUT: 1: inst50000016
// CHECK:STDOUT: 2: inst50000017
// CHECK:STDOUT: imports:
// CHECK:STDOUT: 0: inst5000000F
// CHECK:STDOUT: 1: inst50000015
// CHECK:STDOUT: 2: inst50000016
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block50000004: {}
// CHECK:STDOUT: inst_block50000005:
// CHECK:STDOUT: 0: inst50000015
// CHECK:STDOUT: 1: inst5000001A
// CHECK:STDOUT: 2: inst5000001B
// CHECK:STDOUT: 3: inst5000001C
// CHECK:STDOUT: 0: inst50000014
// CHECK:STDOUT: 1: inst50000019
// CHECK:STDOUT: 2: inst5000001A
// CHECK:STDOUT: 3: inst5000001B
// CHECK:STDOUT: inst_block50000006:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 1: inst5000000F
// CHECK:STDOUT: 2: inst50000011
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: 1: inst5000000E
// CHECK:STDOUT: 2: inst50000010
// CHECK:STDOUT: ...
@@ -36,7 +36,7 @@ fn B() {
// CHECK:STDOUT: import_ir_insts: {}
// CHECK:STDOUT: clang_decls: {}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst6000000F}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst6000000E}}
// CHECK:STDOUT: entity_names: {}
// CHECK:STDOUT: cpp_global_vars: {}
// CHECK:STDOUT: functions:
@@ -53,37 +53,37 @@ fn B() {
// CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)}
// CHECK:STDOUT: 'type(inst(NamespaceType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
// CHECK:STDOUT: 'type(inst6000000F)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000010)}
// CHECK:STDOUT: 'type(inst60000010)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: 'type(inst60000011)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000011)}
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst60000010)}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000F: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block_empty, type: type(inst60000010)}
// CHECK:STDOUT: inst60000010: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000011: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst60000012: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000010)}
// CHECK:STDOUT: inst60000013: {kind: Return}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000E: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst6000000F: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000010: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst60000011: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000012: {kind: Return}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: inst6000000F: concrete_constant(inst60000012)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: inst6000000E: concrete_constant(inst60000011)
// CHECK:STDOUT: inst6000000F: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000010: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000011: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000012: concrete_constant(inst60000012)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst6000000F
// CHECK:STDOUT: 0: inst6000000E
// CHECK:STDOUT: imports: {}
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block60000004: {}
// CHECK:STDOUT: inst_block60000005:
// CHECK:STDOUT: 0: inst60000013
// CHECK:STDOUT: 0: inst60000012
// CHECK:STDOUT: inst_block60000006:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 1: inst6000000F
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: 1: inst6000000E
// CHECK:STDOUT: ...
// CHECK:STDOUT: --- a.carbon
// CHECK:STDOUT:
@@ -110,14 +110,14 @@ fn B() {
// CHECK:STDOUT: import_irs:
// CHECK:STDOUT: 'import_ir(ApiForImpl)': {decl_id: inst<none>, is_export: false}
// CHECK:STDOUT: 'import_ir(Cpp)': {decl_id: inst<none>, is_export: false}
// CHECK:STDOUT: import_ir50000002: {decl_id: inst5000000F, is_export: false}
// CHECK:STDOUT: import_ir50000002: {decl_id: inst5000000E, is_export: false}
// CHECK:STDOUT: import_ir_insts:
// CHECK:STDOUT: import_ir_inst0: {ir_id: import_ir50000002, inst_id: inst6000000F}
// CHECK:STDOUT: import_ir_inst1: {ir_id: import_ir50000002, inst_id: inst6000000F}
// CHECK:STDOUT: import_ir_inst0: {ir_id: import_ir50000002, inst_id: inst6000000E}
// CHECK:STDOUT: import_ir_inst1: {ir_id: import_ir50000002, inst_id: inst6000000E}
// CHECK:STDOUT: clang_decls: {}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name1: inst50000010, name0: inst50000011}}
// CHECK:STDOUT: name_scope50000001: {inst: inst50000010, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst50000016}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name1: inst5000000F, name0: inst50000010}}
// CHECK:STDOUT: name_scope50000001: {inst: inst5000000F, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst50000015}}
// CHECK:STDOUT: entity_names:
// CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0}
// CHECK:STDOUT: cpp_global_vars: {}
@@ -136,62 +136,62 @@ fn B() {
// CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)}
// CHECK:STDOUT: 'type(inst(NamespaceType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
// CHECK:STDOUT: 'type(inst50000011)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000012)}
// CHECK:STDOUT: 'type(inst50000012)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)}
// CHECK:STDOUT: 'type(inst50000013)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)}
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000012)}
// CHECK:STDOUT: 'type(inst(InstType))':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000013)}
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst50000012)}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst5000000F: {kind: ImportDecl, arg0: name1}
// CHECK:STDOUT: inst50000010: {kind: Namespace, arg0: name_scope50000001, arg1: inst5000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000011: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block_empty, type: type(inst50000012)}
// CHECK:STDOUT: inst50000012: {kind: FunctionType, arg0: function50000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000013: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst50000014: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000012)}
// CHECK:STDOUT: inst50000015: {kind: NameRef, arg0: name1, arg1: inst50000010, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000016: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name50000000, type: type(inst50000018)}
// CHECK:STDOUT: inst50000017: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block_empty, type: type(inst50000018)}
// CHECK:STDOUT: inst50000018: {kind: FunctionType, arg0: function50000001, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000019: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000018)}
// CHECK:STDOUT: inst5000001A: {kind: NameRef, arg0: name1, arg1: inst50000016, type: type(inst50000018)}
// CHECK:STDOUT: inst5000001B: {kind: Call, arg0: inst5000001A, arg1: inst_block_empty, type: type(inst50000013)}
// CHECK:STDOUT: inst5000001C: {kind: Return}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst5000000E: {kind: ImportDecl, arg0: name1}
// CHECK:STDOUT: inst5000000F: {kind: Namespace, arg0: name_scope50000001, arg1: inst5000000E, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000010: {kind: FunctionDecl, arg0: function50000000, arg1: inst_block_empty, type: type(inst50000011)}
// CHECK:STDOUT: inst50000011: {kind: FunctionType, arg0: function50000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000012: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst50000013: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000011)}
// CHECK:STDOUT: inst50000014: {kind: NameRef, arg0: name1, arg1: inst5000000F, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst50000015: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name50000000, type: type(inst50000017)}
// CHECK:STDOUT: inst50000016: {kind: FunctionDecl, arg0: function50000001, arg1: inst_block_empty, type: type(inst50000017)}
// CHECK:STDOUT: inst50000017: {kind: FunctionType, arg0: function50000001, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst50000018: {kind: StructValue, arg0: inst_block_empty, type: type(inst50000017)}
// CHECK:STDOUT: inst50000019: {kind: NameRef, arg0: name1, arg1: inst50000015, type: type(inst50000017)}
// CHECK:STDOUT: inst5000001A: {kind: Call, arg0: inst50000019, arg1: inst_block_empty, type: type(inst50000012)}
// CHECK:STDOUT: inst5000001B: {kind: Return}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: inst50000010: concrete_constant(inst50000010)
// CHECK:STDOUT: inst50000011: concrete_constant(inst50000014)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: inst5000000F: concrete_constant(inst5000000F)
// CHECK:STDOUT: inst50000010: concrete_constant(inst50000013)
// CHECK:STDOUT: inst50000011: concrete_constant(inst50000011)
// CHECK:STDOUT: inst50000012: concrete_constant(inst50000012)
// CHECK:STDOUT: inst50000013: concrete_constant(inst50000013)
// CHECK:STDOUT: inst50000014: concrete_constant(inst50000014)
// CHECK:STDOUT: inst50000015: concrete_constant(inst50000010)
// CHECK:STDOUT: inst50000016: concrete_constant(inst50000019)
// CHECK:STDOUT: inst50000017: concrete_constant(inst50000019)
// CHECK:STDOUT: inst50000014: concrete_constant(inst5000000F)
// CHECK:STDOUT: inst50000015: concrete_constant(inst50000018)
// CHECK:STDOUT: inst50000016: concrete_constant(inst50000018)
// CHECK:STDOUT: inst50000017: concrete_constant(inst50000017)
// CHECK:STDOUT: inst50000018: concrete_constant(inst50000018)
// CHECK:STDOUT: inst50000019: concrete_constant(inst50000019)
// CHECK:STDOUT: inst5000001A: concrete_constant(inst50000019)
// CHECK:STDOUT: inst50000019: concrete_constant(inst50000018)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst50000011
// CHECK:STDOUT: imports:
// CHECK:STDOUT: 0: inst50000010
// CHECK:STDOUT: 1: inst50000016
// CHECK:STDOUT: 2: inst50000017
// CHECK:STDOUT: imports:
// CHECK:STDOUT: 0: inst5000000F
// CHECK:STDOUT: 1: inst50000015
// CHECK:STDOUT: 2: inst50000016
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block50000004: {}
// CHECK:STDOUT: inst_block50000005:
// CHECK:STDOUT: 0: inst50000015
// CHECK:STDOUT: 1: inst5000001A
// CHECK:STDOUT: 2: inst5000001B
// CHECK:STDOUT: 3: inst5000001C
// CHECK:STDOUT: 0: inst50000014
// CHECK:STDOUT: 1: inst50000019
// CHECK:STDOUT: 2: inst5000001A
// CHECK:STDOUT: 3: inst5000001B
// CHECK:STDOUT: inst_block50000006:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 1: inst5000000F
// CHECK:STDOUT: 2: inst50000011
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: 1: inst5000000E
// CHECK:STDOUT: 2: inst50000010
// CHECK:STDOUT: ...
// CHECK:STDOUT: --- b.carbon
// CHECK:STDOUT:
File diff suppressed because it is too large Load Diff
@@ -26,12 +26,12 @@ fn Foo(n: ()) -> ((), ()) {
// CHECK:STDOUT: import_ir_insts: {}
// CHECK:STDOUT: clang_decls: {}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst60000027}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst60000026}}
// CHECK:STDOUT: entity_names:
// CHECK:STDOUT: entity_name60000000: {name: name1, parent_scope: name_scope<none>, index: -1, is_template: 0}
// CHECK:STDOUT: cpp_global_vars: {}
// CHECK:STDOUT: functions:
// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block6000000A, return_slot_pattern: inst60000022, body: [inst_block6000000D]}
// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block6000000A, return_slot_pattern: inst60000021, body: [inst_block6000000D]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: generics: {}
// CHECK:STDOUT: specifics: {}
@@ -44,155 +44,155 @@ fn Foo(n: ()) -> ((), ()) {
// CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)}
// CHECK:STDOUT: 'type(inst(NamespaceType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
// CHECK:STDOUT: 'type(inst6000000F)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000000F)}
// CHECK:STDOUT: 'type(inst6000001C)':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst6000001C)}
// CHECK:STDOUT: 'type(inst60000019)':
// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst6000001C)}
// CHECK:STDOUT: 'type(inst60000028)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000000F)}
// CHECK:STDOUT: 'type(inst6000000E)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000000E)}
// CHECK:STDOUT: 'type(inst6000001B)':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst6000001B)}
// CHECK:STDOUT: 'type(inst60000018)':
// CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst6000001B)}
// CHECK:STDOUT: 'type(inst60000027)':
// CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000000E)}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000F: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst60000010: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000011: {kind: TupleValue, arg0: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000012: {kind: Converted, arg0: inst60000010, arg1: inst6000000F, type: type(TypeType)}
// CHECK:STDOUT: inst60000013: {kind: ValueBinding, arg0: entity_name60000000, arg1: inst60000023, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000014: {kind: PatternType, arg0: inst6000000F, type: type(TypeType)}
// CHECK:STDOUT: inst60000015: {kind: ValueBindingPattern, arg0: entity_name60000000, type: type(inst60000014)}
// CHECK:STDOUT: inst60000016: {kind: ValueParamPattern, arg0: inst60000015, arg1: call_param0, type: type(inst60000014)}
// CHECK:STDOUT: inst60000017: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000018: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000019: {kind: TupleType, arg0: inst_block60000007, type: type(TypeType)}
// CHECK:STDOUT: inst6000001A: {kind: TupleLiteral, arg0: inst_block60000006, type: type(inst60000019)}
// CHECK:STDOUT: inst6000001B: {kind: TupleValue, arg0: inst_block60000008, type: type(inst60000019)}
// CHECK:STDOUT: inst6000001C: {kind: PointerType, arg0: inst60000019, type: type(TypeType)}
// CHECK:STDOUT: inst6000001D: {kind: Converted, arg0: inst60000011, arg1: inst6000000F, type: type(TypeType)}
// CHECK:STDOUT: inst6000001E: {kind: Converted, arg0: inst60000011, arg1: inst6000000F, type: type(TypeType)}
// CHECK:STDOUT: inst6000001F: {kind: Converted, arg0: inst6000001A, arg1: inst60000019, type: type(TypeType)}
// CHECK:STDOUT: inst60000020: {kind: PatternType, arg0: inst60000019, type: type(TypeType)}
// CHECK:STDOUT: inst60000021: {kind: ReturnSlotPattern, arg0: inst6000001F, type: type(inst60000020)}
// CHECK:STDOUT: inst60000022: {kind: OutParamPattern, arg0: inst60000021, arg1: call_param1, type: type(inst60000020)}
// CHECK:STDOUT: inst60000023: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000024: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000012, type: type(TypeType)}
// CHECK:STDOUT: inst60000025: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(inst60000019)}
// CHECK:STDOUT: inst60000026: {kind: ReturnSlot, arg0: inst60000019, arg1: inst60000025, type: type(inst60000019)}
// CHECK:STDOUT: inst60000027: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block6000000C, type: type(inst60000028)}
// CHECK:STDOUT: inst60000028: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000029: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000028)}
// CHECK:STDOUT: inst6000002A: {kind: NameRef, arg0: name1, arg1: inst60000013, type: type(inst6000000F)}
// CHECK:STDOUT: inst6000002B: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000F)}
// CHECK:STDOUT: inst6000002C: {kind: TupleLiteral, arg0: inst_block6000000E, type: type(inst60000019)}
// CHECK:STDOUT: inst6000002D: {kind: TupleAccess, arg0: inst60000026, arg1: element0, type: type(inst6000000F)}
// CHECK:STDOUT: inst6000002E: {kind: TupleInit, arg0: inst_block6000000F, arg1: inst6000002D, type: type(inst6000000F)}
// CHECK:STDOUT: inst6000002F: {kind: Converted, arg0: inst6000002A, arg1: inst6000002E, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000030: {kind: TupleAccess, arg0: inst60000026, arg1: element1, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000031: {kind: TupleInit, arg0: inst_block_empty, arg1: inst60000030, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000032: {kind: Converted, arg0: inst6000002B, arg1: inst60000031, type: type(inst6000000F)}
// CHECK:STDOUT: inst60000033: {kind: TupleInit, arg0: inst_block60000010, arg1: inst60000026, type: type(inst60000019)}
// CHECK:STDOUT: inst60000034: {kind: Converted, arg0: inst6000002C, arg1: inst60000033, type: type(inst60000019)}
// CHECK:STDOUT: inst60000035: {kind: ReturnExpr, arg0: inst60000034, arg1: inst60000026}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: inst6000000E: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
// CHECK:STDOUT: inst6000000F: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000010: {kind: TupleValue, arg0: inst_block_empty, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000011: {kind: Converted, arg0: inst6000000F, arg1: inst6000000E, type: type(TypeType)}
// CHECK:STDOUT: inst60000012: {kind: ValueBinding, arg0: entity_name60000000, arg1: inst60000022, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000013: {kind: PatternType, arg0: inst6000000E, type: type(TypeType)}
// CHECK:STDOUT: inst60000014: {kind: ValueBindingPattern, arg0: entity_name60000000, type: type(inst60000013)}
// CHECK:STDOUT: inst60000015: {kind: ValueParamPattern, arg0: inst60000014, arg1: call_param0, type: type(inst60000013)}
// CHECK:STDOUT: inst60000016: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000017: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000018: {kind: TupleType, arg0: inst_block60000007, type: type(TypeType)}
// CHECK:STDOUT: inst60000019: {kind: TupleLiteral, arg0: inst_block60000006, type: type(inst60000018)}
// CHECK:STDOUT: inst6000001A: {kind: TupleValue, arg0: inst_block60000008, type: type(inst60000018)}
// CHECK:STDOUT: inst6000001B: {kind: PointerType, arg0: inst60000018, type: type(TypeType)}
// CHECK:STDOUT: inst6000001C: {kind: Converted, arg0: inst60000010, arg1: inst6000000E, type: type(TypeType)}
// CHECK:STDOUT: inst6000001D: {kind: Converted, arg0: inst60000010, arg1: inst6000000E, type: type(TypeType)}
// CHECK:STDOUT: inst6000001E: {kind: Converted, arg0: inst60000019, arg1: inst60000018, type: type(TypeType)}
// CHECK:STDOUT: inst6000001F: {kind: PatternType, arg0: inst60000018, type: type(TypeType)}
// CHECK:STDOUT: inst60000020: {kind: ReturnSlotPattern, arg0: inst6000001E, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000021: {kind: OutParamPattern, arg0: inst60000020, arg1: call_param1, type: type(inst6000001F)}
// CHECK:STDOUT: inst60000022: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000023: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000011, type: type(TypeType)}
// CHECK:STDOUT: inst60000024: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(inst60000018)}
// CHECK:STDOUT: inst60000025: {kind: ReturnSlot, arg0: inst60000018, arg1: inst60000024, type: type(inst60000018)}
// CHECK:STDOUT: inst60000026: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block6000000C, type: type(inst60000027)}
// CHECK:STDOUT: inst60000027: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
// CHECK:STDOUT: inst60000028: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000027)}
// CHECK:STDOUT: inst60000029: {kind: NameRef, arg0: name1, arg1: inst60000012, type: type(inst6000000E)}
// CHECK:STDOUT: inst6000002A: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst6000000E)}
// CHECK:STDOUT: inst6000002B: {kind: TupleLiteral, arg0: inst_block6000000E, type: type(inst60000018)}
// CHECK:STDOUT: inst6000002C: {kind: TupleAccess, arg0: inst60000025, arg1: element0, type: type(inst6000000E)}
// CHECK:STDOUT: inst6000002D: {kind: TupleInit, arg0: inst_block6000000F, arg1: inst6000002C, type: type(inst6000000E)}
// CHECK:STDOUT: inst6000002E: {kind: Converted, arg0: inst60000029, arg1: inst6000002D, type: type(inst6000000E)}
// CHECK:STDOUT: inst6000002F: {kind: TupleAccess, arg0: inst60000025, arg1: element1, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000030: {kind: TupleInit, arg0: inst_block_empty, arg1: inst6000002F, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000031: {kind: Converted, arg0: inst6000002A, arg1: inst60000030, type: type(inst6000000E)}
// CHECK:STDOUT: inst60000032: {kind: TupleInit, arg0: inst_block60000010, arg1: inst60000025, type: type(inst60000018)}
// CHECK:STDOUT: inst60000033: {kind: Converted, arg0: inst6000002B, arg1: inst60000032, type: type(inst60000018)}
// CHECK:STDOUT: inst60000034: {kind: ReturnExpr, arg0: inst60000033, arg1: inst60000025}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: inst6000000F: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000010: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000011: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000012: concrete_constant(inst6000000F)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: inst6000000E: concrete_constant(inst6000000E)
// CHECK:STDOUT: inst6000000F: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000010: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000011: concrete_constant(inst6000000E)
// CHECK:STDOUT: inst60000013: concrete_constant(inst60000013)
// CHECK:STDOUT: inst60000014: concrete_constant(inst60000014)
// CHECK:STDOUT: inst60000015: concrete_constant(inst60000015)
// CHECK:STDOUT: inst60000016: concrete_constant(inst60000016)
// CHECK:STDOUT: inst60000017: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000018: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000019: concrete_constant(inst60000019)
// CHECK:STDOUT: inst6000001A: concrete_constant(inst6000001B)
// CHECK:STDOUT: inst60000016: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000017: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000018: concrete_constant(inst60000018)
// CHECK:STDOUT: inst60000019: concrete_constant(inst6000001A)
// CHECK:STDOUT: inst6000001A: concrete_constant(inst6000001A)
// CHECK:STDOUT: inst6000001B: concrete_constant(inst6000001B)
// CHECK:STDOUT: inst6000001C: concrete_constant(inst6000001C)
// CHECK:STDOUT: inst6000001D: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst6000001E: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst6000001F: concrete_constant(inst60000019)
// CHECK:STDOUT: inst6000001C: concrete_constant(inst6000000E)
// CHECK:STDOUT: inst6000001D: concrete_constant(inst6000000E)
// CHECK:STDOUT: inst6000001E: concrete_constant(inst60000018)
// CHECK:STDOUT: inst6000001F: concrete_constant(inst6000001F)
// CHECK:STDOUT: inst60000020: concrete_constant(inst60000020)
// CHECK:STDOUT: inst60000021: concrete_constant(inst60000021)
// CHECK:STDOUT: inst60000022: concrete_constant(inst60000022)
// CHECK:STDOUT: inst60000024: concrete_constant(inst6000000F)
// CHECK:STDOUT: inst60000027: concrete_constant(inst60000029)
// CHECK:STDOUT: inst60000023: concrete_constant(inst6000000E)
// CHECK:STDOUT: inst60000026: concrete_constant(inst60000028)
// CHECK:STDOUT: inst60000027: concrete_constant(inst60000027)
// CHECK:STDOUT: inst60000028: concrete_constant(inst60000028)
// CHECK:STDOUT: inst60000029: concrete_constant(inst60000029)
// CHECK:STDOUT: inst6000002B: concrete_constant(inst60000011)
// CHECK:STDOUT: inst6000002E: concrete_constant(inst60000011)
// CHECK:STDOUT: inst6000002F: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000031: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000032: concrete_constant(inst60000011)
// CHECK:STDOUT: inst60000033: concrete_constant(inst6000001B)
// CHECK:STDOUT: inst60000034: concrete_constant(inst6000001B)
// CHECK:STDOUT: inst6000002A: concrete_constant(inst60000010)
// CHECK:STDOUT: inst6000002D: concrete_constant(inst60000010)
// CHECK:STDOUT: inst6000002E: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000030: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000031: concrete_constant(inst60000010)
// CHECK:STDOUT: inst60000032: concrete_constant(inst6000001A)
// CHECK:STDOUT: inst60000033: concrete_constant(inst6000001A)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst60000027
// CHECK:STDOUT: 0: inst60000026
// CHECK:STDOUT: imports: {}
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block60000004:
// CHECK:STDOUT: 0: inst60000010
// CHECK:STDOUT: 1: inst60000012
// CHECK:STDOUT: inst_block60000005:
// CHECK:STDOUT: 0: inst60000016
// CHECK:STDOUT: inst_block60000006:
// CHECK:STDOUT: 0: inst60000017
// CHECK:STDOUT: 1: inst60000018
// CHECK:STDOUT: inst_block60000007:
// CHECK:STDOUT: 0: inst6000000F
// CHECK:STDOUT: 1: inst6000000F
// CHECK:STDOUT: inst_block60000008:
// CHECK:STDOUT: 0: inst60000011
// CHECK:STDOUT: 1: inst60000011
// CHECK:STDOUT: inst_block60000009:
// CHECK:STDOUT: 0: inst6000001D
// CHECK:STDOUT: 1: inst6000001E
// CHECK:STDOUT: inst_block6000000A:
// CHECK:STDOUT: 0: inst60000023
// CHECK:STDOUT: 1: inst60000025
// CHECK:STDOUT: inst_block6000000B:
// CHECK:STDOUT: inst_block60000005:
// CHECK:STDOUT: 0: inst60000015
// CHECK:STDOUT: 1: inst60000016
// CHECK:STDOUT: 2: inst60000021
// CHECK:STDOUT: 3: inst60000022
// CHECK:STDOUT: inst_block60000006:
// CHECK:STDOUT: 0: inst60000016
// CHECK:STDOUT: 1: inst60000017
// CHECK:STDOUT: inst_block60000007:
// CHECK:STDOUT: 0: inst6000000E
// CHECK:STDOUT: 1: inst6000000E
// CHECK:STDOUT: inst_block60000008:
// CHECK:STDOUT: 0: inst60000010
// CHECK:STDOUT: 1: inst60000010
// CHECK:STDOUT: inst_block60000009:
// CHECK:STDOUT: 0: inst6000001C
// CHECK:STDOUT: 1: inst6000001D
// CHECK:STDOUT: inst_block6000000A:
// CHECK:STDOUT: 0: inst60000022
// CHECK:STDOUT: 1: inst60000024
// CHECK:STDOUT: inst_block6000000B:
// CHECK:STDOUT: 0: inst60000014
// CHECK:STDOUT: 1: inst60000015
// CHECK:STDOUT: 2: inst60000020
// CHECK:STDOUT: 3: inst60000021
// CHECK:STDOUT: inst_block6000000C:
// CHECK:STDOUT: 0: inst60000017
// CHECK:STDOUT: 1: inst60000018
// CHECK:STDOUT: 2: inst6000001A
// CHECK:STDOUT: 3: inst6000001D
// CHECK:STDOUT: 4: inst6000001E
// CHECK:STDOUT: 5: inst6000001F
// CHECK:STDOUT: 6: inst60000023
// CHECK:STDOUT: 7: inst60000024
// CHECK:STDOUT: 8: inst60000013
// CHECK:STDOUT: 9: inst60000025
// CHECK:STDOUT: 10: inst60000026
// CHECK:STDOUT: 0: inst60000016
// CHECK:STDOUT: 1: inst60000017
// CHECK:STDOUT: 2: inst60000019
// CHECK:STDOUT: 3: inst6000001C
// CHECK:STDOUT: 4: inst6000001D
// CHECK:STDOUT: 5: inst6000001E
// CHECK:STDOUT: 6: inst60000022
// CHECK:STDOUT: 7: inst60000023
// CHECK:STDOUT: 8: inst60000012
// CHECK:STDOUT: 9: inst60000024
// CHECK:STDOUT: 10: inst60000025
// CHECK:STDOUT: inst_block6000000D:
// CHECK:STDOUT: 0: inst6000002A
// CHECK:STDOUT: 1: inst6000002B
// CHECK:STDOUT: 2: inst6000002C
// CHECK:STDOUT: 3: inst6000002D
// CHECK:STDOUT: 4: inst6000002E
// CHECK:STDOUT: 5: inst6000002F
// CHECK:STDOUT: 6: inst60000030
// CHECK:STDOUT: 7: inst60000031
// CHECK:STDOUT: 8: inst60000032
// CHECK:STDOUT: 9: inst60000033
// CHECK:STDOUT: 10: inst60000034
// CHECK:STDOUT: 11: inst60000035
// CHECK:STDOUT: 0: inst60000029
// CHECK:STDOUT: 1: inst6000002A
// CHECK:STDOUT: 2: inst6000002B
// CHECK:STDOUT: 3: inst6000002C
// CHECK:STDOUT: 4: inst6000002D
// CHECK:STDOUT: 5: inst6000002E
// CHECK:STDOUT: 6: inst6000002F
// CHECK:STDOUT: 7: inst60000030
// CHECK:STDOUT: 8: inst60000031
// CHECK:STDOUT: 9: inst60000032
// CHECK:STDOUT: 10: inst60000033
// CHECK:STDOUT: 11: inst60000034
// CHECK:STDOUT: inst_block6000000E:
// CHECK:STDOUT: 0: inst6000002A
// CHECK:STDOUT: 1: inst6000002B
// CHECK:STDOUT: 0: inst60000029
// CHECK:STDOUT: 1: inst6000002A
// CHECK:STDOUT: inst_block6000000F: {}
// CHECK:STDOUT: inst_block60000010:
// CHECK:STDOUT: 0: inst6000002F
// CHECK:STDOUT: 1: inst60000032
// CHECK:STDOUT: 0: inst6000002E
// CHECK:STDOUT: 1: inst60000031
// CHECK:STDOUT: inst_block60000011:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 1: inst60000027
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: 1: inst60000026
// CHECK:STDOUT: ...
// CHECK:STDOUT: --- one_file_with_textual_ir.carbon
// CHECK:STDOUT:
@@ -138,11 +138,11 @@ fn F() {
// CHECK:STDOUT: %uninit: %Cpp.nullptr_t = uninitialized_value [concrete]
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.d80: type = fn_type @Cpp.nullptr_t.as.ImplicitAs.impl.Convert, @Cpp.nullptr_t.as.ImplicitAs.impl(%T.d9f) [symbolic]
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.2ce: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.d80 = struct_value () [symbolic]
// CHECK:STDOUT: %ImplicitAs.impl_witness.213: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.87f, @Cpp.nullptr_t.as.ImplicitAs.impl(%i32) [concrete]
// CHECK:STDOUT: %ImplicitAs.impl_witness.eae: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.126, @Cpp.nullptr_t.as.ImplicitAs.impl(%i32) [concrete]
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.87f: type = fn_type @Cpp.nullptr_t.as.ImplicitAs.impl.Convert, @Cpp.nullptr_t.as.ImplicitAs.impl(%i32) [concrete]
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.83e: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.87f = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.facet.5e9: %ImplicitAs.type.534 = facet_value %Cpp.nullptr_t, (%ImplicitAs.impl_witness.213) [concrete]
// CHECK:STDOUT: %.28d: type = fn_type_with_self_type %ImplicitAs.Convert.type.8fe, %ImplicitAs.facet.5e9 [concrete]
// CHECK:STDOUT: %ImplicitAs.facet.4bf: %ImplicitAs.type.534 = facet_value %Cpp.nullptr_t, (%ImplicitAs.impl_witness.eae) [concrete]
// CHECK:STDOUT: %.164: type = fn_type_with_self_type %ImplicitAs.Convert.type.8fe, %ImplicitAs.facet.4bf [concrete]
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.83e [concrete]
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.83e, @Cpp.nullptr_t.as.ImplicitAs.impl.Convert(%i32) [concrete]
// CHECK:STDOUT: %bound_method.ed9: <bound method> = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn [concrete]
@@ -185,8 +185,8 @@ fn F() {
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.da6 = impl_witness_table (%Core.import_ref.ec9), @U.binding.as_type.as.ImplicitAs.impl.ea7 [concrete]
// CHECK:STDOUT: %Core.import_ref.7fb: @T.binding.as_type.as.OptionalAs.impl.%T.binding.as_type.as.OptionalAs.impl.Convert.type (%T.binding.as_type.as.OptionalAs.impl.Convert.type.8c6) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @T.binding.as_type.as.OptionalAs.impl.%T.binding.as_type.as.OptionalAs.impl.Convert (constants.%T.binding.as_type.as.OptionalAs.impl.Convert.180)]
// CHECK:STDOUT: %OptionalAs.impl_witness_table.8ee = impl_witness_table (%Core.import_ref.7fb), @T.binding.as_type.as.OptionalAs.impl [concrete]
// CHECK:STDOUT: %Core.import_ref.54b: @Cpp.nullptr_t.as.ImplicitAs.impl.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type (%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.d80) = import_ref Core//prelude/types/cpp/nullptr, loc{{\d+_\d+}}, loaded [symbolic = @Cpp.nullptr_t.as.ImplicitAs.impl.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert (constants.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.2ce)]
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.87f = impl_witness_table (%Core.import_ref.54b), @Cpp.nullptr_t.as.ImplicitAs.impl [concrete]
// CHECK:STDOUT: %Core.import_ref.9b7: @Cpp.nullptr_t.as.ImplicitAs.impl.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type (%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.d80) = import_ref Core//prelude/types/cpp/nullptr, loc{{\d+_\d+}}, loaded [symbolic = @Cpp.nullptr_t.as.ImplicitAs.impl.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert (constants.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.2ce)]
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.126 = impl_witness_table (%Core.import_ref.9b7), @Cpp.nullptr_t.as.ImplicitAs.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -233,7 +233,7 @@ fn F() {
// CHECK:STDOUT: %Cpp.ref.loc13_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %nullptr.ref: %Cpp.nullptr_t = name_ref nullptr, %uninit [concrete = constants.%uninit]
// CHECK:STDOUT: %impl.elem0.loc13: %.28d = impl_witness_access constants.%ImplicitAs.impl_witness.213, element0 [concrete = constants.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.83e]
// CHECK:STDOUT: %impl.elem0.loc13: %.164 = impl_witness_access constants.%ImplicitAs.impl_witness.eae, element0 [concrete = constants.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.83e]
// CHECK:STDOUT: %bound_method.loc13_21.1: <bound method> = bound_method %nullptr.ref, %impl.elem0.loc13 [concrete = constants.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound]
// CHECK:STDOUT: %specific_fn.loc13: <specific function> = specific_function %impl.elem0.loc13, @Cpp.nullptr_t.as.ImplicitAs.impl.Convert(constants.%i32) [concrete = constants.%Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc13_21.2: <bound method> = bound_method %nullptr.ref, %specific_fn.loc13 [concrete = constants.%bound_method.ed9]
@@ -84,19 +84,6 @@ fn F() {
//@dump-sem-ir-end
}
// --- fail_void.carbon
library "[[@TEST_NAME]]";
import Cpp;
// CHECK:STDERR: fail_void.carbon:[[@LINE+5]]:6: error: parameter has incomplete type `Cpp.void` in function definition [IncompleteTypeInFunctionParam]
// CHECK:STDERR: fn F(x: Cpp.void) {}
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: fail_void.carbon: note: `Cpp.void` is always-incomplete [CppVoidIncomplete]
// CHECK:STDERR:
fn F(x: Cpp.void) {}
// --- non_nullable_pointer.carbon
library "[[@TEST_NAME]]";
@@ -133,7 +120,8 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
@@ -142,7 +130,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
@@ -166,7 +154,8 @@ fn F() {
// CHECK:STDOUT: --- non_nullable_return_value.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %ptr: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
@@ -176,7 +165,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
@@ -198,7 +187,7 @@ fn F() {
// CHECK:STDOUT: %foo.call: init %ptr = call imports.%foo.decl()
// CHECK:STDOUT: %.loc10_23: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref.loc10_15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %void.ref: type = name_ref void, Cpp.void [concrete = Cpp.void]
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc10_35.1: %ptr = value_of_initializer %foo.call
@@ -211,7 +200,8 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
@@ -222,36 +212,36 @@ fn F() {
// CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.911: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.d9f) [symbolic]
// CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.2a0: %ptr.as.OptionalStorage.impl.Some.type.911 = struct_value () [symbolic]
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
// CHECK:STDOUT: %OptionalStorage.impl_witness.a64: <witness> = impl_witness imports.%OptionalStorage.impl_witness_table.236, @ptr.as.OptionalStorage.impl(Cpp.void) [concrete]
// CHECK:STDOUT: %OptionalStorage.facet.e2a: %OptionalStorage.type = facet_value %ptr.03c, (%OptionalStorage.impl_witness.a64) [concrete]
// CHECK:STDOUT: %Optional.75d: type = class_type @Optional, @Optional(%OptionalStorage.facet.e2a) [concrete]
// CHECK:STDOUT: %OptionalStorage.impl_witness.cc2: <witness> = impl_witness imports.%OptionalStorage.impl_witness_table.236, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete]
// CHECK:STDOUT: %OptionalStorage.facet.2f5: %OptionalStorage.type = facet_value %ptr.874, (%OptionalStorage.impl_witness.cc2) [concrete]
// CHECK:STDOUT: %Optional.eca: type = class_type @Optional, @Optional(%OptionalStorage.facet.2f5) [concrete]
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.type.707: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.75d)> [concrete]
// CHECK:STDOUT: %ImplicitAs.Convert.type.465: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%Optional.75d) [concrete]
// CHECK:STDOUT: %ImplicitAs.type.ab3: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.eca)> [concrete]
// CHECK:STDOUT: %ImplicitAs.Convert.type.142: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%Optional.eca) [concrete]
// CHECK:STDOUT: %OptionalAs.type.593: type = facet_type <@OptionalAs, @OptionalAs(%T.3fe)> [symbolic]
// CHECK:STDOUT: %U.ec3: %OptionalAs.type.593 = symbolic_binding U, 1 [symbolic]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.type.855: type = fn_type @U.binding.as_type.as.ImplicitAs.impl.Convert.2, @U.binding.as_type.as.ImplicitAs.impl.ea7(%T.3fe, %U.ec3) [symbolic]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.337: %U.binding.as_type.as.ImplicitAs.impl.Convert.type.855 = struct_value () [symbolic]
// CHECK:STDOUT: %OptionalAs.type.a25: type = facet_type <@OptionalAs, @OptionalAs(%OptionalStorage.facet.e2a)> [concrete]
// CHECK:STDOUT: %OptionalAs.type.716: type = facet_type <@OptionalAs, @OptionalAs(%OptionalStorage.facet.2f5)> [concrete]
// CHECK:STDOUT: %T.binding.as_type.as.OptionalAs.impl.Convert.type.8c6: type = fn_type @T.binding.as_type.as.OptionalAs.impl.Convert, @T.binding.as_type.as.OptionalAs.impl(%T.3fe) [symbolic]
// CHECK:STDOUT: %T.binding.as_type.as.OptionalAs.impl.Convert.180: %T.binding.as_type.as.OptionalAs.impl.Convert.type.8c6 = struct_value () [symbolic]
// CHECK:STDOUT: %OptionalAs.impl_witness.c4d: <witness> = impl_witness imports.%OptionalAs.impl_witness_table.8ee, @T.binding.as_type.as.OptionalAs.impl(%OptionalStorage.facet.e2a) [concrete]
// CHECK:STDOUT: %OptionalAs.facet: %OptionalAs.type.a25 = facet_value %ptr.03c, (%OptionalAs.impl_witness.c4d) [concrete]
// CHECK:STDOUT: %ImplicitAs.impl_witness.354: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.da6, @U.binding.as_type.as.ImplicitAs.impl.ea7(%OptionalStorage.facet.e2a, %OptionalAs.facet) [concrete]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.type.efe: type = fn_type @U.binding.as_type.as.ImplicitAs.impl.Convert.2, @U.binding.as_type.as.ImplicitAs.impl.ea7(%OptionalStorage.facet.e2a, %OptionalAs.facet) [concrete]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.aa4: %U.binding.as_type.as.ImplicitAs.impl.Convert.type.efe = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.707 = facet_value %ptr.03c, (%ImplicitAs.impl_witness.354) [concrete]
// CHECK:STDOUT: %.120: type = fn_type_with_self_type %ImplicitAs.Convert.type.465, %ImplicitAs.facet [concrete]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %U.binding.as_type.as.ImplicitAs.impl.Convert.aa4, @U.binding.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.e2a, %OptionalAs.facet) [concrete]
// CHECK:STDOUT: %facet_value.9af: %type_where = facet_value %Optional.75d, () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.773: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.9af) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.9de: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.773 = struct_value () [concrete]
// CHECK:STDOUT: %OptionalAs.impl_witness.049: <witness> = impl_witness imports.%OptionalAs.impl_witness_table.8ee, @T.binding.as_type.as.OptionalAs.impl(%OptionalStorage.facet.2f5) [concrete]
// CHECK:STDOUT: %OptionalAs.facet: %OptionalAs.type.716 = facet_value %ptr.874, (%OptionalAs.impl_witness.049) [concrete]
// CHECK:STDOUT: %ImplicitAs.impl_witness.53b: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.da6, @U.binding.as_type.as.ImplicitAs.impl.ea7(%OptionalStorage.facet.2f5, %OptionalAs.facet) [concrete]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.type.92a: type = fn_type @U.binding.as_type.as.ImplicitAs.impl.Convert.2, @U.binding.as_type.as.ImplicitAs.impl.ea7(%OptionalStorage.facet.2f5, %OptionalAs.facet) [concrete]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.2ca: %U.binding.as_type.as.ImplicitAs.impl.Convert.type.92a = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.ab3 = facet_value %ptr.874, (%ImplicitAs.impl_witness.53b) [concrete]
// CHECK:STDOUT: %.1ad: type = fn_type_with_self_type %ImplicitAs.Convert.type.142, %ImplicitAs.facet [concrete]
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %U.binding.as_type.as.ImplicitAs.impl.Convert.2ca, @U.binding.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.2f5, %OptionalAs.facet) [concrete]
// CHECK:STDOUT: %facet_value.87a: %type_where = facet_value %Optional.eca, () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f05: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.87a) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.afe: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f05 = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
@@ -266,10 +256,10 @@ fn F() {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %.loc10_16.1: type = splice_block %Optional [concrete = constants.%Optional.75d] {
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.03c, (constants.%OptionalStorage.impl_witness.a64) [concrete = constants.%OptionalStorage.facet.e2a]
// CHECK:STDOUT: %.loc10_16.2: %OptionalStorage.type = converted constants.%ptr.03c, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.e2a]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.e2a) [concrete = constants.%Optional.75d]
// CHECK:STDOUT: %.loc10_16.1: type = splice_block %Optional [concrete = constants.%Optional.eca] {
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.874, (constants.%OptionalStorage.impl_witness.cc2) [concrete = constants.%OptionalStorage.facet.2f5]
// CHECK:STDOUT: %.loc10_16.2: %OptionalStorage.type = converted constants.%ptr.874, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.2f5]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.2f5) [concrete = constants.%Optional.eca]
// CHECK:STDOUT: }
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
@@ -279,22 +269,22 @@ fn F() {
// CHECK:STDOUT: %OptionalAs.impl_witness_table.8ee = impl_witness_table (%Core.import_ref.7fb), @T.binding.as_type.as.OptionalAs.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%input.param: %ptr.03c) {
// CHECK:STDOUT: fn @F(%input.param: %ptr.874) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
// CHECK:STDOUT: %input.ref: %ptr.03c = name_ref input, %input
// CHECK:STDOUT: %impl.elem0: %.120 = impl_witness_access constants.%ImplicitAs.impl_witness.354, element0 [concrete = constants.%U.binding.as_type.as.ImplicitAs.impl.Convert.aa4]
// CHECK:STDOUT: %input.ref: %ptr.874 = name_ref input, %input
// CHECK:STDOUT: %impl.elem0: %.1ad = impl_witness_access constants.%ImplicitAs.impl_witness.53b, element0 [concrete = constants.%U.binding.as_type.as.ImplicitAs.impl.Convert.2ca]
// CHECK:STDOUT: %bound_method.loc10_11.1: <bound method> = bound_method %input.ref, %impl.elem0
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @U.binding.as_type.as.ImplicitAs.impl.Convert.2(constants.%OptionalStorage.facet.e2a, constants.%OptionalAs.facet) [concrete = constants.%U.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @U.binding.as_type.as.ImplicitAs.impl.Convert.2(constants.%OptionalStorage.facet.2f5, constants.%OptionalAs.facet) [concrete = constants.%U.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn]
// CHECK:STDOUT: %bound_method.loc10_11.2: <bound method> = bound_method %input.ref, %specific_fn
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call: init %Optional.75d = call %bound_method.loc10_11.2(%input.ref)
// CHECK:STDOUT: %.loc10_11.1: init %Optional.75d = converted %input.ref, %U.binding.as_type.as.ImplicitAs.impl.Convert.call
// CHECK:STDOUT: %.loc10_11.2: ref %Optional.75d = temporary_storage
// CHECK:STDOUT: %.loc10_11.3: ref %Optional.75d = temporary %.loc10_11.2, %.loc10_11.1
// CHECK:STDOUT: %.loc10_11.4: %Optional.75d = acquire_value %.loc10_11.3
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call: init %Optional.eca = call %bound_method.loc10_11.2(%input.ref)
// CHECK:STDOUT: %.loc10_11.1: init %Optional.eca = converted %input.ref, %U.binding.as_type.as.ImplicitAs.impl.Convert.call
// CHECK:STDOUT: %.loc10_11.2: ref %Optional.eca = temporary_storage
// CHECK:STDOUT: %.loc10_11.3: ref %Optional.eca = temporary %.loc10_11.2, %.loc10_11.1
// CHECK:STDOUT: %.loc10_11.4: %Optional.eca = acquire_value %.loc10_11.3
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc10_11.4)
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc10_11.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.9de
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc10_11.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.afe
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %bound_method.loc10_11.3: <bound method> = bound_method %.loc10_11.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_11.3(%.loc10_11.3)
@@ -312,34 +302,43 @@ fn F() {
// CHECK:STDOUT: %T.3fe: %OptionalStorage.type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %Optional.None.type.193: type = fn_type @Optional.None, @Optional(%T.3fe) [symbolic]
// CHECK:STDOUT: %Optional.None.dc7: %Optional.None.type.193 = struct_value () [symbolic]
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %ptr.4f0: type = ptr_type %T.d9f [symbolic]
// CHECK:STDOUT: %MaybeUnformed.cff: type = class_type @MaybeUnformed, @MaybeUnformed(%ptr.4f0) [symbolic]
// CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.8ed: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.d9f) [symbolic]
// CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.41a: %ptr.as.OptionalStorage.impl.None.type.8ed = struct_value () [symbolic]
// CHECK:STDOUT: %OptionalStorage.impl_witness.328: <witness> = impl_witness imports.%OptionalStorage.impl_witness_table.f52, @ptr.as.OptionalStorage.impl(Cpp.void) [concrete]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.03c, (%OptionalStorage.impl_witness.328) [concrete]
// CHECK:STDOUT: %Optional.db3: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: %Optional.None.type.623: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: %Optional.None.97f: %Optional.None.type.623 = struct_value () [concrete]
// CHECK:STDOUT: %Optional.None.specific_fn: <specific function> = specific_function %Optional.None.97f, @Optional.None(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: %OptionalStorage.impl_witness.ab6: <witness> = impl_witness imports.%OptionalStorage.impl_witness_table.f52, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.874, (%OptionalStorage.impl_witness.ab6) [concrete]
// CHECK:STDOUT: %Optional.082: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: %Optional.None.type.fe0: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: %Optional.None.a64: %Optional.None.type.fe0 = struct_value () [concrete]
// CHECK:STDOUT: %Optional.None.specific_fn: <specific function> = specific_function %Optional.None.a64, @Optional.None(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Optional = %Core.Optional
// CHECK:STDOUT: .CppCompat = %CppCompat.c59
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
// CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic]
// CHECK:STDOUT: %Core.import_ref.f1d: @Optional.%Optional.None.type (%Optional.None.type.193) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.dc7)]
// CHECK:STDOUT: %Core.CppCompat: <namespace> = import_ref Core//prelude, CppCompat, loaded
// CHECK:STDOUT: %CppCompat.c59: <namespace> = namespace %Core.CppCompat, [concrete] {
// CHECK:STDOUT: .VoidBase = %Core.VoidBase
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.VoidBase: type = import_ref Core//prelude/types/cpp/void, VoidBase, loaded [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %Core.import_ref.2fb: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.cff)]
// CHECK:STDOUT: %Core.import_ref.1d4: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None.type (%ptr.as.OptionalStorage.impl.None.type.8ed) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None (constants.%ptr.as.OptionalStorage.impl.None.41a)]
// CHECK:STDOUT: %Core.import_ref.720 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
@@ -355,15 +354,15 @@ fn F() {
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
// CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic]
// CHECK:STDOUT: %Cpp.ref.loc14_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %void.ref: type = name_ref void, Cpp.void [concrete = Cpp.void]
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr.03c]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.328) [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr.874]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.ab6) [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %.loc14_34: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.db3]
// CHECK:STDOUT: %.loc14_35: %Optional.None.type.623 = specific_constant imports.%Core.import_ref.f1d, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.97f]
// CHECK:STDOUT: %None.ref: %Optional.None.type.623 = name_ref None, %.loc14_35 [concrete = constants.%Optional.None.97f]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.082]
// CHECK:STDOUT: %.loc14_35: %Optional.None.type.fe0 = specific_constant imports.%Core.import_ref.f1d, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.a64]
// CHECK:STDOUT: %None.ref: %Optional.None.type.fe0 = name_ref None, %.loc14_35 [concrete = constants.%Optional.None.a64]
// CHECK:STDOUT: %Optional.None.specific_fn: <specific function> = specific_function %None.ref, @Optional.None(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.specific_fn]
// CHECK:STDOUT: %Optional.None.call: init %Optional.db3 = call %Optional.None.specific_fn()
// CHECK:STDOUT: %Optional.None.call: init %Optional.082 = call %Optional.None.specific_fn()
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -374,38 +373,47 @@ fn F() {
// CHECK:STDOUT: %Optional.type: type = generic_class_type @Optional [concrete]
// CHECK:STDOUT: %Optional.generic: %Optional.type = struct_value () [concrete]
// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %ptr.4f0: type = ptr_type %T.d9f [symbolic]
// CHECK:STDOUT: %MaybeUnformed.cff: type = class_type @MaybeUnformed, @MaybeUnformed(%ptr.4f0) [symbolic]
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
// CHECK:STDOUT: %OptionalStorage.impl_witness.e1a: <witness> = impl_witness imports.%OptionalStorage.impl_witness_table.2f8, @ptr.as.OptionalStorage.impl(Cpp.void) [concrete]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.03c, (%OptionalStorage.impl_witness.e1a) [concrete]
// CHECK:STDOUT: %Optional.af8: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: %pattern_type.f90: type = pattern_type %Optional.af8 [concrete]
// CHECK:STDOUT: %OptionalStorage.impl_witness.0b2: <witness> = impl_witness imports.%OptionalStorage.impl_witness_table.2f8, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.874, (%OptionalStorage.impl_witness.0b2) [concrete]
// CHECK:STDOUT: %Optional.158: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete]
// CHECK:STDOUT: %pattern_type.005: type = pattern_type %Optional.158 [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
// CHECK:STDOUT: %facet_value.2d8: %type_where = facet_value %Optional.af8, () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d7f: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.2d8) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.7ff: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d7f = struct_value () [concrete]
// CHECK:STDOUT: %facet_value.911: %type_where = facet_value %Optional.158, () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.99d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.911) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.df1: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.99d = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Optional = %Core.Optional
// CHECK:STDOUT: .CppCompat = %CppCompat.c59
// CHECK:STDOUT: .Destroy = %Core.Destroy
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic]
// CHECK:STDOUT: %Core.CppCompat: <namespace> = import_ref Core//prelude, CppCompat, loaded
// CHECK:STDOUT: %CppCompat.c59: <namespace> = namespace %Core.CppCompat, [concrete] {
// CHECK:STDOUT: .VoidBase = %Core.VoidBase
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.VoidBase: type = import_ref Core//prelude/types/cpp/void, VoidBase, loaded [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %Core.import_ref.2fb: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.cff)]
// CHECK:STDOUT: %Core.import_ref.a7c = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
// CHECK:STDOUT: %Core.import_ref.720 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
@@ -416,9 +424,9 @@ fn F() {
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.03c, (constants.%OptionalStorage.impl_witness.e1a) [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %.loc10: %OptionalStorage.type = converted constants.%ptr.03c, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.af8]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.874, (constants.%OptionalStorage.impl_witness.0b2) [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %.loc10: %OptionalStorage.type = converted constants.%ptr.874, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.158]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
@@ -427,26 +435,26 @@ fn F() {
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %output.patt: %pattern_type.f90 = value_binding_pattern output [concrete]
// CHECK:STDOUT: %output.patt: %pattern_type.005 = value_binding_pattern output [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %Cpp.ref.loc10_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
// CHECK:STDOUT: %foo.call: init %Optional.af8 = call imports.%foo.decl()
// CHECK:STDOUT: %.loc10_38.1: type = splice_block %Optional [concrete = constants.%Optional.af8] {
// CHECK:STDOUT: %foo.call: init %Optional.158 = call imports.%foo.decl()
// CHECK:STDOUT: %.loc10_38.1: type = splice_block %Optional [concrete = constants.%Optional.158] {
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
// CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic]
// CHECK:STDOUT: %Cpp.ref.loc10_29: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %void.ref: type = name_ref void, Cpp.void [concrete = Cpp.void]
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr.03c]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.e1a) [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr.874]
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.0b2) [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %.loc10_38.2: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.af8]
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.158]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc10_50.1: ref %Optional.af8 = temporary_storage
// CHECK:STDOUT: %.loc10_50.2: ref %Optional.af8 = temporary %.loc10_50.1, %foo.call
// CHECK:STDOUT: %.loc10_50.3: %Optional.af8 = acquire_value %.loc10_50.2
// CHECK:STDOUT: %output: %Optional.af8 = value_binding output, %.loc10_50.3
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc10_50.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.7ff
// CHECK:STDOUT: %.loc10_50.1: ref %Optional.158 = temporary_storage
// CHECK:STDOUT: %.loc10_50.2: ref %Optional.158 = temporary %.loc10_50.1, %foo.call
// CHECK:STDOUT: %.loc10_50.3: %Optional.158 = acquire_value %.loc10_50.2
// CHECK:STDOUT: %output: %Optional.158 = value_binding output, %.loc10_50.3
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc10_50.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.df1
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc10_50.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%.loc10_50.2)
@@ -457,9 +465,10 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %ptr.730: type = ptr_type %ptr.03c [concrete]
// CHECK:STDOUT: %pattern_type.283: type = pattern_type %ptr.730 [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %ptr.e0b: type = ptr_type %ptr.874 [concrete]
// CHECK:STDOUT: %pattern_type.21b: type = pattern_type %ptr.e0b [concrete]
// CHECK:STDOUT: %Return.cpp_overload_set.type: type = cpp_overload_set_type @Return.cpp_overload_set [concrete]
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete]
// CHECK:STDOUT: %Return.type: type = fn_type @Return [concrete]
@@ -469,14 +478,14 @@ fn F() {
// CHECK:STDOUT: %Invoke.type: type = fn_type @Invoke [concrete]
// CHECK:STDOUT: %Invoke: %Invoke.type = struct_value () [concrete]
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
// CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.730, () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d6: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.62a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7d6 = struct_value () [concrete]
// CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.e0b, () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.40b: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.554: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.40b = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: .Return = %Return.cpp_overload_set.value
// CHECK:STDOUT: .Invoke = %Invoke.cpp_overload_set.value
// CHECK:STDOUT: import Cpp//...
@@ -498,27 +507,27 @@ fn F() {
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %non_nullable_pointer.patt: %pattern_type.283 = ref_binding_pattern non_nullable_pointer [concrete]
// CHECK:STDOUT: %non_nullable_pointer.var_patt: %pattern_type.283 = var_pattern %non_nullable_pointer.patt [concrete]
// CHECK:STDOUT: %non_nullable_pointer.patt: %pattern_type.21b = ref_binding_pattern non_nullable_pointer [concrete]
// CHECK:STDOUT: %non_nullable_pointer.var_patt: %pattern_type.21b = var_pattern %non_nullable_pointer.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %non_nullable_pointer.var: ref %ptr.730 = var %non_nullable_pointer.var_patt
// CHECK:STDOUT: %non_nullable_pointer.var: ref %ptr.e0b = var %non_nullable_pointer.var_patt
// CHECK:STDOUT: %Cpp.ref.loc11_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Return.ref: %Return.cpp_overload_set.type = name_ref Return, imports.%Return.cpp_overload_set.value [concrete = constants.%Return.cpp_overload_set.value]
// CHECK:STDOUT: %Return.call: init %ptr.730 = call imports.%Return.decl()
// CHECK:STDOUT: %Return.call: init %ptr.e0b = call imports.%Return.decl()
// CHECK:STDOUT: assign %non_nullable_pointer.var, %Return.call
// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_38 [concrete = constants.%ptr.730] {
// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_38 [concrete = constants.%ptr.e0b] {
// CHECK:STDOUT: %Cpp.ref.loc11_29: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %void.ref: type = name_ref void, Cpp.void [concrete = Cpp.void]
// CHECK:STDOUT: %ptr.loc11_37: type = ptr_type %void.ref [concrete = constants.%ptr.03c]
// CHECK:STDOUT: %ptr.loc11_38: type = ptr_type %ptr.loc11_37 [concrete = constants.%ptr.730]
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %ptr.loc11_37: type = ptr_type %void.ref [concrete = constants.%ptr.874]
// CHECK:STDOUT: %ptr.loc11_38: type = ptr_type %ptr.loc11_37 [concrete = constants.%ptr.e0b]
// CHECK:STDOUT: }
// CHECK:STDOUT: %non_nullable_pointer: ref %ptr.730 = ref_binding non_nullable_pointer, %non_nullable_pointer.var
// CHECK:STDOUT: %non_nullable_pointer: ref %ptr.e0b = ref_binding non_nullable_pointer, %non_nullable_pointer.var
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Invoke.ref: %Invoke.cpp_overload_set.type = name_ref Invoke, imports.%Invoke.cpp_overload_set.value [concrete = constants.%Invoke.cpp_overload_set.value]
// CHECK:STDOUT: %non_nullable_pointer.ref: ref %ptr.730 = name_ref non_nullable_pointer, %non_nullable_pointer
// CHECK:STDOUT: %.loc12: %ptr.730 = acquire_value %non_nullable_pointer.ref
// CHECK:STDOUT: %non_nullable_pointer.ref: ref %ptr.e0b = name_ref non_nullable_pointer, %non_nullable_pointer
// CHECK:STDOUT: %.loc12: %ptr.e0b = acquire_value %non_nullable_pointer.ref
// CHECK:STDOUT: %Invoke.call: init %empty_tuple.type = call imports.%Invoke.decl(%.loc12)
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %non_nullable_pointer.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.62a
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %non_nullable_pointer.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.554
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %non_nullable_pointer.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%non_nullable_pointer.var)
@@ -529,9 +538,10 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %const: type = const_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %const: type = const_type %Cpp.void [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %const [concrete]
// CHECK:STDOUT: %pattern_type.39c: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %pattern_type.972: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %Return.cpp_overload_set.type: type = cpp_overload_set_type @Return.cpp_overload_set [concrete]
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete]
// CHECK:STDOUT: %Return.type: type = fn_type @Return [concrete]
@@ -542,13 +552,13 @@ fn F() {
// CHECK:STDOUT: %Invoke: %Invoke.type = struct_value () [concrete]
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
// CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr, () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.db8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.a82: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.db8 = struct_value () [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.755: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.565: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.755 = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: .Return = %Return.cpp_overload_set.value
// CHECK:STDOUT: .Invoke = %Invoke.cpp_overload_set.value
// CHECK:STDOUT: import Cpp//...
@@ -570,8 +580,8 @@ fn F() {
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %const_void_pointer.patt: %pattern_type.39c = ref_binding_pattern const_void_pointer [concrete]
// CHECK:STDOUT: %const_void_pointer.var_patt: %pattern_type.39c = var_pattern %const_void_pointer.patt [concrete]
// CHECK:STDOUT: %const_void_pointer.patt: %pattern_type.972 = ref_binding_pattern const_void_pointer [concrete]
// CHECK:STDOUT: %const_void_pointer.var_patt: %pattern_type.972 = var_pattern %const_void_pointer.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %const_void_pointer.var: ref %ptr = var %const_void_pointer.var_patt
// CHECK:STDOUT: %Cpp.ref.loc11_45: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
@@ -580,7 +590,7 @@ fn F() {
// CHECK:STDOUT: assign %const_void_pointer.var, %Return.call
// CHECK:STDOUT: %.loc11: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref.loc11_33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %void.ref: type = name_ref void, Cpp.void [concrete = Cpp.void]
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %const: type = const_type %void.ref [concrete = constants.%const]
// CHECK:STDOUT: %ptr: type = ptr_type %const [concrete = constants.%ptr]
// CHECK:STDOUT: }
@@ -590,7 +600,7 @@ fn F() {
// CHECK:STDOUT: %const_void_pointer.ref: ref %ptr = name_ref const_void_pointer, %const_void_pointer
// CHECK:STDOUT: %.loc12: %ptr = acquire_value %const_void_pointer.ref
// CHECK:STDOUT: %Invoke.call: init %empty_tuple.type = call imports.%Invoke.decl(%.loc12)
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %const_void_pointer.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.a82
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %const_void_pointer.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.565
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %const_void_pointer.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%const_void_pointer.var)
+66
View File
@@ -0,0 +1,66 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/void.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/void.carbon
// --- void_not_incomplete.carbon
library "[[@TEST_NAME]]";
import Cpp;
// This is valid, unlike in C++, because `Cpp.void` is complete but abstract in
// Carbon. Values of type `Cpp.void` exist, but objects of that type do not.
fn F(x: Cpp.void) {}
// --- fail_void_abstract.carbon
library "[[@TEST_NAME]]";
import Cpp;
fn G() {
// CHECK:STDERR: fail_void_abstract.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `Cpp.void` in `var` pattern [AbstractTypeInVarPattern]
// CHECK:STDERR: var x: Cpp.void;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR: {{.*}}/prelude/types/cpp/void.carbon:22:1: note: class was declared abstract here [ClassAbstractHere]
// CHECK:STDERR: abstract class CppCompat.VoidBase {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
var x: Cpp.void;
}
// --- fail_void_argument.carbon
library "[[@TEST_NAME]]";
import Cpp inline "void F(int);";
fn G(v: Cpp.void) {
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE+7]]:10: error: no matching function for call to 'F' [CppInteropParseError]
// CHECK:STDERR: 14 | Cpp.F(v);
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-6]]:6: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'int' for 1st argument [CppInteropParseNote]
// CHECK:STDERR: 4 | void F(int);
// CHECK:STDERR: | ^ ~~~
// CHECK:STDERR:
Cpp.F(v);
}
fn H(p: Cpp.void*) {
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE+7]]:11: error: no matching function for call to 'F' [CppInteropParseError]
// CHECK:STDERR: 25 | Cpp.F(*p);
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_void_argument.carbon:[[@LINE-17]]:6: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'int' for 1st argument [CppInteropParseNote]
// CHECK:STDERR: 4 | void F(int);
// CHECK:STDERR: | ^ ~~~
// CHECK:STDERR:
Cpp.F(*p);
}
+29 -25
View File
@@ -99,14 +99,15 @@ fn F(input: Cpp.void*) {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %S: type = class_type @S [concrete]
// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %pattern_type.1f6: type = pattern_type %ptr.03c [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %pattern_type.9fb: type = pattern_type %ptr.874 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .S = %S.decl
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
@@ -115,16 +116,16 @@ fn F(input: Cpp.void*) {
// CHECK:STDOUT: fn @F(%input.param: %ptr.5c7) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %p.patt: %pattern_type.1f6 = value_binding_pattern p [concrete]
// CHECK:STDOUT: %p.patt: %pattern_type.9fb = value_binding_pattern p [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %input.ref: %ptr.5c7 = name_ref input, %input
// CHECK:STDOUT: %.loc17_18: type = splice_block %ptr.loc17 [concrete = constants.%ptr.03c] {
// CHECK:STDOUT: %.loc17_18: type = splice_block %ptr.loc17 [concrete = constants.%ptr.874] {
// CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %void.ref: type = name_ref void, Cpp.void [concrete = Cpp.void]
// CHECK:STDOUT: %ptr.loc17: type = ptr_type %void.ref [concrete = constants.%ptr.03c]
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %ptr.loc17: type = ptr_type %void.ref [concrete = constants.%ptr.874]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc17_22: %ptr.03c = converted %input.ref, <error> [concrete = <error>]
// CHECK:STDOUT: %p: %ptr.03c = value_binding p, <error> [concrete = <error>]
// CHECK:STDOUT: %.loc17_22: %ptr.874 = converted %input.ref, <error> [concrete = <error>]
// CHECK:STDOUT: %p: %ptr.874 = value_binding p, <error> [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -133,13 +134,14 @@ fn F(input: Cpp.void*) {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [concrete]
// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %pattern_type.1f6: type = pattern_type %ptr.03c [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %pattern_type.9fb: type = pattern_type %ptr.874 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -147,23 +149,24 @@ fn F(input: Cpp.void*) {
// CHECK:STDOUT: fn @F(%input.param: %ptr.019) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %p.patt: %pattern_type.1f6 = value_binding_pattern p [concrete]
// CHECK:STDOUT: %p.patt: %pattern_type.9fb = value_binding_pattern p [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %input.ref: %ptr.019 = name_ref input, %input
// CHECK:STDOUT: %.loc17_18: type = splice_block %ptr.loc17 [concrete = constants.%ptr.03c] {
// CHECK:STDOUT: %.loc17_18: type = splice_block %ptr.loc17 [concrete = constants.%ptr.874] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %void.ref: type = name_ref void, Cpp.void [concrete = Cpp.void]
// CHECK:STDOUT: %ptr.loc17: type = ptr_type %void.ref [concrete = constants.%ptr.03c]
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
// CHECK:STDOUT: %ptr.loc17: type = ptr_type %void.ref [concrete = constants.%ptr.874]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc17_22: %ptr.03c = converted %input.ref, <error> [concrete = <error>]
// CHECK:STDOUT: %p: %ptr.03c = value_binding p, <error> [concrete = <error>]
// CHECK:STDOUT: %.loc17_22: %ptr.874 = converted %input.ref, <error> [concrete = <error>]
// CHECK:STDOUT: %p: %ptr.874 = value_binding p, <error> [concrete = <error>]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_todo_explicit_as_from_void_pointer_to_cpp_class_pointer.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %S: type = class_type @S [concrete]
// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
// CHECK:STDOUT: %pattern_type.259: type = pattern_type %ptr.5c7 [concrete]
@@ -171,19 +174,19 @@ fn F(input: Cpp.void*) {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .void = Cpp.void
// CHECK:STDOUT: .void = constants.%Cpp.void
// CHECK:STDOUT: .S = %S.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%input.param: %ptr.03c) {
// CHECK:STDOUT: fn @F(%input.param: %ptr.874) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %p.patt: %pattern_type.259 = value_binding_pattern p [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %input.ref: %ptr.03c = name_ref input, %input
// CHECK:STDOUT: %input.ref: %ptr.874 = name_ref input, %input
// CHECK:STDOUT: %Cpp.ref.loc17_28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %S.ref.loc17_31: type = name_ref S, imports.%S.decl [concrete = constants.%S]
// CHECK:STDOUT: %ptr.loc17_33: type = ptr_type %S.ref.loc17_31 [concrete = constants.%ptr.5c7]
@@ -201,7 +204,8 @@ fn F(input: Cpp.void*) {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [concrete]
// CHECK:STDOUT: %ptr.03c: type = ptr_type Cpp.void [concrete]
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
// CHECK:STDOUT: %ptr.874: type = ptr_type %Cpp.void [concrete]
// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
// CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
// CHECK:STDOUT: }
@@ -209,12 +213,12 @@ fn F(input: Cpp.void*) {
// CHECK:STDOUT: imports {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%input.param: %ptr.03c) {
// CHECK:STDOUT: fn @F(%input.param: %ptr.874) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %p.patt: %pattern_type.44a = value_binding_pattern p [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %input.ref: %ptr.03c = name_ref input, %input
// CHECK:STDOUT: %input.ref: %ptr.874 = name_ref input, %input
// CHECK:STDOUT: %C.ref.loc17_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %ptr.loc17_25: type = ptr_type %C.ref.loc17_24 [concrete = constants.%ptr.019]
// CHECK:STDOUT: %.loc17_21: %ptr.019 = converted %input.ref, <error> [concrete = <error>]
-14
View File
@@ -208,12 +208,6 @@ class TypeCompleter {
auto BuildInfoForInst(SemIR::TypeId /*type_id*/, SemIR::ConstType inst) const
-> SemIR::CompleteTypeInfo;
auto BuildInfoForInst(SemIR::TypeId /*type_id*/,
SemIR::CppVoidType /*inst*/) const
-> SemIR::CompleteTypeInfo {
CARBON_FATAL("`CppVoidType` is always-incomplete");
}
auto BuildInfoForInst(SemIR::TypeId type_id,
SemIR::CustomLayoutType inst) const
-> SemIR::CompleteTypeInfo;
@@ -387,14 +381,6 @@ auto TypeCompleter::AddNestedIncompleteTypes(SemIR::Inst type_inst) -> bool {
Push(context_->types().GetTypeIdForTypeInstId(inst.inner_id));
break;
}
case SemIR::CppVoidType::Kind: {
if (diagnoser_) {
CARBON_DIAGNOSTIC(CppVoidIncomplete, Note,
"`Cpp.void` is always-incomplete");
diagnoser_().Note(SemIR::LocId::None, CppVoidIncomplete).Emit();
}
return false;
}
case CARBON_KIND(SemIR::CustomLayoutType inst): {
for (auto field : context_->struct_type_fields().Get(inst.fields_id)) {
Push(context_->types().GetTypeIdForTypeInstId(field.type_inst_id));
@@ -291,7 +291,6 @@ CARBON_DIAGNOSTIC_KIND(ClassForwardDeclaredHere)
CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclOutsideClass)
CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclPrevious)
CARBON_DIAGNOSTIC_KIND(ClassIncompleteWithinDefinition)
CARBON_DIAGNOSTIC_KIND(CppVoidIncomplete)
CARBON_DIAGNOSTIC_KIND(GenericVirtual)
CARBON_DIAGNOSTIC_KIND(OverrideWithoutBase)
CARBON_DIAGNOSTIC_KIND(OverrideWithoutVirtualInBase)
+4 -4
View File
@@ -32,7 +32,7 @@
// CHECK:STDOUT: import_ir_insts: {}
// CHECK:STDOUT: clang_decls: {}
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: instE, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {}}
// CHECK:STDOUT: name_scope0: {inst: instD, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {}}
// CHECK:STDOUT: entity_names: {}
// CHECK:STDOUT: cpp_global_vars: {}
// CHECK:STDOUT: functions: {}
@@ -49,10 +49,10 @@
// CHECK:STDOUT: 'type(inst(NamespaceType))':
// CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: instE: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: instD: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: values:
// CHECK:STDOUT: instE: concrete_constant(instE)
// CHECK:STDOUT: instD: concrete_constant(instD)
// CHECK:STDOUT: symbolic_constants: {}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: inst_block_empty: {}
@@ -60,7 +60,7 @@
// CHECK:STDOUT: imports: {}
// CHECK:STDOUT: global_init: {}
// CHECK:STDOUT: inst_block60000004:
// CHECK:STDOUT: 0: instE
// CHECK:STDOUT: 0: instD
// CHECK:STDOUT: ...
// CHECK:STDOUT: --- -
// CHECK:STDOUT:
+8 -9
View File
@@ -927,15 +927,14 @@ static auto BuildTypeForInst(FileContext& context,
}
template <typename InstT>
requires(
InstT::Kind.template IsAnyOf<
SemIR::AssociatedEntityType, SemIR::AutoType, SemIR::BoundMethodType,
SemIR::CharLiteralType, SemIR::CppOverloadSetType, SemIR::CppVoidType,
SemIR::FacetType, SemIR::FloatLiteralType, SemIR::FunctionType,
SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType,
SemIR::GenericInterfaceType, SemIR::GenericNamedConstraintType,
SemIR::InstType, SemIR::IntLiteralType, SemIR::NamespaceType,
SemIR::WhereExpr, SemIR::WitnessType, SemIR::UnboundElementType>())
requires(InstT::Kind.template IsAnyOf<
SemIR::AssociatedEntityType, SemIR::AutoType, SemIR::BoundMethodType,
SemIR::CharLiteralType, SemIR::CppOverloadSetType, SemIR::FacetType,
SemIR::FloatLiteralType, SemIR::FunctionType,
SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType,
SemIR::GenericInterfaceType, SemIR::GenericNamedConstraintType,
SemIR::InstType, SemIR::IntLiteralType, SemIR::NamespaceType,
SemIR::WhereExpr, SemIR::WitnessType, SemIR::UnboundElementType>())
static auto BuildTypeForInst(FileContext& context, InstT /*inst*/)
-> llvm::Type* {
// Return an empty struct as a placeholder.
+3 -3
View File
@@ -213,10 +213,10 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
// CHECK:STDOUT: !30 = !DILocation(line: 32, column: 3, scope: !28)
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !6, line: 35, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !32 = !DILocation(line: 36, column: 3, scope: !31)
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4", scope: null, file: !34, line: 45, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4", scope: null, file: !34, line: 46, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !34 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "")
// CHECK:STDOUT: !35 = !DILocation(line: 46, column: 14, scope: !33)
// CHECK:STDOUT: !36 = !DILocation(line: 46, column: 7, scope: !33)
// CHECK:STDOUT: !35 = !DILocation(line: 47, column: 14, scope: !33)
// CHECK:STDOUT: !36 = !DILocation(line: 47, column: 7, scope: !33)
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.e49c05a5c9dc9c86", scope: null, file: !38, line: 26, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !38 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !39 = !DILocation(line: 27, column: 5, scope: !37)
+1 -1
View File
@@ -2,7 +2,7 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
// EXTRA-ARGS: --target=x86_64-linux-gnu
//
// AUTOUPDATE
+109
View File
@@ -0,0 +1,109 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/void.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/void.carbon
// --- take_void_ptr.h
void take_void_ptr(void *p);
// --- call.carbon
library "[[@TEST_NAME]]";
import Cpp library "take_void_ptr.h";
fn PassVoidPtr(a: Cpp.void*) {
Cpp.take_void_ptr(a);
}
// CHECK:STDOUT: ; ModuleID = 'call.carbon'
// CHECK:STDOUT: source_filename = "call.carbon"
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassVoidPtr.Main(ptr %a) #0 !dbg !7 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc7_21.2.temp = alloca ptr, align 8, !dbg !10
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7"(ptr %a), !dbg !10
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_21.2.temp), !dbg !10
// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !10
// CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !10
// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !11
// CHECK:STDOUT: ret void, !dbg !12
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z13take_void_ptrPv(ptr)
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7"(ptr %self) #0 !dbg !13 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97"(ptr %self), !dbg !15
// CHECK:STDOUT: ret ptr %1, !dbg !16
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97"(ptr %self) #0 !dbg !17 {
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.b95abfcde220df97(ptr %self), !dbg !18
// CHECK:STDOUT: ret ptr %1, !dbg !19
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.b95abfcde220df97(ptr %value) #0 !dbg !20 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %value), !dbg !21
// CHECK:STDOUT: ret ptr %1, !dbg !22
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %self) #0 !dbg !23 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !24
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !24
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !25
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !26
// CHECK:STDOUT: ret ptr %2, !dbg !27
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT:
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = !{i32 1, !"wchar_size", i32 4}
// CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 0}
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !6 = !DIFile(filename: "call.carbon", directory: "")
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassVoidPtr", linkageName: "_CPassVoidPtr.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
// CHECK:STDOUT: !9 = !{}
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 21, scope: !7)
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
// CHECK:STDOUT: !12 = !DILocation(line: 6, column: 1, scope: !7)
// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7", scope: null, file: !14, line: 82, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !14 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !15 = !DILocation(line: 83, column: 12, scope: !13)
// CHECK:STDOUT: !16 = !DILocation(line: 83, column: 5, scope: !13)
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97", scope: null, file: !14, line: 68, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !18 = !DILocation(line: 69, column: 12, scope: !17)
// CHECK:STDOUT: !19 = !DILocation(line: 69, column: 5, scope: !17)
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b95abfcde220df97", scope: null, file: !14, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !21 = !DILocation(line: 30, column: 12, scope: !20)
// CHECK:STDOUT: !22 = !DILocation(line: 30, column: 5, scope: !20)
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299", scope: null, file: !14, line: 125, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !24 = !DILocation(line: 126, column: 14, scope: !23)
// CHECK:STDOUT: !25 = !DILocation(line: 127, column: 5, scope: !23)
// CHECK:STDOUT: !26 = !DILocation(line: 126, column: 18, scope: !23)
// CHECK:STDOUT: !27 = !DILocation(line: 128, column: 5, scope: !23)
-1
View File
@@ -117,7 +117,6 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory {
case ConvertToValueAction::Kind:
case CppOverloadSetType::Kind:
case CppOverloadSetValue::Kind:
case CppVoidType::Kind:
case CustomLayoutType::Kind:
case FacetAccessType::Kind:
case FacetType::Kind:
-1
View File
@@ -55,7 +55,6 @@ CARBON_SEM_IR_INST_KIND(ConvertToValueAction)
CARBON_SEM_IR_INST_KIND(Converted)
CARBON_SEM_IR_INST_KIND(CppOverloadSetType)
CARBON_SEM_IR_INST_KIND(CppOverloadSetValue)
CARBON_SEM_IR_INST_KIND(CppVoidType)
CARBON_SEM_IR_INST_KIND(CustomLayoutType)
CARBON_SEM_IR_INST_KIND(Deref)
CARBON_SEM_IR_INST_KIND(ErrorInst)
+13 -7
View File
@@ -13,13 +13,19 @@ namespace Carbon::SemIR {
// The canonical list of singleton kinds. The order of `TypeType` is
// significant because other singletons use it as a type.
static constexpr std::array SingletonInstKinds = {
InstKind::TypeType, InstKind::AutoType,
InstKind::BoolType, InstKind::BoundMethodType,
InstKind::CharLiteralType, InstKind::CppVoidType,
InstKind::ErrorInst, InstKind::FloatLiteralType,
InstKind::InstType, InstKind::IntLiteralType,
InstKind::NamespaceType, InstKind::SpecificFunctionType,
InstKind::VtableType, InstKind::WitnessType,
InstKind::TypeType,
InstKind::AutoType,
InstKind::BoolType,
InstKind::BoundMethodType,
InstKind::CharLiteralType,
InstKind::ErrorInst,
InstKind::FloatLiteralType,
InstKind::InstType,
InstKind::IntLiteralType,
InstKind::NamespaceType,
InstKind::SpecificFunctionType,
InstKind::VtableType,
InstKind::WitnessType,
};
// Returns true if the InstKind is a singleton.
+4
View File
@@ -178,6 +178,7 @@ auto RecognizedTypeInfo::ForType(const File& file, ClassType class_type)
Kind kind = llvm::StringSwitch<Kind>(*name_ident)
.Case("Long32", CppLong32)
.Case("NullptrT", CppNullptrT)
.Case("VoidBase", CppVoidBase)
.Default(None);
return {.kind = kind};
}
@@ -210,6 +211,9 @@ auto RecognizedTypeInfo::PrintLiteral(const File& file,
case CppNullptrT:
out << "Cpp.nullptr_t";
break;
case CppVoidBase:
out << "Cpp.void";
break;
case Str:
out << "str";
break;
+2
View File
@@ -240,6 +240,8 @@ struct RecognizedTypeInfo {
CppLong32,
// `Cpp.nullptr_t` / `Core.CppCompat.NullptrT`.
CppNullptrT,
// `Cpp.void` / `Core.CppCompat.VoidBase`.
CppVoidBase,
// `str` / `Core.String`.
// TODO: Rename `Core.String` to `Core.Str`.
Str,
-1
View File
@@ -90,7 +90,6 @@ auto TypeIterator::ProcessTypeId(TypeId type_id) -> std::optional<Step> {
case BoolType::Kind:
case CharLiteralType::Kind:
case CppOverloadSetType::Kind:
case CppVoidType::Kind:
case FacetType::Kind:
case FloatLiteralType::Kind:
case FloatType::Kind:
-8
View File
@@ -506,14 +506,6 @@ struct ConvertToValueAction {
TypeInstId target_type_inst_id;
};
// A type for C++ `void`. Should only be used for pointers (`void*`).
struct CppVoidType
: public SingletonTypeInst<InstKind::CppVoidType, "Cpp.void"> {
// `Cpp.void` is never complete, so `GetSingletonType` won't work.
static constexpr auto TypeId =
TypeId::ForTypeConstant(ConstantId::ForConcreteConstant(TypeInstId));
};
// A type whose layout is determined externally. This is used as the object
// representation of class types imported from C++.
struct CustomLayoutType {