From 5c6e5b1c226e5f96d23f5702ea10ae9c40b8e5aa Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Mon, 17 Nov 2025 16:47:25 +0100 Subject: [PATCH] Add `CppCompat.ULong32`, `CppCompat.LongLong64` and `CppCompat.ULongLong64` This extends #6364 to allow having: * `Cpp.unsigned_long` as a distinct type when `unsigned long` is 32 bits. * `Cpp.long_long` and `Cpp.unsigned_long_long` as distinct types when `long` and `unsigned long` are 64 bits. Similarly to #6364, we only support implicit conversions from the matching literal type (`u32`, `i64` and `u64`). See #6275 for rationale. Part of #5263. --- core/prelude/types/cpp/int.carbon | 56 +- toolchain/check/cpp/import.cpp | 32 +- toolchain/check/cpp/type_mapping.cpp | 26 +- .../interop/cpp/builtins.llp64.carbon | 710 ++++++++++++------ .../testdata/interop/cpp/builtins.lp64.carbon | 693 +++++++++++++---- ...fail_todo_arithmetic_types_unmapped.carbon | 25 +- .../check/testdata/interop/cpp/macros.carbon | 15 +- toolchain/diagnostics/coverage_test.cpp | 3 + toolchain/sem_ir/type_info.cpp | 46 +- toolchain/sem_ir/type_info.h | 9 + 10 files changed, 1189 insertions(+), 426 deletions(-) diff --git a/core/prelude/types/cpp/int.carbon b/core/prelude/types/cpp/int.carbon index 8699b49c21926..35081e435bf2a 100644 --- a/core/prelude/types/cpp/int.carbon +++ b/core/prelude/types/cpp/int.carbon @@ -7,32 +7,80 @@ package Core library "prelude/types/cpp/int"; import library "prelude/operators"; import library "prelude/types/int"; import library "prelude/types/int_literal"; +import library "prelude/types/uint"; namespace CppCompat; -// TODO: Add ULong32, LongLong64, ULongLong64. class CppCompat.Long32 { adapt i32; } +class CppCompat.ULong32 { + adapt u32; +} + +class CppCompat.LongLong64 { + adapt i64; +} + +class CppCompat.ULongLong64 { + adapt u64; +} + // TODO: Copy. // Conversions. -// TODO: ImplicitAs from IntLiteral to Long32. -// TODO: ImplicitAs from Long32 to IntLiteral. +// TODO: ImplicitAs from IntLiteral to Long32, ULong32, LongLong64, ULongLong64. +// TODO: ImplicitAs from Long32, ULong32, LongLong64, ULongLong64 to IntLiteral. // TODO: ImplicitAs from Int(N) to Long32 if N < 32. impl i32 as ImplicitAs(CppCompat.Long32) { fn Convert[self: Self]() -> CppCompat.Long32 = "int.convert_checked"; } +// TODO: ImplicitAs from UInt(N) to ULong32 if N < 32. +impl u32 as ImplicitAs(CppCompat.ULong32) { + fn Convert[self: Self]() -> CppCompat.ULong32 = "int.convert_checked"; +} + +// TODO: ImplicitAs from Int(N) to LongLong64 if N < 64. +impl i64 as ImplicitAs(CppCompat.LongLong64) { + fn Convert[self: Self]() -> CppCompat.LongLong64 = "int.convert_checked"; +} + +// TODO: ImplicitAs from UInt(N) to ULongLong64 if N < 64. +impl u64 as ImplicitAs(CppCompat.ULongLong64) { + fn Convert[self: Self]() -> CppCompat.ULongLong64 = "int.convert_checked"; +} + // TODO: ImplicitAs from Long32 to Int(N) if N > 32. final impl CppCompat.Long32 as ImplicitAs(i32) { fn Convert[self: Self]() -> i32 = "int.convert"; } +// TODO: ImplicitAs from ULong32 to UInt(N) if N > 32. +final impl CppCompat.ULong32 as ImplicitAs(u32) { + fn Convert[self: Self]() -> u32 = "int.convert"; +} + +// TODO: ImplicitAs from LongLong64 to Int(N) if N > 64. +final impl CppCompat.LongLong64 as ImplicitAs(i64) { + fn Convert[self: Self]() -> i64 = "int.convert"; +} + +// TODO: ImplicitAs from ULongLong64 to UInt(N) if N > 64. +final impl CppCompat.ULongLong64 as ImplicitAs(u64) { + fn Convert[self: Self]() -> u64 = "int.convert"; +} + // TODO: As from Long32 to Int(N) if N < 32. +// TODO: As from ULong32 to UInt(N) if N < 32. +// TODO: As from LongLong64 to Int(N) if N < 64. +// TODO: As from ULongLong64 to UInt(N) if N < 64. // TODO: As from Int(N) to Long32 if N > 32. +// TODO: As from UInt(N) to ULong32 if N > 32. +// TODO: As from Int(N) to LongLong64 if N > 64. +// TODO: As from UInt(N) to ULongLong64 if N > 64. -// TODO: Operations on Long32. +// TODO: Operations on Long32, ULong32, LongLong64, ULongLong64. diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index 082b165ed534b..4d44282991fab 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -1086,6 +1086,21 @@ static auto MakeIntType(Context& context, IntId size_id, bool is_signed) return ExprAsType(context, Parse::NodeId::None, type_inst_id); } +// Maps a C++ builtin integer type to a Carbon `Core.CppCompat` type. +static auto MapBuiltinCppCompatIntegerType(Context& context, + unsigned int cpp_width, + unsigned int carbon_width, + llvm::StringRef cpp_compat_name) + -> TypeExpr { + if (cpp_width != carbon_width) { + return TypeExpr::None; + } + + return ExprAsType(context, Parse::NodeId::None, + LookupNameInCore(context, Parse::NodeId::None, + {"CppCompat", cpp_compat_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, @@ -1112,11 +1127,18 @@ static auto MapBuiltinIntegerType(Context& context, SemIR::LocId loc_id, return ExprAsType(context, Parse::NodeId::None, MakeCharTypeLiteral(context, Parse::NodeId::None)); } - if (clang::ASTContext::hasSameType(qual_type, ast_context.LongTy) && - width == 32) { - return ExprAsType(context, Parse::NodeId::None, - LookupNameInCore(context, Parse::NodeId::None, - {"CppCompat", "Long32"})); + if (clang::ASTContext::hasSameType(qual_type, ast_context.LongTy)) { + return MapBuiltinCppCompatIntegerType(context, width, 32, "Long32"); + } + if (clang::ASTContext::hasSameType(qual_type, ast_context.UnsignedLongTy)) { + return MapBuiltinCppCompatIntegerType(context, width, 32, "ULong32"); + } + if (clang::ASTContext::hasSameType(qual_type, ast_context.LongLongTy)) { + return MapBuiltinCppCompatIntegerType(context, width, 64, "LongLong64"); + } + if (clang::ASTContext::hasSameType(qual_type, + ast_context.UnsignedLongLongTy)) { + return MapBuiltinCppCompatIntegerType(context, width, 64, "ULongLong64"); } return TypeExpr::None; } diff --git a/toolchain/check/cpp/type_mapping.cpp b/toolchain/check/cpp/type_mapping.cpp index 53490c3bb1ea2..b856616838bc7 100644 --- a/toolchain/check/cpp/type_mapping.cpp +++ b/toolchain/check/cpp/type_mapping.cpp @@ -100,6 +100,17 @@ static auto LookupCppType( : clang::QualType(); } +// Returns the given integer type if its width is as expected. Otherwise returns +// the null type. +static auto VerifyIntegerTypeWidth(Context& context, clang::QualType type, + unsigned int expected_width) + -> clang::QualType { + if (context.ast_context().getIntWidth(type) == expected_width) { + return type; + } + return clang::QualType(); +} + // Maps a Carbon class type to a C++ type. Returns a null `QualType` if the // type is not supported. static auto TryMapClassType(Context& context, SemIR::ClassType class_type) @@ -153,10 +164,17 @@ static auto TryMapClassType(Context& context, SemIR::ClassType class_type) return ast_context.CharTy; } case SemIR::RecognizedTypeInfo::CppLong32: { - if (ast_context.getIntWidth(ast_context.LongTy) == 32) { - return ast_context.LongTy; - } - break; + return VerifyIntegerTypeWidth(context, ast_context.LongTy, 32); + } + case SemIR::RecognizedTypeInfo::CppULong32: { + return VerifyIntegerTypeWidth(context, ast_context.UnsignedLongTy, 32); + } + case SemIR::RecognizedTypeInfo::CppLongLong64: { + return VerifyIntegerTypeWidth(context, ast_context.LongLongTy, 64); + } + case SemIR::RecognizedTypeInfo::CppULongLong64: { + return VerifyIntegerTypeWidth(context, ast_context.UnsignedLongLongTy, + 64); } case SemIR::RecognizedTypeInfo::CppNullptrT: { return ast_context.NullPtrTy; diff --git a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon index 5552785d84064..67c818e9e8bdf 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon @@ -11,7 +11,33 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/builtins.llp64.carbon -// --- supported_types.carbon +// --- long_long.carbon + +library "[[@TEST_NAME]]"; + +import Cpp; + +fn F() { + //@dump-sem-ir-begin + let cpp_long_long : Cpp.long_long = 1 as i64; + let carbon_long_long: i64 = cpp_long_long; + //@dump-sem-ir-end +} + +// --- unsigned_long_long.carbon + +library "[[@TEST_NAME]]"; + +import Cpp; + +fn F() { + //@dump-sem-ir-begin + let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64; + let carbon_unsigned_long_long: u64 = cpp_unsigned_long_long; + //@dump-sem-ir-end +} + +// --- long.carbon library "[[@TEST_NAME]]"; @@ -26,84 +52,200 @@ auto PassLong(int x) -> IntResult; fn F() { //@dump-sem-ir-begin - let cpp_long_long : Cpp.long_long = 1 as i64; - let carbon_long_long: i64 = cpp_long_long; - let cpp_long: Cpp.long = 1 as i32; let cpp_long_result: Cpp.LongResult = Cpp.PassLong(cpp_long); let cpp_compat_long: Core.CppCompat.Long32 = cpp_long; - let cpp_compat_long_long_result: Cpp.LongResult = Cpp.PassLong(cpp_long); + let cpp_compat_long_result: Cpp.LongResult = Cpp.PassLong(cpp_compat_long); let carbon_i32: i32 = cpp_long; let carbon_i32_result: Cpp.IntResult = Cpp.PassLong(carbon_i32); - - let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64; - let carbon_unsigned_long_long: u64 = cpp_unsigned_long_long; //@dump-sem-ir-end } -// --- fail_todo_unsupported_types.carbon +// --- unsigned_long.carbon library "[[@TEST_NAME]]"; -import Cpp; +import Cpp inline +''' +class ULongResult {}; +auto PassULong(unsigned long x) -> ULongResult; + +class UIntResult {}; +auto PassULong(unsigned int x) -> UIntResult; +'''; fn F() { //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:27: error: semantics TODO: `Unsupported: builtin type: unsigned long` [SemanticsTodo] - // CHECK:STDERR: let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:27: note: in `Cpp` name lookup for `unsigned_long` [InCppNameLookup] - // CHECK:STDERR: let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: - let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64; - let carbon_unsigned_long: u64 = cpp_unsigned_long; + let cpp_unsigned_long: Cpp.unsigned_long = 1 as u32; + let cpp_unsigned_long_result: Cpp.ULongResult = Cpp.PassULong(cpp_unsigned_long); + + let cpp_compat_ulong: Core.CppCompat.ULong32 = cpp_unsigned_long; + let cpp_compat_ulong_result: Cpp.ULongResult = Cpp.PassULong(cpp_compat_ulong); + + let carbon_u32: u32 = cpp_unsigned_long; + let carbon_u32_result: Cpp.UIntResult = Cpp.PassULong(carbon_u32); //@dump-sem-ir-end } -// CHECK:STDOUT: --- supported_types.carbon +// CHECK:STDOUT: --- long_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] -// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] -// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete] // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %i64 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] -// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %As.type.bbb: type = facet_type <@As, @As(%i64)> [concrete] // CHECK:STDOUT: %As.Convert.type.d57: type = fn_type @As.Convert, @As(%i64) [concrete] // CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%To.586) [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.2b1: %Core.IntLiteral.as.As.impl.Convert.type.0fd = struct_value () [symbolic] -// CHECK:STDOUT: %As.impl_witness.c40: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete] +// CHECK:STDOUT: %As.impl_witness.c40: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.108: %Core.IntLiteral.as.As.impl.Convert.type.4f0 = struct_value () [concrete] -// CHECK:STDOUT: %As.facet.2cd: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete] -// CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet.2cd [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.373: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e: = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert.1(%int_64) [concrete] -// CHECK:STDOUT: %bound_method.c84: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e [concrete] +// CHECK:STDOUT: %As.facet: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete] +// CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.41a: %i64 = int_value 1 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .long_long = @F.%i64.1 +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)] +// CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_long_long.patt: %pattern_type.95b = value_binding_pattern cpp_long_long [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %i64.loc8: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] +// CHECK:STDOUT: %impl.elem0: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108] +// CHECK:STDOUT: %bound_method.loc8_41.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_41.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc8_41.2(%int_1) [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc8_41.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc8_41.2: %i64 = converted %int_1, %.loc8_41.1 [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc8_26: type = splice_block %long_long.ref [concrete = constants.%i64] { +// CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: +// CHECK:STDOUT: %long_long.ref: type = name_ref long_long, %i64.1 [concrete = constants.%i64] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_long_long: %i64 = value_binding cpp_long_long, %.loc8_41.2 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %carbon_long_long.patt: %pattern_type.95b = value_binding_pattern carbon_long_long [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_long_long.ref: %i64 = name_ref cpp_long_long, %cpp_long_long +// CHECK:STDOUT: %.loc9: type = splice_block %i64.loc9 [concrete = constants.%i64] { +// CHECK:STDOUT: %int_64.loc9: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %i64.loc9: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] +// CHECK:STDOUT: } +// CHECK:STDOUT: %carbon_long_long: %i64 = value_binding carbon_long_long, %cpp_long_long.ref +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- unsigned_long_long.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete] +// CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete] +// CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic] +// CHECK:STDOUT: %As.impl_witness.ed2d: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete] +// CHECK:STDOUT: %As.facet: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2d) [concrete] +// CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .unsigned_long_long = @F.%u64.1 +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/types/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)] +// CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_unsigned_long_long.patt: %pattern_type.157 = value_binding_pattern cpp_unsigned_long_long [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %u64.loc8: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: %impl.elem0: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09] +// CHECK:STDOUT: %bound_method.loc8_59.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_59.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc8_59.2(%int_1) [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc8_59.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc8_59.2: %u64 = converted %int_1, %.loc8_59.1 [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc8_35: type = splice_block %unsigned_long_long.ref [concrete = constants.%u64] { +// CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: +// CHECK:STDOUT: %unsigned_long_long.ref: type = name_ref unsigned_long_long, %u64.1 [concrete = constants.%u64] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_unsigned_long_long: %u64 = value_binding cpp_unsigned_long_long, %.loc8_59.2 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %carbon_unsigned_long_long.patt: %pattern_type.157 = value_binding_pattern carbon_unsigned_long_long [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_unsigned_long_long.ref: %u64 = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long +// CHECK:STDOUT: %.loc9: type = splice_block %u64.loc9 [concrete = constants.%u64] { +// CHECK:STDOUT: %int_64.loc9: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %u64.loc9: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: } +// CHECK:STDOUT: %carbon_unsigned_long_long: %u64 = value_binding carbon_unsigned_long_long, %cpp_unsigned_long_long.ref +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- long.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.68c: type = pattern_type %Cpp.long [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete] // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete] -// CHECK:STDOUT: %As.impl_witness.bf0: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl.863(%int_32) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.11b: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%int_32) [concrete] +// CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.2b1: %Core.IntLiteral.as.As.impl.Convert.type.0fd = struct_value () [symbolic] +// CHECK:STDOUT: %As.impl_witness.bf0: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.11b: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.035: %Core.IntLiteral.as.As.impl.Convert.type.11b = struct_value () [concrete] -// CHECK:STDOUT: %As.facet.1f3: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.bf0) [concrete] -// CHECK:STDOUT: %.edb: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet.1f3 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.17b: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.035 [concrete] +// CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.bf0) [concrete] +// CHECK:STDOUT: %.edb: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.035 [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.d03: = specific_function %Core.IntLiteral.as.As.impl.Convert.035, @Core.IntLiteral.as.As.impl.Convert.1(%int_32) [concrete] -// CHECK:STDOUT: %bound_method.6b2: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.d03 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.035, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] @@ -135,23 +277,6 @@ fn F() { // CHECK:STDOUT: %ptr.3cb: type = ptr_type %IntResult [concrete] // CHECK:STDOUT: %PassLong__carbon_thunk.type.9d9430.2: type = fn_type @PassLong__carbon_thunk.2 [concrete] // CHECK:STDOUT: %PassLong__carbon_thunk.58a8f3.2: %PassLong__carbon_thunk.type.9d9430.2 = struct_value () [concrete] -// CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] -// CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete] -// CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete] -// CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete] -// CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%To.586) [symbolic] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic] -// CHECK:STDOUT: %As.impl_witness.ed2d: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete] -// CHECK:STDOUT: %As.facet.bf5: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2d) [concrete] -// CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet.bf5 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.eb8: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.009: = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert.2(%int_64) [concrete] -// CHECK:STDOUT: %bound_method.bb9: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.009 [concrete] -// CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %type_where: type = facet_type > [concrete] // CHECK:STDOUT: %facet_value.743: %type_where = facet_value %IntResult, () [concrete] @@ -164,28 +289,21 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .CppCompat = %CppCompat.c59 // CHECK:STDOUT: .Int = %Core.Int // CHECK:STDOUT: .As = %Core.As -// CHECK:STDOUT: .CppCompat = %CppCompat.c59 // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: .UInt = %Core.UInt // CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { -// CHECK:STDOUT: .long_long = @F.%i64.1 // CHECK:STDOUT: .long = constants.%Cpp.long // CHECK:STDOUT: .LongResult = %LongResult.decl // CHECK:STDOUT: .PassLong = %PassLong.cpp_overload_set.value // CHECK:STDOUT: .IntResult = %IntResult.decl -// CHECK:STDOUT: .unsigned_long_long = @F.%u64.1 // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] -// CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)] -// CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl.863 [concrete] // CHECK:STDOUT: %Core.CppCompat: = import_ref Core//prelude, CppCompat, loaded // CHECK:STDOUT: %CppCompat.c59: = namespace %Core.CppCompat, [concrete] { // CHECK:STDOUT: .Long32 = %Core.Long32 @@ -193,6 +311,10 @@ fn F() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Long32: type = import_ref Core//prelude/types/cpp/int, Long32, loaded [concrete = constants.%Cpp.long] +// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] +// CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)] +// CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.e63: %i32.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/cpp/int, loc{{\d+_\d+}}, loaded [concrete = constants.%i32.as.ImplicitAs.impl.Convert] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.bd5 = impl_witness_table (%Core.import_ref.e63), @i32.as.ImplicitAs.impl [concrete] @@ -211,237 +333,353 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/types/uint, UInt, loaded [concrete = constants.%UInt.generic] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/types/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)] -// CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl.38a [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %cpp_long_long.patt: %pattern_type.95b = value_binding_pattern cpp_long_long [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %i64.loc15: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] -// CHECK:STDOUT: %impl.elem0.loc15: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108] -// CHECK:STDOUT: %bound_method.loc15_41.1: = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.373] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.As.impl.Convert.1(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.83e] -// CHECK:STDOUT: %bound_method.loc15_41.2: = bound_method %int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.c84] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc15: init %i64 = call %bound_method.loc15_41.2(%int_1.loc15) [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc15_41.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc15 [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc15_41.2: %i64 = converted %int_1.loc15, %.loc15_41.1 [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc15_26: type = splice_block %long_long.ref [concrete = constants.%i64] { -// CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: -// CHECK:STDOUT: %long_long.ref: type = name_ref long_long, %i64.1 [concrete = constants.%i64] -// CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_long_long: %i64 = value_binding cpp_long_long, %.loc15_41.2 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %carbon_long_long.patt: %pattern_type.95b = value_binding_pattern carbon_long_long [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_long_long.ref: %i64 = name_ref cpp_long_long, %cpp_long_long -// CHECK:STDOUT: %.loc16: type = splice_block %i64.loc16 [concrete = constants.%i64] { -// CHECK:STDOUT: %int_64.loc16: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %i64.loc16: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] -// CHECK:STDOUT: } -// CHECK:STDOUT: %carbon_long_long: %i64 = value_binding carbon_long_long, %cpp_long_long.ref -// CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_long.patt: %pattern_type.68c = value_binding_pattern cpp_long [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %impl.elem0.loc18_30.1: %.edb = impl_witness_access constants.%As.impl_witness.bf0, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.035] -// CHECK:STDOUT: %bound_method.loc18_30.1: = bound_method %int_1.loc18, %impl.elem0.loc18_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.17b] -// CHECK:STDOUT: %specific_fn.loc18: = specific_function %impl.elem0.loc18_30.1, @Core.IntLiteral.as.As.impl.Convert.1(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.d03] -// CHECK:STDOUT: %bound_method.loc18_30.2: = bound_method %int_1.loc18, %specific_fn.loc18 [concrete = constants.%bound_method.6b2] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc18: init %i32 = call %bound_method.loc18_30.2(%int_1.loc18) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc18_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc18 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc18_30.2: %i32 = converted %int_1.loc18, %.loc18_30.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc18_20: type = splice_block %long.ref [concrete = constants.%Cpp.long] { -// CHECK:STDOUT: %Cpp.ref.loc18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %impl.elem0.loc15_30.1: %.edb = impl_witness_access constants.%As.impl_witness.bf0, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.035] +// CHECK:STDOUT: %bound_method.loc15_30.1: = bound_method %int_1, %impl.elem0.loc15_30.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc15_30.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_30.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc15_30.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_30.2: %i32 = converted %int_1, %.loc15_30.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_20: type = splice_block %long.ref [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %long.ref: type = name_ref long, constants.%Cpp.long [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc18_30.2: %.1bd = impl_witness_access constants.%ImplicitAs.impl_witness.9db, element0 [concrete = constants.%i32.as.ImplicitAs.impl.Convert] -// CHECK:STDOUT: %bound_method.loc18_30.3: = bound_method %.loc18_30.2, %impl.elem0.loc18_30.2 [concrete = constants.%i32.as.ImplicitAs.impl.Convert.bound] -// CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert.call: init %Cpp.long = call %bound_method.loc18_30.3(%.loc18_30.2) [concrete = constants.%int_1.5a4] -// CHECK:STDOUT: %.loc18_30.3: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5a4] -// CHECK:STDOUT: %.loc18_30.4: %Cpp.long = converted %.loc18_30.2, %.loc18_30.3 [concrete = constants.%int_1.5a4] -// CHECK:STDOUT: %cpp_long: %Cpp.long = value_binding cpp_long, %.loc18_30.4 +// CHECK:STDOUT: %impl.elem0.loc15_30.2: %.1bd = impl_witness_access constants.%ImplicitAs.impl_witness.9db, element0 [concrete = constants.%i32.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc15_30.3: = bound_method %.loc15_30.2, %impl.elem0.loc15_30.2 [concrete = constants.%i32.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert.call: init %Cpp.long = call %bound_method.loc15_30.3(%.loc15_30.2) [concrete = constants.%int_1.5a4] +// CHECK:STDOUT: %.loc15_30.3: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5a4] +// CHECK:STDOUT: %.loc15_30.4: %Cpp.long = converted %.loc15_30.2, %.loc15_30.3 [concrete = constants.%int_1.5a4] +// CHECK:STDOUT: %cpp_long: %Cpp.long = value_binding cpp_long, %.loc15_30.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_long_result.patt: %pattern_type.cd9 = value_binding_pattern cpp_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc19_41: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %PassLong.ref.loc19: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] -// CHECK:STDOUT: %cpp_long.ref.loc19: %Cpp.long = name_ref cpp_long, %cpp_long -// CHECK:STDOUT: %.loc19_62.1: ref %LongResult = temporary_storage -// CHECK:STDOUT: %addr.loc19: %ptr.305 = addr_of %.loc19_62.1 -// CHECK:STDOUT: %PassLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_long.ref.loc19, %addr.loc19) -// CHECK:STDOUT: %.loc19_62.2: init %LongResult = in_place_init %PassLong__carbon_thunk.call.loc19, %.loc19_62.1 -// CHECK:STDOUT: %.loc19_27: type = splice_block %LongResult.ref.loc19 [concrete = constants.%LongResult] { -// CHECK:STDOUT: %Cpp.ref.loc19_24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %LongResult.ref.loc19: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] +// CHECK:STDOUT: %Cpp.ref.loc16_41: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassLong.ref.loc16: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_long.ref.loc16: %Cpp.long = name_ref cpp_long, %cpp_long +// CHECK:STDOUT: %.loc16_62.1: ref %LongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.305 = addr_of %.loc16_62.1 +// CHECK:STDOUT: %PassLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_long.ref.loc16, %addr.loc16) +// CHECK:STDOUT: %.loc16_62.2: init %LongResult = in_place_init %PassLong__carbon_thunk.call.loc16, %.loc16_62.1 +// CHECK:STDOUT: %.loc16_27: type = splice_block %LongResult.ref.loc16 [concrete = constants.%LongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %LongResult.ref.loc16: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_62.3: ref %LongResult = temporary %.loc19_62.1, %.loc19_62.2 -// CHECK:STDOUT: %.loc19_62.4: %LongResult = acquire_value %.loc19_62.3 -// CHECK:STDOUT: %cpp_long_result: %LongResult = value_binding cpp_long_result, %.loc19_62.4 +// CHECK:STDOUT: %.loc16_62.3: ref %LongResult = temporary %.loc16_62.1, %.loc16_62.2 +// CHECK:STDOUT: %.loc16_62.4: %LongResult = acquire_value %.loc16_62.3 +// CHECK:STDOUT: %cpp_long_result: %LongResult = value_binding cpp_long_result, %.loc16_62.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_compat_long.patt: %pattern_type.68c = value_binding_pattern cpp_compat_long [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_long.ref.loc21: %Cpp.long = name_ref cpp_long, %cpp_long -// CHECK:STDOUT: %.loc21: type = splice_block %Long32.ref [concrete = constants.%Cpp.long] { +// CHECK:STDOUT: %cpp_long.ref.loc18: %Cpp.long = name_ref cpp_long, %cpp_long +// CHECK:STDOUT: %.loc18: type = splice_block %Long32.ref [concrete = constants.%Cpp.long] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %CppCompat.ref: = name_ref CppCompat, imports.%CppCompat.c59 [concrete = imports.%CppCompat.c59] // CHECK:STDOUT: %Long32.ref: type = name_ref Long32, imports.%Core.Long32 [concrete = constants.%Cpp.long] // CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_compat_long: %Cpp.long = value_binding cpp_compat_long, %cpp_long.ref.loc21 +// CHECK:STDOUT: %cpp_compat_long: %Cpp.long = value_binding cpp_compat_long, %cpp_long.ref.loc18 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %cpp_compat_long_long_result.patt: %pattern_type.cd9 = value_binding_pattern cpp_compat_long_long_result [concrete] +// CHECK:STDOUT: %cpp_compat_long_result.patt: %pattern_type.cd9 = value_binding_pattern cpp_compat_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc22_53: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %PassLong.ref.loc22: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] -// CHECK:STDOUT: %cpp_long.ref.loc22: %Cpp.long = name_ref cpp_long, %cpp_long -// CHECK:STDOUT: %.loc22_74.1: ref %LongResult = temporary_storage -// CHECK:STDOUT: %addr.loc22: %ptr.305 = addr_of %.loc22_74.1 -// CHECK:STDOUT: %PassLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_long.ref.loc22, %addr.loc22) -// CHECK:STDOUT: %.loc22_74.2: init %LongResult = in_place_init %PassLong__carbon_thunk.call.loc22, %.loc22_74.1 -// CHECK:STDOUT: %.loc22_39: type = splice_block %LongResult.ref.loc22 [concrete = constants.%LongResult] { -// CHECK:STDOUT: %Cpp.ref.loc22_36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %LongResult.ref.loc22: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_74.3: ref %LongResult = temporary %.loc22_74.1, %.loc22_74.2 -// CHECK:STDOUT: %.loc22_74.4: %LongResult = acquire_value %.loc22_74.3 -// CHECK:STDOUT: %cpp_compat_long_long_result: %LongResult = value_binding cpp_compat_long_long_result, %.loc22_74.4 +// CHECK:STDOUT: %Cpp.ref.loc19_48: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassLong.ref.loc19: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_compat_long.ref: %Cpp.long = name_ref cpp_compat_long, %cpp_compat_long +// CHECK:STDOUT: %.loc19_76.1: ref %LongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.305 = addr_of %.loc19_76.1 +// CHECK:STDOUT: %PassLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_compat_long.ref, %addr.loc19) +// CHECK:STDOUT: %.loc19_76.2: init %LongResult = in_place_init %PassLong__carbon_thunk.call.loc19, %.loc19_76.1 +// CHECK:STDOUT: %.loc19_34: type = splice_block %LongResult.ref.loc19 [concrete = constants.%LongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %LongResult.ref.loc19: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19_76.3: ref %LongResult = temporary %.loc19_76.1, %.loc19_76.2 +// CHECK:STDOUT: %.loc19_76.4: %LongResult = acquire_value %.loc19_76.3 +// CHECK:STDOUT: %cpp_compat_long_result: %LongResult = value_binding cpp_compat_long_result, %.loc19_76.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_i32.patt: %pattern_type.7ce = value_binding_pattern carbon_i32 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_long.ref.loc24: %Cpp.long = name_ref cpp_long, %cpp_long -// CHECK:STDOUT: %.loc24_19: type = splice_block %i32.loc24 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc24: %.261 = impl_witness_access constants.%ImplicitAs.impl_witness.c39, element0 [concrete = constants.%Cpp.long.as.ImplicitAs.impl.Convert] -// CHECK:STDOUT: %bound_method.loc24: = bound_method %cpp_long.ref.loc24, %impl.elem0.loc24 -// CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc24(%cpp_long.ref.loc24) -// CHECK:STDOUT: %.loc24_25.1: %i32 = value_of_initializer %Cpp.long.as.ImplicitAs.impl.Convert.call -// CHECK:STDOUT: %.loc24_25.2: %i32 = converted %cpp_long.ref.loc24, %.loc24_25.1 -// CHECK:STDOUT: %carbon_i32: %i32 = value_binding carbon_i32, %.loc24_25.2 +// CHECK:STDOUT: %cpp_long.ref.loc21: %Cpp.long = name_ref cpp_long, %cpp_long +// CHECK:STDOUT: %.loc21_19: type = splice_block %i32.loc21 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc21: %.261 = impl_witness_access constants.%ImplicitAs.impl_witness.c39, element0 [concrete = constants.%Cpp.long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc21: = bound_method %cpp_long.ref.loc21, %impl.elem0.loc21 +// CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc21(%cpp_long.ref.loc21) +// CHECK:STDOUT: %.loc21_25.1: %i32 = value_of_initializer %Cpp.long.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc21_25.2: %i32 = converted %cpp_long.ref.loc21, %.loc21_25.1 +// CHECK:STDOUT: %carbon_i32: %i32 = value_binding carbon_i32, %.loc21_25.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_i32_result.patt: %pattern_type.454 = value_binding_pattern carbon_i32_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %Cpp.ref.loc25_42: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: %PassLong.ref.loc25: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] +// CHECK:STDOUT: %Cpp.ref.loc22_42: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassLong.ref.loc22: %PassLong.cpp_overload_set.type = name_ref PassLong, imports.%PassLong.cpp_overload_set.value [concrete = constants.%PassLong.cpp_overload_set.value] // CHECK:STDOUT: %carbon_i32.ref: %i32 = name_ref carbon_i32, %carbon_i32 -// CHECK:STDOUT: %.loc25_65.1: ref %IntResult = temporary_storage -// CHECK:STDOUT: %addr.loc25: %ptr.3cb = addr_of %.loc25_65.1 -// CHECK:STDOUT: %PassLong__carbon_thunk.call.loc25: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.2(%carbon_i32.ref, %addr.loc25) -// CHECK:STDOUT: %.loc25_65.2: init %IntResult = in_place_init %PassLong__carbon_thunk.call.loc25, %.loc25_65.1 -// CHECK:STDOUT: %.loc25_29: type = splice_block %IntResult.ref [concrete = constants.%IntResult] { -// CHECK:STDOUT: %Cpp.ref.loc25_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %.loc22_65.1: ref %IntResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.3cb = addr_of %.loc22_65.1 +// CHECK:STDOUT: %PassLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.2(%carbon_i32.ref, %addr.loc22) +// CHECK:STDOUT: %.loc22_65.2: init %IntResult = in_place_init %PassLong__carbon_thunk.call.loc22, %.loc22_65.1 +// CHECK:STDOUT: %.loc22_29: type = splice_block %IntResult.ref [concrete = constants.%IntResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %IntResult.ref: type = name_ref IntResult, imports.%IntResult.decl [concrete = constants.%IntResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc25_65.3: ref %IntResult = temporary %.loc25_65.1, %.loc25_65.2 -// CHECK:STDOUT: %.loc25_65.4: %IntResult = acquire_value %.loc25_65.3 -// CHECK:STDOUT: %carbon_i32_result: %IntResult = value_binding carbon_i32_result, %.loc25_65.4 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %cpp_unsigned_long_long.patt: %pattern_type.157 = value_binding_pattern cpp_unsigned_long_long [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_64.loc27: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc27: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] -// CHECK:STDOUT: %impl.elem0.loc27: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09] -// CHECK:STDOUT: %bound_method.loc27_59.1: = bound_method %int_1.loc27, %impl.elem0.loc27 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.eb8] -// CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Core.IntLiteral.as.As.impl.Convert.2(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.009] -// CHECK:STDOUT: %bound_method.loc27_59.2: = bound_method %int_1.loc27, %specific_fn.loc27 [concrete = constants.%bound_method.bb9] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc27: init %u64 = call %bound_method.loc27_59.2(%int_1.loc27) [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc27_59.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc27 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc27_59.2: %u64 = converted %int_1.loc27, %.loc27_59.1 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc27_35: type = splice_block %unsigned_long_long.ref [concrete = constants.%u64] { -// CHECK:STDOUT: %Cpp.ref.loc27: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] -// CHECK:STDOUT: -// CHECK:STDOUT: %unsigned_long_long.ref: type = name_ref unsigned_long_long, %u64.1 [concrete = constants.%u64] -// CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_unsigned_long_long: %u64 = value_binding cpp_unsigned_long_long, %.loc27_59.2 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %carbon_unsigned_long_long.patt: %pattern_type.157 = value_binding_pattern carbon_unsigned_long_long [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_unsigned_long_long.ref: %u64 = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long -// CHECK:STDOUT: %.loc28: type = splice_block %u64.loc28 [concrete = constants.%u64] { -// CHECK:STDOUT: %int_64.loc28: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc28: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] -// CHECK:STDOUT: } -// CHECK:STDOUT: %carbon_unsigned_long_long: %u64 = value_binding carbon_unsigned_long_long, %cpp_unsigned_long_long.ref -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc25: = bound_method %.loc25_65.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.515 +// CHECK:STDOUT: %.loc22_65.3: ref %IntResult = temporary %.loc22_65.1, %.loc22_65.2 +// CHECK:STDOUT: %.loc22_65.4: %IntResult = acquire_value %.loc22_65.3 +// CHECK:STDOUT: %carbon_i32_result: %IntResult = value_binding carbon_i32_result, %.loc22_65.4 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc22: = bound_method %.loc22_65.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.515 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc25: = bound_method %.loc25_65.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25(%.loc25_65.3) -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc22: = bound_method %.loc22_74.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.418 +// CHECK:STDOUT: %bound_method.loc22: = bound_method %.loc22_65.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22(%.loc22_65.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc19: = bound_method %.loc19_76.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.418 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc22: = bound_method %.loc22_74.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22(%.loc22_74.3) -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc19: = bound_method %.loc19_62.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.418 +// CHECK:STDOUT: %bound_method.loc19: = bound_method %.loc19_76.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%.loc19_76.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc16: = bound_method %.loc16_62.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.418 // CHECK:STDOUT: -// CHECK:STDOUT: %bound_method.loc19: = bound_method %.loc19_62.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 -// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%.loc19_62.3) +// CHECK:STDOUT: %bound_method.loc16: = bound_method %.loc16_62.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%.loc16_62.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_todo_unsupported_types.carbon +// CHECK:STDOUT: --- unsigned_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Cpp.unsigned_long: type = class_type @ULong32 [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] +// CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.5b7: type = pattern_type %Cpp.unsigned_long [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete] -// CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete] -// CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete] +// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] +// CHECK:STDOUT: %As.type.45b: type = facet_type <@As, @As(%u32)> [concrete] +// CHECK:STDOUT: %As.Convert.type.b94: type = fn_type @As.Convert, @As(%u32) [concrete] // CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic] -// CHECK:STDOUT: %As.impl_witness.ed2d: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete] -// CHECK:STDOUT: %As.facet: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2d) [concrete] -// CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete] -// CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete] +// CHECK:STDOUT: %As.impl_witness.9c6: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.81c: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.3f9: %Core.IntLiteral.as.As.impl.Convert.type.81c = struct_value () [concrete] +// CHECK:STDOUT: %As.facet: %As.type.45b = facet_value Core.IntLiteral, (%As.impl_witness.9c6) [concrete] +// CHECK:STDOUT: %.053: type = fn_type_with_self_type %As.Convert.type.b94, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.3f9 [concrete] +// CHECK:STDOUT: %pattern_type.4a9: type = pattern_type %u32 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.3f9, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete] +// CHECK:STDOUT: %int_1.c1d: %u32 = int_value 1 [concrete] +// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.b0a: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.unsigned_long)> [concrete] +// CHECK:STDOUT: %ImplicitAs.Convert.type.691: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%Cpp.unsigned_long) [concrete] +// CHECK:STDOUT: %ImplicitAs.type.9e2: type = facet_type <@ImplicitAs, @ImplicitAs(%u32)> [concrete] +// CHECK:STDOUT: %ImplicitAs.Convert.type.92a: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%u32) [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.42f: = impl_witness imports.%ImplicitAs.impl_witness_table.9ef [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.144: %ImplicitAs.type.b0a = facet_value %u32, (%ImplicitAs.impl_witness.42f) [concrete] +// CHECK:STDOUT: %.b05: type = fn_type_with_self_type %ImplicitAs.Convert.type.691, %ImplicitAs.facet.144 [concrete] +// CHECK:STDOUT: %u32.as.ImplicitAs.impl.Convert.type: type = fn_type @u32.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %u32.as.ImplicitAs.impl.Convert: %u32.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %u32.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.c1d, %u32.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %int_1.0ab: %Cpp.unsigned_long = int_value 1 [concrete] +// CHECK:STDOUT: %ULongResult: type = class_type @ULongResult [concrete] +// CHECK:STDOUT: %pattern_type.6f2: type = pattern_type %ULongResult [concrete] +// CHECK:STDOUT: %PassULong.cpp_overload_set.type: type = cpp_overload_set_type @PassULong.cpp_overload_set [concrete] +// CHECK:STDOUT: %PassULong.cpp_overload_set.value: %PassULong.cpp_overload_set.type = cpp_overload_set_value @PassULong.cpp_overload_set [concrete] +// CHECK:STDOUT: %ptr.f5e: type = ptr_type %ULongResult [concrete] +// CHECK:STDOUT: %PassULong__carbon_thunk.type.3fc2d8.1: type = fn_type @PassULong__carbon_thunk.1 [concrete] +// CHECK:STDOUT: %PassULong__carbon_thunk.ff747d.1: %PassULong__carbon_thunk.type.3fc2d8.1 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.c73: = impl_witness imports.%ImplicitAs.impl_witness_table.5ff [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.1b5: %ImplicitAs.type.9e2 = facet_value %Cpp.unsigned_long, (%ImplicitAs.impl_witness.c73) [concrete] +// CHECK:STDOUT: %.a17: type = fn_type_with_self_type %ImplicitAs.Convert.type.92a, %ImplicitAs.facet.1b5 [concrete] +// CHECK:STDOUT: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.type: type = fn_type @Cpp.unsigned_long.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %UIntResult: type = class_type @UIntResult [concrete] +// CHECK:STDOUT: %pattern_type.dc7: type = pattern_type %UIntResult [concrete] +// CHECK:STDOUT: %ptr.059: type = ptr_type %UIntResult [concrete] +// CHECK:STDOUT: %PassULong__carbon_thunk.type.3fc2d8.2: type = fn_type @PassULong__carbon_thunk.2 [concrete] +// CHECK:STDOUT: %PassULong__carbon_thunk.ff747d.2: %PassULong__carbon_thunk.type.3fc2d8.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %facet_value.dd4: %type_where = facet_value %UIntResult, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f16: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.dd4) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.0d5: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.f16 = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.4ba: %type_where = facet_value %ULongResult, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.429: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.4ba) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.735: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.429 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .CppCompat = %CppCompat.c59 +// CHECK:STDOUT: .UInt = %Core.UInt +// CHECK:STDOUT: .As = %Core.As +// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .unsigned_long = constants.%Cpp.unsigned_long +// CHECK:STDOUT: .ULongResult = %ULongResult.decl +// CHECK:STDOUT: .PassULong = %PassULong.cpp_overload_set.value +// CHECK:STDOUT: .UIntResult = %UIntResult.decl +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.CppCompat: = import_ref Core//prelude, CppCompat, loaded +// CHECK:STDOUT: %CppCompat.c59: = namespace %Core.CppCompat, [concrete] { +// CHECK:STDOUT: .ULong32 = %Core.ULong32 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.ULong32: type = import_ref Core//prelude/types/cpp/int, ULong32, loaded [concrete = constants.%Cpp.unsigned_long] +// CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/types/uint, UInt, loaded [concrete = constants.%UInt.generic] +// CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] // CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/types/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)] // CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.import_ref.b5b: %u32.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/cpp/int, loc{{\d+_\d+}}, loaded [concrete = constants.%u32.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.9ef = impl_witness_table (%Core.import_ref.b5b), @u32.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ULongResult.decl: type = class_decl @ULongResult [concrete = constants.%ULongResult] {} {} +// CHECK:STDOUT: %PassULong.cpp_overload_set.value: %PassULong.cpp_overload_set.type = cpp_overload_set_value @PassULong.cpp_overload_set [concrete = constants.%PassULong.cpp_overload_set.value] +// CHECK:STDOUT: %PassULong__carbon_thunk.decl.108234.1: %PassULong__carbon_thunk.type.3fc2d8.1 = fn_decl @PassULong__carbon_thunk.1 [concrete = constants.%PassULong__carbon_thunk.ff747d.1] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.fa0: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/cpp/int, loc{{\d+_\d+}}, loaded [concrete = constants.%Cpp.unsigned_long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.5ff = impl_witness_table (%Core.import_ref.fa0), @Cpp.unsigned_long.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %UIntResult.decl: type = class_decl @UIntResult [concrete = constants.%UIntResult] {} {} +// CHECK:STDOUT: %PassULong__carbon_thunk.decl.108234.2: %PassULong__carbon_thunk.type.3fc2d8.2 = fn_decl @PassULong__carbon_thunk.2 [concrete = constants.%PassULong__carbon_thunk.ff747d.2] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %cpp_unsigned_long.patt: = value_binding_pattern cpp_unsigned_long [concrete] +// CHECK:STDOUT: %cpp_unsigned_long.patt: %pattern_type.5b7 = value_binding_pattern cpp_unsigned_long [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc15: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] -// CHECK:STDOUT: %impl.elem0: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09] -// CHECK:STDOUT: %bound_method.loc15_49.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc15_49.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc15_49.2(%int_1) [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc15_49.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc15_49.2: %u64 = converted %int_1, %.loc15_49.1 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: -// CHECK:STDOUT: %cpp_unsigned_long: = value_binding cpp_unsigned_long, [concrete = ] +// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %u32.loc15: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] +// CHECK:STDOUT: %impl.elem0.loc15_48.1: %.053 = impl_witness_access constants.%As.impl_witness.9c6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.3f9] +// CHECK:STDOUT: %bound_method.loc15_48.1: = bound_method %int_1, %impl.elem0.loc15_48.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc15_48.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_48.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u32 = call %bound_method.loc15_48.2(%int_1) [concrete = constants.%int_1.c1d] +// CHECK:STDOUT: %.loc15_48.1: %u32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.c1d] +// CHECK:STDOUT: %.loc15_48.2: %u32 = converted %int_1, %.loc15_48.1 [concrete = constants.%int_1.c1d] +// CHECK:STDOUT: %.loc15_29: type = splice_block %unsigned_long.ref [concrete = constants.%Cpp.unsigned_long] { +// CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %unsigned_long.ref: type = name_ref unsigned_long, constants.%Cpp.unsigned_long [concrete = constants.%Cpp.unsigned_long] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc15_48.2: %.b05 = impl_witness_access constants.%ImplicitAs.impl_witness.42f, element0 [concrete = constants.%u32.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc15_48.3: = bound_method %.loc15_48.2, %impl.elem0.loc15_48.2 [concrete = constants.%u32.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %u32.as.ImplicitAs.impl.Convert.call: init %Cpp.unsigned_long = call %bound_method.loc15_48.3(%.loc15_48.2) [concrete = constants.%int_1.0ab] +// CHECK:STDOUT: %.loc15_48.3: %Cpp.unsigned_long = value_of_initializer %u32.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.0ab] +// CHECK:STDOUT: %.loc15_48.4: %Cpp.unsigned_long = converted %.loc15_48.2, %.loc15_48.3 [concrete = constants.%int_1.0ab] +// CHECK:STDOUT: %cpp_unsigned_long: %Cpp.unsigned_long = value_binding cpp_unsigned_long, %.loc15_48.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_unsigned_long_result.patt: %pattern_type.6f2 = value_binding_pattern cpp_unsigned_long_result [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp.ref.loc16_51: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassULong.ref.loc16: %PassULong.cpp_overload_set.type = name_ref PassULong, imports.%PassULong.cpp_overload_set.value [concrete = constants.%PassULong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_unsigned_long.ref.loc16: %Cpp.unsigned_long = name_ref cpp_unsigned_long, %cpp_unsigned_long +// CHECK:STDOUT: %.loc16_82.1: ref %ULongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.f5e = addr_of %.loc16_82.1 +// CHECK:STDOUT: %PassULong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.1(%cpp_unsigned_long.ref.loc16, %addr.loc16) +// CHECK:STDOUT: %.loc16_82.2: init %ULongResult = in_place_init %PassULong__carbon_thunk.call.loc16, %.loc16_82.1 +// CHECK:STDOUT: %.loc16_36: type = splice_block %ULongResult.ref.loc16 [concrete = constants.%ULongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ULongResult.ref.loc16: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc16_82.3: ref %ULongResult = temporary %.loc16_82.1, %.loc16_82.2 +// CHECK:STDOUT: %.loc16_82.4: %ULongResult = acquire_value %.loc16_82.3 +// CHECK:STDOUT: %cpp_unsigned_long_result: %ULongResult = value_binding cpp_unsigned_long_result, %.loc16_82.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_compat_ulong.patt: %pattern_type.5b7 = value_binding_pattern cpp_compat_ulong [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_unsigned_long.ref.loc18: %Cpp.unsigned_long = name_ref cpp_unsigned_long, %cpp_unsigned_long +// CHECK:STDOUT: %.loc18: type = splice_block %ULong32.ref [concrete = constants.%Cpp.unsigned_long] { +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %CppCompat.ref: = name_ref CppCompat, imports.%CppCompat.c59 [concrete = imports.%CppCompat.c59] +// CHECK:STDOUT: %ULong32.ref: type = name_ref ULong32, imports.%Core.ULong32 [concrete = constants.%Cpp.unsigned_long] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_compat_ulong: %Cpp.unsigned_long = value_binding cpp_compat_ulong, %cpp_unsigned_long.ref.loc18 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_compat_ulong_result.patt: %pattern_type.6f2 = value_binding_pattern cpp_compat_ulong_result [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp.ref.loc19_50: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassULong.ref.loc19: %PassULong.cpp_overload_set.type = name_ref PassULong, imports.%PassULong.cpp_overload_set.value [concrete = constants.%PassULong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_compat_ulong.ref: %Cpp.unsigned_long = name_ref cpp_compat_ulong, %cpp_compat_ulong +// CHECK:STDOUT: %.loc19_80.1: ref %ULongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.f5e = addr_of %.loc19_80.1 +// CHECK:STDOUT: %PassULong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.1(%cpp_compat_ulong.ref, %addr.loc19) +// CHECK:STDOUT: %.loc19_80.2: init %ULongResult = in_place_init %PassULong__carbon_thunk.call.loc19, %.loc19_80.1 +// CHECK:STDOUT: %.loc19_35: type = splice_block %ULongResult.ref.loc19 [concrete = constants.%ULongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ULongResult.ref.loc19: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19_80.3: ref %ULongResult = temporary %.loc19_80.1, %.loc19_80.2 +// CHECK:STDOUT: %.loc19_80.4: %ULongResult = acquire_value %.loc19_80.3 +// CHECK:STDOUT: %cpp_compat_ulong_result: %ULongResult = value_binding cpp_compat_ulong_result, %.loc19_80.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %carbon_u32.patt: %pattern_type.4a9 = value_binding_pattern carbon_u32 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_unsigned_long.ref.loc21: %Cpp.unsigned_long = name_ref cpp_unsigned_long, %cpp_unsigned_long +// CHECK:STDOUT: %.loc21_19: type = splice_block %u32.loc21 [concrete = constants.%u32] { +// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %u32.loc21: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc21: %.a17 = impl_witness_access constants.%ImplicitAs.impl_witness.c73, element0 [concrete = constants.%Cpp.unsigned_long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc21: = bound_method %cpp_unsigned_long.ref.loc21, %impl.elem0.loc21 +// CHECK:STDOUT: %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.call: init %u32 = call %bound_method.loc21(%cpp_unsigned_long.ref.loc21) +// CHECK:STDOUT: %.loc21_25.1: %u32 = value_of_initializer %Cpp.unsigned_long.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc21_25.2: %u32 = converted %cpp_unsigned_long.ref.loc21, %.loc21_25.1 +// CHECK:STDOUT: %carbon_u32: %u32 = value_binding carbon_u32, %.loc21_25.2 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %carbon_unsigned_long.patt: %pattern_type.157 = value_binding_pattern carbon_unsigned_long [concrete] +// CHECK:STDOUT: %carbon_u32_result.patt: %pattern_type.dc7 = value_binding_pattern carbon_u32_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_unsigned_long.ref: = name_ref cpp_unsigned_long, %cpp_unsigned_long [concrete = ] -// CHECK:STDOUT: %.loc16: type = splice_block %u64.loc16 [concrete = constants.%u64] { -// CHECK:STDOUT: %int_64.loc16: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc16: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: %Cpp.ref.loc22_43: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassULong.ref.loc22: %PassULong.cpp_overload_set.type = name_ref PassULong, imports.%PassULong.cpp_overload_set.value [concrete = constants.%PassULong.cpp_overload_set.value] +// CHECK:STDOUT: %carbon_u32.ref: %u32 = name_ref carbon_u32, %carbon_u32 +// CHECK:STDOUT: %.loc22_67.1: ref %UIntResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.059 = addr_of %.loc22_67.1 +// CHECK:STDOUT: %PassULong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.2(%carbon_u32.ref, %addr.loc22) +// CHECK:STDOUT: %.loc22_67.2: init %UIntResult = in_place_init %PassULong__carbon_thunk.call.loc22, %.loc22_67.1 +// CHECK:STDOUT: %.loc22_29: type = splice_block %UIntResult.ref [concrete = constants.%UIntResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %UIntResult.ref: type = name_ref UIntResult, imports.%UIntResult.decl [concrete = constants.%UIntResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %carbon_unsigned_long: %u64 = value_binding carbon_unsigned_long, [concrete = ] +// CHECK:STDOUT: %.loc22_67.3: ref %UIntResult = temporary %.loc22_67.1, %.loc22_67.2 +// CHECK:STDOUT: %.loc22_67.4: %UIntResult = acquire_value %.loc22_67.3 +// CHECK:STDOUT: %carbon_u32_result: %UIntResult = value_binding carbon_u32_result, %.loc22_67.4 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc22: = bound_method %.loc22_67.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.0d5 +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc22: = bound_method %.loc22_67.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22(%.loc22_67.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc19: = bound_method %.loc19_80.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.735 +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc19: = bound_method %.loc19_80.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%.loc19_80.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc16: = bound_method %.loc16_82.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.735 +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc16: = bound_method %.loc16_82.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%.loc16_82.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon index 2fc414dc0b625..529f87f1e5017 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon @@ -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/uint.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon // EXTRA-ARGS: --target=x86_64-linux-gnu // // AUTOUPDATE @@ -11,7 +11,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/builtins.lp64.carbon -// --- supported_types.carbon +// --- long.carbon library "[[@TEST_NAME]]"; @@ -21,43 +21,75 @@ fn F() { //@dump-sem-ir-begin let cpp_long : Cpp.long = 1 as i64; let carbon_long: i64 = cpp_long; + //@dump-sem-ir-end +} + +// --- unsigned_long.carbon + +library "[[@TEST_NAME]]"; +import Cpp; + +fn F() { + //@dump-sem-ir-begin let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64; let carbon_unsigned_long: u64 = cpp_unsigned_long; //@dump-sem-ir-end } -// --- fail_todo_unsupported_types.carbon +// --- long_long.carbon library "[[@TEST_NAME]]"; -import Cpp; +import Cpp inline +''' +class LongLongResult {}; +auto PassLongLong(long long x) -> LongLongResult; + +class LongResult {}; +auto PassLongLong(long x) -> LongResult; +'''; + +fn F() { + //@dump-sem-ir-begin + let cpp_long_long: Cpp.long_long = 1 as i64; + let cpp_long_long_result: Cpp.LongLongResult = Cpp.PassLongLong(cpp_long_long); + + let cpp_compat_long_long: Core.CppCompat.LongLong64 = cpp_long_long; + let cpp_compat_long_long_result: Cpp.LongLongResult = Cpp.PassLongLong(cpp_compat_long_long); + + let carbon_i64: i64 = cpp_long_long; + let carbon_i64_result: Cpp.LongResult = Cpp.PassLongLong(carbon_i64); + //@dump-sem-ir-end +} + +// --- unsigned_long_long.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline +''' +class ULongLongResult {}; +auto PassULongLong(unsigned long long x) -> ULongLongResult; + +class ULongResult {}; +auto PassULongLong(unsigned long x) -> ULongResult; +'''; fn F() { //@dump-sem-ir-begin - // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:23: error: semantics TODO: `Unsupported: builtin type: long long` [SemanticsTodo] - // CHECK:STDERR: let cpp_long_long : Cpp.long_long = 1 as i64; - // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:23: note: in `Cpp` name lookup for `long_long` [InCppNameLookup] - // CHECK:STDERR: let cpp_long_long : Cpp.long_long = 1 as i64; - // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: - let cpp_long_long : Cpp.long_long = 1 as i64; - let carbon_long_long: i64 = cpp_long_long; + let cpp_unsigned_long_long: Cpp.unsigned_long_long = 1 as u64; + let cpp_unsigned_long_long_result: Cpp.ULongLongResult = Cpp.PassULongLong(cpp_unsigned_long_long); + + let cpp_compat_ulong_long: Core.CppCompat.ULongLong64 = cpp_unsigned_long_long; + let cpp_compat_ulong_long_result: Cpp.ULongLongResult = Cpp.PassULongLong(cpp_compat_ulong_long); - // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:32: error: semantics TODO: `Unsupported: builtin type: unsigned long long` [SemanticsTodo] - // CHECK:STDERR: let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:32: note: in `Cpp` name lookup for `unsigned_long_long` [InCppNameLookup] - // CHECK:STDERR: let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: - let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64; - let carbon_unsigned_long_long: u64 = cpp_unsigned_long_long; + let carbon_u64: u64 = cpp_unsigned_long_long; + let carbon_u64_result: Cpp.ULongResult = Cpp.PassULongLong(carbon_u64); //@dump-sem-ir-end } -// CHECK:STDOUT: --- supported_types.carbon +// CHECK:STDOUT: --- long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] @@ -66,45 +98,27 @@ fn F() { // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %As.type.bbb: type = facet_type <@As, @As(%i64)> [concrete] // CHECK:STDOUT: %As.Convert.type.d57: type = fn_type @As.Convert, @As(%i64) [concrete] -// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%To) [symbolic] +// CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.2b1: %Core.IntLiteral.as.As.impl.Convert.type.0fd = struct_value () [symbolic] -// CHECK:STDOUT: %As.impl_witness.c40: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete] +// CHECK:STDOUT: %As.impl_witness.c40: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.108: %Core.IntLiteral.as.As.impl.Convert.type.4f0 = struct_value () [concrete] -// CHECK:STDOUT: %As.facet.2cd: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete] -// CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet.2cd [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.373: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e: = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert.1(%int_64) [concrete] -// CHECK:STDOUT: %bound_method.c84: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e [concrete] +// CHECK:STDOUT: %As.facet: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete] +// CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.41a: %i64 = int_value 1 [concrete] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete] -// CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete] -// CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete] -// CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%To) [symbolic] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic] -// CHECK:STDOUT: %As.impl_witness.ed2: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete] -// CHECK:STDOUT: %As.facet.bf5: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2) [concrete] -// CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet.bf5 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.eb8: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.009: = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert.2(%int_64) [concrete] -// CHECK:STDOUT: %bound_method.bb9: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.009 [concrete] -// CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { // CHECK:STDOUT: .long = @F.%i64.1 -// CHECK:STDOUT: .unsigned_long = @F.%u64.1 // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)] -// CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl.863 [concrete] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/parts/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)] -// CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl.38a [concrete] +// CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)] +// CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -112,18 +126,18 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_long.patt: %pattern_type.95b = value_binding_pattern cpp_long [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %i64.loc8: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] -// CHECK:STDOUT: %impl.elem0.loc8: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108] -// CHECK:STDOUT: %bound_method.loc8_31.1: = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.373] -// CHECK:STDOUT: %specific_fn.loc8: = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.As.impl.Convert.1(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.83e] -// CHECK:STDOUT: %bound_method.loc8_31.2: = bound_method %int_1.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.c84] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc8: init %i64 = call %bound_method.loc8_31.2(%int_1.loc8) [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc8_31.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc8 [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc8_31.2: %i64 = converted %int_1.loc8, %.loc8_31.1 [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %impl.elem0: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108] +// CHECK:STDOUT: %bound_method.loc8_31.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_31.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc8_31.2(%int_1) [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc8_31.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc8_31.2: %i64 = converted %int_1, %.loc8_31.1 [concrete = constants.%int_1.41a] // CHECK:STDOUT: %.loc8_21: type = splice_block %long.ref [concrete = constants.%i64] { -// CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: // CHECK:STDOUT: %long.ref: type = name_ref long, %i64.1 [concrete = constants.%i64] // CHECK:STDOUT: } @@ -137,132 +151,535 @@ fn F() { // CHECK:STDOUT: %i64.loc9: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] // CHECK:STDOUT: } // CHECK:STDOUT: %carbon_long: %i64 = value_binding carbon_long, %cpp_long.ref +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- unsigned_long.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete] +// CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete] +// CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic] +// CHECK:STDOUT: %As.impl_witness.ed2d: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete] +// CHECK:STDOUT: %As.facet: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2d) [concrete] +// CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .unsigned_long = @F.%u64.1 +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/types/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)] +// CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() { +// CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %cpp_unsigned_long.patt: %pattern_type.157 = value_binding_pattern cpp_unsigned_long [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_64.loc11: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc11: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] -// CHECK:STDOUT: %impl.elem0.loc11: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09] -// CHECK:STDOUT: %bound_method.loc11_49.1: = bound_method %int_1.loc11, %impl.elem0.loc11 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.eb8] -// CHECK:STDOUT: %specific_fn.loc11: = specific_function %impl.elem0.loc11, @Core.IntLiteral.as.As.impl.Convert.2(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.009] -// CHECK:STDOUT: %bound_method.loc11_49.2: = bound_method %int_1.loc11, %specific_fn.loc11 [concrete = constants.%bound_method.bb9] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc11: init %u64 = call %bound_method.loc11_49.2(%int_1.loc11) [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc11_49.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc11 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc11_49.2: %u64 = converted %int_1.loc11, %.loc11_49.1 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc11_30: type = splice_block %unsigned_long.ref [concrete = constants.%u64] { -// CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %u64.loc8: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: %impl.elem0: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09] +// CHECK:STDOUT: %bound_method.loc8_49.1: = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc8_49.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc8_49.2(%int_1) [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc8_49.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc8_49.2: %u64 = converted %int_1, %.loc8_49.1 [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc8_30: type = splice_block %unsigned_long.ref [concrete = constants.%u64] { +// CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: // CHECK:STDOUT: %unsigned_long.ref: type = name_ref unsigned_long, %u64.1 [concrete = constants.%u64] // CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_unsigned_long: %u64 = value_binding cpp_unsigned_long, %.loc11_49.2 +// CHECK:STDOUT: %cpp_unsigned_long: %u64 = value_binding cpp_unsigned_long, %.loc8_49.2 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %carbon_unsigned_long.patt: %pattern_type.157 = value_binding_pattern carbon_unsigned_long [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %cpp_unsigned_long.ref: %u64 = name_ref cpp_unsigned_long, %cpp_unsigned_long -// CHECK:STDOUT: %.loc12: type = splice_block %u64.loc12 [concrete = constants.%u64] { -// CHECK:STDOUT: %int_64.loc12: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc12: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: %.loc9: type = splice_block %u64.loc9 [concrete = constants.%u64] { +// CHECK:STDOUT: %int_64.loc9: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %u64.loc9: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] // CHECK:STDOUT: } // CHECK:STDOUT: %carbon_unsigned_long: %u64 = value_binding carbon_unsigned_long, %cpp_unsigned_long.ref // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_todo_unsupported_types.carbon +// CHECK:STDOUT: --- long_long.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.76e: type = pattern_type %Cpp.long_long [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %As.type.bbb: type = facet_type <@As, @As(%i64)> [concrete] // CHECK:STDOUT: %As.Convert.type.d57: type = fn_type @As.Convert, @As(%i64) [concrete] -// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%To) [symbolic] +// CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.2b1: %Core.IntLiteral.as.As.impl.Convert.type.0fd = struct_value () [symbolic] -// CHECK:STDOUT: %As.impl_witness.c40: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete] +// CHECK:STDOUT: %As.impl_witness.c40: = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.108: %Core.IntLiteral.as.As.impl.Convert.type.4f0 = struct_value () [concrete] -// CHECK:STDOUT: %As.facet.2cd: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete] -// CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet.2cd [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.373: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete] +// CHECK:STDOUT: %As.facet: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete] +// CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete] // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %i64 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e: = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert.1(%int_64) [concrete] -// CHECK:STDOUT: %bound_method.c84: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.41a: %i64 = int_value 1 [concrete] +// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.f6b: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.long_long)> [concrete] +// CHECK:STDOUT: %ImplicitAs.Convert.type.6e4: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%Cpp.long_long) [concrete] +// CHECK:STDOUT: %ImplicitAs.type.e50: type = facet_type <@ImplicitAs, @ImplicitAs(%i64)> [concrete] +// CHECK:STDOUT: %ImplicitAs.Convert.type.94e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i64) [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.19c: = impl_witness imports.%ImplicitAs.impl_witness_table.fe6 [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.a6c: %ImplicitAs.type.f6b = facet_value %i64, (%ImplicitAs.impl_witness.19c) [concrete] +// CHECK:STDOUT: %.6d5: type = fn_type_with_self_type %ImplicitAs.Convert.type.6e4, %ImplicitAs.facet.a6c [concrete] +// CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert.type: type = fn_type @i64.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert: %i64.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.41a, %i64.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %int_1.092: %Cpp.long_long = int_value 1 [concrete] +// CHECK:STDOUT: %LongLongResult: type = class_type @LongLongResult [concrete] +// CHECK:STDOUT: %pattern_type.257: type = pattern_type %LongLongResult [concrete] +// CHECK:STDOUT: %PassLongLong.cpp_overload_set.type: type = cpp_overload_set_type @PassLongLong.cpp_overload_set [concrete] +// CHECK:STDOUT: %PassLongLong.cpp_overload_set.value: %PassLongLong.cpp_overload_set.type = cpp_overload_set_value @PassLongLong.cpp_overload_set [concrete] +// CHECK:STDOUT: %ptr.a95: type = ptr_type %LongLongResult [concrete] +// CHECK:STDOUT: %PassLongLong__carbon_thunk.type.aa8bde.1: type = fn_type @PassLongLong__carbon_thunk.1 [concrete] +// CHECK:STDOUT: %PassLongLong__carbon_thunk.9998b6.1: %PassLongLong__carbon_thunk.type.aa8bde.1 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.a39: = impl_witness imports.%ImplicitAs.impl_witness_table.fb3 [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.437: %ImplicitAs.type.e50 = facet_value %Cpp.long_long, (%ImplicitAs.impl_witness.a39) [concrete] +// CHECK:STDOUT: %.467: type = fn_type_with_self_type %ImplicitAs.Convert.type.94e, %ImplicitAs.facet.437 [concrete] +// CHECK:STDOUT: %Cpp.long_long.as.ImplicitAs.impl.Convert.type: type = fn_type @Cpp.long_long.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %Cpp.long_long.as.ImplicitAs.impl.Convert: %Cpp.long_long.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %LongResult: type = class_type @LongResult [concrete] +// CHECK:STDOUT: %pattern_type.cd9: type = pattern_type %LongResult [concrete] +// CHECK:STDOUT: %ptr.305: type = ptr_type %LongResult [concrete] +// CHECK:STDOUT: %PassLongLong__carbon_thunk.type.aa8bde.2: type = fn_type @PassLongLong__carbon_thunk.2 [concrete] +// CHECK:STDOUT: %PassLongLong__carbon_thunk.9998b6.2: %PassLongLong__carbon_thunk.type.aa8bde.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %facet_value.1e3: %type_where = facet_value %LongResult, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6c9: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.1e3) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.418: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6c9 = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.5a4: %type_where = facet_value %LongLongResult, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.222: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.5a4) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.426: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.222 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .CppCompat = %CppCompat.c59 +// CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .As = %Core.As +// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .long_long = constants.%Cpp.long_long +// CHECK:STDOUT: .LongLongResult = %LongLongResult.decl +// CHECK:STDOUT: .PassLongLong = %PassLongLong.cpp_overload_set.value +// CHECK:STDOUT: .LongResult = %LongResult.decl +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.CppCompat: = import_ref Core//prelude, CppCompat, loaded +// CHECK:STDOUT: %CppCompat.c59: = namespace %Core.CppCompat, [concrete] { +// CHECK:STDOUT: .LongLong64 = %Core.LongLong64 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.LongLong64: type = import_ref Core//prelude/types/cpp/int, LongLong64, loaded [concrete = constants.%Cpp.long_long] +// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] +// CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)] +// CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.import_ref.16e: %i64.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/cpp/int, loc{{\d+_\d+}}, loaded [concrete = constants.%i64.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.fe6 = impl_witness_table (%Core.import_ref.16e), @i64.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %LongLongResult.decl: type = class_decl @LongLongResult [concrete = constants.%LongLongResult] {} {} +// CHECK:STDOUT: %PassLongLong.cpp_overload_set.value: %PassLongLong.cpp_overload_set.type = cpp_overload_set_value @PassLongLong.cpp_overload_set [concrete = constants.%PassLongLong.cpp_overload_set.value] +// CHECK:STDOUT: %PassLongLong__carbon_thunk.decl.139b1c.1: %PassLongLong__carbon_thunk.type.aa8bde.1 = fn_decl @PassLongLong__carbon_thunk.1 [concrete = constants.%PassLongLong__carbon_thunk.9998b6.1] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.de9: %Cpp.long_long.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/cpp/int, loc{{\d+_\d+}}, loaded [concrete = constants.%Cpp.long_long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.fb3 = impl_witness_table (%Core.import_ref.de9), @Cpp.long_long.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %LongResult.decl: type = class_decl @LongResult [concrete = constants.%LongResult] {} {} +// CHECK:STDOUT: %PassLongLong__carbon_thunk.decl.139b1c.2: %PassLongLong__carbon_thunk.type.aa8bde.2 = fn_decl @PassLongLong__carbon_thunk.2 [concrete = constants.%PassLongLong__carbon_thunk.9998b6.2] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_long_long.patt: %pattern_type.76e = value_binding_pattern cpp_long_long [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %i64.loc15: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] +// CHECK:STDOUT: %impl.elem0.loc15_40.1: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108] +// CHECK:STDOUT: %bound_method.loc15_40.1: = bound_method %int_1, %impl.elem0.loc15_40.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc15_40.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_40.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc15_40.2(%int_1) [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc15_40.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc15_40.2: %i64 = converted %int_1, %.loc15_40.1 [concrete = constants.%int_1.41a] +// CHECK:STDOUT: %.loc15_25: type = splice_block %long_long.ref [concrete = constants.%Cpp.long_long] { +// CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %long_long.ref: type = name_ref long_long, constants.%Cpp.long_long [concrete = constants.%Cpp.long_long] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc15_40.2: %.6d5 = impl_witness_access constants.%ImplicitAs.impl_witness.19c, element0 [concrete = constants.%i64.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc15_40.3: = bound_method %.loc15_40.2, %impl.elem0.loc15_40.2 [concrete = constants.%i64.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert.call: init %Cpp.long_long = call %bound_method.loc15_40.3(%.loc15_40.2) [concrete = constants.%int_1.092] +// CHECK:STDOUT: %.loc15_40.3: %Cpp.long_long = value_of_initializer %i64.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.092] +// CHECK:STDOUT: %.loc15_40.4: %Cpp.long_long = converted %.loc15_40.2, %.loc15_40.3 [concrete = constants.%int_1.092] +// CHECK:STDOUT: %cpp_long_long: %Cpp.long_long = value_binding cpp_long_long, %.loc15_40.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_long_long_result.patt: %pattern_type.257 = value_binding_pattern cpp_long_long_result [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp.ref.loc16_50: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassLongLong.ref.loc16: %PassLongLong.cpp_overload_set.type = name_ref PassLongLong, imports.%PassLongLong.cpp_overload_set.value [concrete = constants.%PassLongLong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_long_long.ref.loc16: %Cpp.long_long = name_ref cpp_long_long, %cpp_long_long +// CHECK:STDOUT: %.loc16_80.1: ref %LongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.a95 = addr_of %.loc16_80.1 +// CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.1(%cpp_long_long.ref.loc16, %addr.loc16) +// CHECK:STDOUT: %.loc16_80.2: init %LongLongResult = in_place_init %PassLongLong__carbon_thunk.call.loc16, %.loc16_80.1 +// CHECK:STDOUT: %.loc16_32: type = splice_block %LongLongResult.ref.loc16 [concrete = constants.%LongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %LongLongResult.ref.loc16: type = name_ref LongLongResult, imports.%LongLongResult.decl [concrete = constants.%LongLongResult] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc16_80.3: ref %LongLongResult = temporary %.loc16_80.1, %.loc16_80.2 +// CHECK:STDOUT: %.loc16_80.4: %LongLongResult = acquire_value %.loc16_80.3 +// CHECK:STDOUT: %cpp_long_long_result: %LongLongResult = value_binding cpp_long_long_result, %.loc16_80.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_compat_long_long.patt: %pattern_type.76e = value_binding_pattern cpp_compat_long_long [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_long_long.ref.loc18: %Cpp.long_long = name_ref cpp_long_long, %cpp_long_long +// CHECK:STDOUT: %.loc18: type = splice_block %LongLong64.ref [concrete = constants.%Cpp.long_long] { +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %CppCompat.ref: = name_ref CppCompat, imports.%CppCompat.c59 [concrete = imports.%CppCompat.c59] +// CHECK:STDOUT: %LongLong64.ref: type = name_ref LongLong64, imports.%Core.LongLong64 [concrete = constants.%Cpp.long_long] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_compat_long_long: %Cpp.long_long = value_binding cpp_compat_long_long, %cpp_long_long.ref.loc18 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_compat_long_long_result.patt: %pattern_type.257 = value_binding_pattern cpp_compat_long_long_result [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp.ref.loc19_57: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassLongLong.ref.loc19: %PassLongLong.cpp_overload_set.type = name_ref PassLongLong, imports.%PassLongLong.cpp_overload_set.value [concrete = constants.%PassLongLong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_compat_long_long.ref: %Cpp.long_long = name_ref cpp_compat_long_long, %cpp_compat_long_long +// CHECK:STDOUT: %.loc19_94.1: ref %LongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.a95 = addr_of %.loc19_94.1 +// CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.1(%cpp_compat_long_long.ref, %addr.loc19) +// CHECK:STDOUT: %.loc19_94.2: init %LongLongResult = in_place_init %PassLongLong__carbon_thunk.call.loc19, %.loc19_94.1 +// CHECK:STDOUT: %.loc19_39: type = splice_block %LongLongResult.ref.loc19 [concrete = constants.%LongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %LongLongResult.ref.loc19: type = name_ref LongLongResult, imports.%LongLongResult.decl [concrete = constants.%LongLongResult] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19_94.3: ref %LongLongResult = temporary %.loc19_94.1, %.loc19_94.2 +// CHECK:STDOUT: %.loc19_94.4: %LongLongResult = acquire_value %.loc19_94.3 +// CHECK:STDOUT: %cpp_compat_long_long_result: %LongLongResult = value_binding cpp_compat_long_long_result, %.loc19_94.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %carbon_i64.patt: %pattern_type.95b = value_binding_pattern carbon_i64 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_long_long.ref.loc21: %Cpp.long_long = name_ref cpp_long_long, %cpp_long_long +// CHECK:STDOUT: %.loc21_19: type = splice_block %i64.loc21 [concrete = constants.%i64] { +// CHECK:STDOUT: %int_64.loc21: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %i64.loc21: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc21: %.467 = impl_witness_access constants.%ImplicitAs.impl_witness.a39, element0 [concrete = constants.%Cpp.long_long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc21: = bound_method %cpp_long_long.ref.loc21, %impl.elem0.loc21 +// CHECK:STDOUT: %Cpp.long_long.as.ImplicitAs.impl.Convert.call: init %i64 = call %bound_method.loc21(%cpp_long_long.ref.loc21) +// CHECK:STDOUT: %.loc21_25.1: %i64 = value_of_initializer %Cpp.long_long.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc21_25.2: %i64 = converted %cpp_long_long.ref.loc21, %.loc21_25.1 +// CHECK:STDOUT: %carbon_i64: %i64 = value_binding carbon_i64, %.loc21_25.2 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %carbon_i64_result.patt: %pattern_type.cd9 = value_binding_pattern carbon_i64_result [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp.ref.loc22_43: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassLongLong.ref.loc22: %PassLongLong.cpp_overload_set.type = name_ref PassLongLong, imports.%PassLongLong.cpp_overload_set.value [concrete = constants.%PassLongLong.cpp_overload_set.value] +// CHECK:STDOUT: %carbon_i64.ref: %i64 = name_ref carbon_i64, %carbon_i64 +// CHECK:STDOUT: %.loc22_70.1: ref %LongResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.305 = addr_of %.loc22_70.1 +// CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.2(%carbon_i64.ref, %addr.loc22) +// CHECK:STDOUT: %.loc22_70.2: init %LongResult = in_place_init %PassLongLong__carbon_thunk.call.loc22, %.loc22_70.1 +// CHECK:STDOUT: %.loc22_29: type = splice_block %LongResult.ref [concrete = constants.%LongResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %LongResult.ref: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc22_70.3: ref %LongResult = temporary %.loc22_70.1, %.loc22_70.2 +// CHECK:STDOUT: %.loc22_70.4: %LongResult = acquire_value %.loc22_70.3 +// CHECK:STDOUT: %carbon_i64_result: %LongResult = value_binding carbon_i64_result, %.loc22_70.4 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc22: = bound_method %.loc22_70.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.418 +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc22: = bound_method %.loc22_70.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22(%.loc22_70.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc19: = bound_method %.loc19_94.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.426 +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc19: = bound_method %.loc19_94.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%.loc19_94.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc16: = bound_method %.loc16_80.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.426 +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc16: = bound_method %.loc16_80.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%.loc16_80.3) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- unsigned_long_long.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Cpp.unsigned_long_long: type = class_type @ULongLong64 [concrete] +// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] +// CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] +// CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.ebd: type = pattern_type %Cpp.unsigned_long_long [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete] +// CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete] // CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete] // CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%To) [symbolic] +// CHECK:STDOUT: %To.586: Core.IntLiteral = symbolic_binding To, 0 [symbolic] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To.586) [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic] -// CHECK:STDOUT: %As.impl_witness.ed2: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete] +// CHECK:STDOUT: %As.impl_witness.ed2d: = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl(%int_64) [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete] -// CHECK:STDOUT: %As.facet.bf5: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2) [concrete] -// CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet.bf5 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.eb8: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete] +// CHECK:STDOUT: %As.facet: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2d) [concrete] +// CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete] // CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.009: = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert.2(%int_64) [concrete] -// CHECK:STDOUT: %bound_method.bb9: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.009 [concrete] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete] +// CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete] +// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.4f6: type = facet_type <@ImplicitAs, @ImplicitAs(%Cpp.unsigned_long_long)> [concrete] +// CHECK:STDOUT: %ImplicitAs.Convert.type.c4b: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%Cpp.unsigned_long_long) [concrete] +// CHECK:STDOUT: %ImplicitAs.type.b8f: type = facet_type <@ImplicitAs, @ImplicitAs(%u64)> [concrete] +// CHECK:STDOUT: %ImplicitAs.Convert.type.c65: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%u64) [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.80f: = impl_witness imports.%ImplicitAs.impl_witness_table.654 [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.1f6: %ImplicitAs.type.4f6 = facet_value %u64, (%ImplicitAs.impl_witness.80f) [concrete] +// CHECK:STDOUT: %.c9b: type = fn_type_with_self_type %ImplicitAs.Convert.type.c4b, %ImplicitAs.facet.1f6 [concrete] +// CHECK:STDOUT: %u64.as.ImplicitAs.impl.Convert.type: type = fn_type @u64.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %u64.as.ImplicitAs.impl.Convert: %u64.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %u64.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.f23, %u64.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %int_1.79a: %Cpp.unsigned_long_long = int_value 1 [concrete] +// CHECK:STDOUT: %ULongLongResult: type = class_type @ULongLongResult [concrete] +// CHECK:STDOUT: %pattern_type.633: type = pattern_type %ULongLongResult [concrete] +// CHECK:STDOUT: %PassULongLong.cpp_overload_set.type: type = cpp_overload_set_type @PassULongLong.cpp_overload_set [concrete] +// CHECK:STDOUT: %PassULongLong.cpp_overload_set.value: %PassULongLong.cpp_overload_set.type = cpp_overload_set_value @PassULongLong.cpp_overload_set [concrete] +// CHECK:STDOUT: %ptr.d19: type = ptr_type %ULongLongResult [concrete] +// CHECK:STDOUT: %PassULongLong__carbon_thunk.type.88c6c2.1: type = fn_type @PassULongLong__carbon_thunk.1 [concrete] +// CHECK:STDOUT: %PassULongLong__carbon_thunk.887181.1: %PassULongLong__carbon_thunk.type.88c6c2.1 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.67a: = impl_witness imports.%ImplicitAs.impl_witness_table.7cb [concrete] +// CHECK:STDOUT: %ImplicitAs.facet.e14: %ImplicitAs.type.b8f = facet_value %Cpp.unsigned_long_long, (%ImplicitAs.impl_witness.67a) [concrete] +// CHECK:STDOUT: %.82e: type = fn_type_with_self_type %ImplicitAs.Convert.type.c65, %ImplicitAs.facet.e14 [concrete] +// CHECK:STDOUT: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.type: type = fn_type @Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %ULongResult: type = class_type @ULongResult [concrete] +// CHECK:STDOUT: %pattern_type.6f2: type = pattern_type %ULongResult [concrete] +// CHECK:STDOUT: %ptr.f5e: type = ptr_type %ULongResult [concrete] +// CHECK:STDOUT: %PassULongLong__carbon_thunk.type.88c6c2.2: type = fn_type @PassULongLong__carbon_thunk.2 [concrete] +// CHECK:STDOUT: %PassULongLong__carbon_thunk.887181.2: %PassULongLong__carbon_thunk.type.88c6c2.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %type_where: type = facet_type > [concrete] +// CHECK:STDOUT: %facet_value.4ba: %type_where = facet_value %ULongResult, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.429: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.4ba) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.735: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.429 = struct_value () [concrete] +// CHECK:STDOUT: %facet_value.1aa: %type_where = facet_value %ULongLongResult, () [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ea9: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.1aa) [concrete] +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.3fd: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ea9 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)] -// CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl.863 [concrete] -// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/parts/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)] -// CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl.38a [concrete] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .CppCompat = %CppCompat.c59 +// CHECK:STDOUT: .UInt = %Core.UInt +// CHECK:STDOUT: .As = %Core.As +// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .unsigned_long_long = constants.%Cpp.unsigned_long_long +// CHECK:STDOUT: .ULongLongResult = %ULongLongResult.decl +// CHECK:STDOUT: .PassULongLong = %PassULongLong.cpp_overload_set.value +// CHECK:STDOUT: .ULongResult = %ULongResult.decl +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.CppCompat: = import_ref Core//prelude, CppCompat, loaded +// CHECK:STDOUT: %CppCompat.c59: = namespace %Core.CppCompat, [concrete] { +// CHECK:STDOUT: .ULongLong64 = %Core.ULongLong64 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.ULongLong64: type = import_ref Core//prelude/types/cpp/int, ULongLong64, loaded [concrete = constants.%Cpp.unsigned_long_long] +// CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/types/uint, UInt, loaded [concrete = constants.%UInt.generic] +// CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/operators/as, As, loaded [concrete = constants.%As.generic] +// CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/types/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)] +// CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.import_ref.3bb: %u64.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/cpp/int, loc{{\d+_\d+}}, loaded [concrete = constants.%u64.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.654 = impl_witness_table (%Core.import_ref.3bb), @u64.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ULongLongResult.decl: type = class_decl @ULongLongResult [concrete = constants.%ULongLongResult] {} {} +// CHECK:STDOUT: %PassULongLong.cpp_overload_set.value: %PassULongLong.cpp_overload_set.type = cpp_overload_set_value @PassULongLong.cpp_overload_set [concrete = constants.%PassULongLong.cpp_overload_set.value] +// CHECK:STDOUT: %PassULongLong__carbon_thunk.decl.f0c073.1: %PassULongLong__carbon_thunk.type.88c6c2.1 = fn_decl @PassULongLong__carbon_thunk.1 [concrete = constants.%PassULongLong__carbon_thunk.887181.1] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import_ref.643: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.type = import_ref Core//prelude/types/cpp/int, loc{{\d+_\d+}}, loaded [concrete = constants.%Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.7cb = impl_witness_table (%Core.import_ref.643), @Cpp.unsigned_long_long.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ULongResult.decl: type = class_decl @ULongResult [concrete = constants.%ULongResult] {} {} +// CHECK:STDOUT: %PassULongLong__carbon_thunk.decl.f0c073.2: %PassULongLong__carbon_thunk.type.88c6c2.2 = fn_decl @PassULongLong__carbon_thunk.2 [concrete = constants.%PassULongLong__carbon_thunk.887181.2] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %cpp_long_long.patt: = value_binding_pattern cpp_long_long [concrete] +// CHECK:STDOUT: %cpp_unsigned_long_long.patt: %pattern_type.ebd = value_binding_pattern cpp_unsigned_long_long [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %i64.loc15: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] -// CHECK:STDOUT: %impl.elem0.loc15: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108] -// CHECK:STDOUT: %bound_method.loc15_41.1: = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.373] -// CHECK:STDOUT: %specific_fn.loc15: = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.As.impl.Convert.1(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.83e] -// CHECK:STDOUT: %bound_method.loc15_41.2: = bound_method %int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.c84] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc15: init %i64 = call %bound_method.loc15_41.2(%int_1.loc15) [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc15_41.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc15 [concrete = constants.%int_1.41a] -// CHECK:STDOUT: %.loc15_41.2: %i64 = converted %int_1.loc15, %.loc15_41.1 [concrete = constants.%int_1.41a] -// CHECK:STDOUT: -// CHECK:STDOUT: %cpp_long_long: = value_binding cpp_long_long, [concrete = ] +// CHECK:STDOUT: %u64.loc15: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: %impl.elem0.loc15_58.1: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2d, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09] +// CHECK:STDOUT: %bound_method.loc15_58.1: = bound_method %int_1, %impl.elem0.loc15_58.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc15_58.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc15_58.2: = bound_method %int_1, %specific_fn [concrete = constants.%bound_method] +// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %u64 = call %bound_method.loc15_58.2(%int_1) [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc15_58.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc15_58.2: %u64 = converted %int_1, %.loc15_58.1 [concrete = constants.%int_1.f23] +// CHECK:STDOUT: %.loc15_34: type = splice_block %unsigned_long_long.ref [concrete = constants.%Cpp.unsigned_long_long] { +// CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %unsigned_long_long.ref: type = name_ref unsigned_long_long, constants.%Cpp.unsigned_long_long [concrete = constants.%Cpp.unsigned_long_long] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc15_58.2: %.c9b = impl_witness_access constants.%ImplicitAs.impl_witness.80f, element0 [concrete = constants.%u64.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc15_58.3: = bound_method %.loc15_58.2, %impl.elem0.loc15_58.2 [concrete = constants.%u64.as.ImplicitAs.impl.Convert.bound] +// CHECK:STDOUT: %u64.as.ImplicitAs.impl.Convert.call: init %Cpp.unsigned_long_long = call %bound_method.loc15_58.3(%.loc15_58.2) [concrete = constants.%int_1.79a] +// CHECK:STDOUT: %.loc15_58.3: %Cpp.unsigned_long_long = value_of_initializer %u64.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.79a] +// CHECK:STDOUT: %.loc15_58.4: %Cpp.unsigned_long_long = converted %.loc15_58.2, %.loc15_58.3 [concrete = constants.%int_1.79a] +// CHECK:STDOUT: %cpp_unsigned_long_long: %Cpp.unsigned_long_long = value_binding cpp_unsigned_long_long, %.loc15_58.4 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %carbon_long_long.patt: %pattern_type.95b = value_binding_pattern carbon_long_long [concrete] +// CHECK:STDOUT: %cpp_unsigned_long_long_result.patt: %pattern_type.633 = value_binding_pattern cpp_unsigned_long_long_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_long_long.ref: = name_ref cpp_long_long, %cpp_long_long [concrete = ] -// CHECK:STDOUT: %.loc16: type = splice_block %i64.loc16 [concrete = constants.%i64] { -// CHECK:STDOUT: %int_64.loc16: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %i64.loc16: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64] +// CHECK:STDOUT: %Cpp.ref.loc16_60: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassULongLong.ref.loc16: %PassULongLong.cpp_overload_set.type = name_ref PassULongLong, imports.%PassULongLong.cpp_overload_set.value [concrete = constants.%PassULongLong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_unsigned_long_long.ref.loc16: %Cpp.unsigned_long_long = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long +// CHECK:STDOUT: %.loc16_100.1: ref %ULongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc16: %ptr.d19 = addr_of %.loc16_100.1 +// CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.1(%cpp_unsigned_long_long.ref.loc16, %addr.loc16) +// CHECK:STDOUT: %.loc16_100.2: init %ULongLongResult = in_place_init %PassULongLong__carbon_thunk.call.loc16, %.loc16_100.1 +// CHECK:STDOUT: %.loc16_41: type = splice_block %ULongLongResult.ref.loc16 [concrete = constants.%ULongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc16_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ULongLongResult.ref.loc16: type = name_ref ULongLongResult, imports.%ULongLongResult.decl [concrete = constants.%ULongLongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %carbon_long_long: %i64 = value_binding carbon_long_long, [concrete = ] +// CHECK:STDOUT: %.loc16_100.3: ref %ULongLongResult = temporary %.loc16_100.1, %.loc16_100.2 +// CHECK:STDOUT: %.loc16_100.4: %ULongLongResult = acquire_value %.loc16_100.3 +// CHECK:STDOUT: %cpp_unsigned_long_long_result: %ULongLongResult = value_binding cpp_unsigned_long_long_result, %.loc16_100.4 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %cpp_unsigned_long_long.patt: = value_binding_pattern cpp_unsigned_long_long [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %int_1.loc25: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_64.loc25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc25: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] -// CHECK:STDOUT: %impl.elem0.loc25: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09] -// CHECK:STDOUT: %bound_method.loc25_59.1: = bound_method %int_1.loc25, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.eb8] -// CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Core.IntLiteral.as.As.impl.Convert.2(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.009] -// CHECK:STDOUT: %bound_method.loc25_59.2: = bound_method %int_1.loc25, %specific_fn.loc25 [concrete = constants.%bound_method.bb9] -// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc25: init %u64 = call %bound_method.loc25_59.2(%int_1.loc25) [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc25_59.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc25 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: %.loc25_59.2: %u64 = converted %int_1.loc25, %.loc25_59.1 [concrete = constants.%int_1.f23] -// CHECK:STDOUT: -// CHECK:STDOUT: %cpp_unsigned_long_long: = value_binding cpp_unsigned_long_long, [concrete = ] +// CHECK:STDOUT: %cpp_compat_ulong_long.patt: %pattern_type.ebd = value_binding_pattern cpp_compat_ulong_long [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_unsigned_long_long.ref.loc18: %Cpp.unsigned_long_long = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long +// CHECK:STDOUT: %.loc18: type = splice_block %ULongLong64.ref [concrete = constants.%Cpp.unsigned_long_long] { +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %CppCompat.ref: = name_ref CppCompat, imports.%CppCompat.c59 [concrete = imports.%CppCompat.c59] +// CHECK:STDOUT: %ULongLong64.ref: type = name_ref ULongLong64, imports.%Core.ULongLong64 [concrete = constants.%Cpp.unsigned_long_long] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_compat_ulong_long: %Cpp.unsigned_long_long = value_binding cpp_compat_ulong_long, %cpp_unsigned_long_long.ref.loc18 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %cpp_compat_ulong_long_result.patt: %pattern_type.633 = value_binding_pattern cpp_compat_ulong_long_result [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp.ref.loc19_59: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassULongLong.ref.loc19: %PassULongLong.cpp_overload_set.type = name_ref PassULongLong, imports.%PassULongLong.cpp_overload_set.value [concrete = constants.%PassULongLong.cpp_overload_set.value] +// CHECK:STDOUT: %cpp_compat_ulong_long.ref: %Cpp.unsigned_long_long = name_ref cpp_compat_ulong_long, %cpp_compat_ulong_long +// CHECK:STDOUT: %.loc19_98.1: ref %ULongLongResult = temporary_storage +// CHECK:STDOUT: %addr.loc19: %ptr.d19 = addr_of %.loc19_98.1 +// CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.1(%cpp_compat_ulong_long.ref, %addr.loc19) +// CHECK:STDOUT: %.loc19_98.2: init %ULongLongResult = in_place_init %PassULongLong__carbon_thunk.call.loc19, %.loc19_98.1 +// CHECK:STDOUT: %.loc19_40: type = splice_block %ULongLongResult.ref.loc19 [concrete = constants.%ULongLongResult] { +// CHECK:STDOUT: %Cpp.ref.loc19_37: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ULongLongResult.ref.loc19: type = name_ref ULongLongResult, imports.%ULongLongResult.decl [concrete = constants.%ULongLongResult] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19_98.3: ref %ULongLongResult = temporary %.loc19_98.1, %.loc19_98.2 +// CHECK:STDOUT: %.loc19_98.4: %ULongLongResult = acquire_value %.loc19_98.3 +// CHECK:STDOUT: %cpp_compat_ulong_long_result: %ULongLongResult = value_binding cpp_compat_ulong_long_result, %.loc19_98.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %carbon_u64.patt: %pattern_type.157 = value_binding_pattern carbon_u64 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %cpp_unsigned_long_long.ref.loc21: %Cpp.unsigned_long_long = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long +// CHECK:STDOUT: %.loc21_19: type = splice_block %u64.loc21 [concrete = constants.%u64] { +// CHECK:STDOUT: %int_64.loc21: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] +// CHECK:STDOUT: %u64.loc21: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc21: %.82e = impl_witness_access constants.%ImplicitAs.impl_witness.67a, element0 [concrete = constants.%Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert] +// CHECK:STDOUT: %bound_method.loc21: = bound_method %cpp_unsigned_long_long.ref.loc21, %impl.elem0.loc21 +// CHECK:STDOUT: %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.call: init %u64 = call %bound_method.loc21(%cpp_unsigned_long_long.ref.loc21) +// CHECK:STDOUT: %.loc21_25.1: %u64 = value_of_initializer %Cpp.unsigned_long_long.as.ImplicitAs.impl.Convert.call +// CHECK:STDOUT: %.loc21_25.2: %u64 = converted %cpp_unsigned_long_long.ref.loc21, %.loc21_25.1 +// CHECK:STDOUT: %carbon_u64: %u64 = value_binding carbon_u64, %.loc21_25.2 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %carbon_unsigned_long_long.patt: %pattern_type.157 = value_binding_pattern carbon_unsigned_long_long [concrete] +// CHECK:STDOUT: %carbon_u64_result.patt: %pattern_type.6f2 = value_binding_pattern carbon_u64_result [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %cpp_unsigned_long_long.ref: = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long [concrete = ] -// CHECK:STDOUT: %.loc26: type = splice_block %u64.loc26 [concrete = constants.%u64] { -// CHECK:STDOUT: %int_64.loc26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %u64.loc26: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64] +// CHECK:STDOUT: %Cpp.ref.loc22_44: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %PassULongLong.ref.loc22: %PassULongLong.cpp_overload_set.type = name_ref PassULongLong, imports.%PassULongLong.cpp_overload_set.value [concrete = constants.%PassULongLong.cpp_overload_set.value] +// CHECK:STDOUT: %carbon_u64.ref: %u64 = name_ref carbon_u64, %carbon_u64 +// CHECK:STDOUT: %.loc22_72.1: ref %ULongResult = temporary_storage +// CHECK:STDOUT: %addr.loc22: %ptr.f5e = addr_of %.loc22_72.1 +// CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.2(%carbon_u64.ref, %addr.loc22) +// CHECK:STDOUT: %.loc22_72.2: init %ULongResult = in_place_init %PassULongLong__carbon_thunk.call.loc22, %.loc22_72.1 +// CHECK:STDOUT: %.loc22_29: type = splice_block %ULongResult.ref [concrete = constants.%ULongResult] { +// CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ULongResult.ref: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] // CHECK:STDOUT: } -// CHECK:STDOUT: %carbon_unsigned_long_long: %u64 = value_binding carbon_unsigned_long_long, [concrete = ] +// CHECK:STDOUT: %.loc22_72.3: ref %ULongResult = temporary %.loc22_72.1, %.loc22_72.2 +// CHECK:STDOUT: %.loc22_72.4: %ULongResult = acquire_value %.loc22_72.3 +// CHECK:STDOUT: %carbon_u64_result: %ULongResult = value_binding carbon_u64_result, %.loc22_72.4 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc22: = bound_method %.loc22_72.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.735 +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc22: = bound_method %.loc22_72.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22(%.loc22_72.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc19: = bound_method %.loc19_98.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.3fd +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc19: = bound_method %.loc19_98.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%.loc19_98.3) +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc16: = bound_method %.loc16_100.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.3fd +// CHECK:STDOUT: +// CHECK:STDOUT: %bound_method.loc16: = bound_method %.loc16_100.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3 +// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%.loc16_100.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon b/toolchain/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon index 3a0480cba5360..a6a054368230d 100644 --- a/toolchain/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon +++ b/toolchain/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon @@ -14,23 +14,14 @@ // Ensure we get a diagnostic when using a type that doesn't yet have a mapping // from C++ to Carbon. -// --- u64_types.h +// --- fail_todo_wide_char_t.carbon -unsigned long GetUL(); +import Cpp inline ''' +auto GetWC() -> wchar_t; +'''; -unsigned long long GetULL(); - -// --- fail_todo_use_u64_types.carbon - -import Cpp library "u64_types.h"; - -fn CallGetUL() -> u64 { return Cpp.GetUL(); } - -// TODO: Eventually, `unsigned long long` should map to -// `Cpp.unsigned_long_long`, which should implicitly convert to `u64`. -// We should switch to testing a different type when that case works. -// CHECK:STDERR: fail_todo_use_u64_types.carbon:[[@LINE+4]]:33: error: semantics TODO: `Unsupported: return type: unsigned long long` [SemanticsTodo] -// CHECK:STDERR: fn CallGetULL() -> u64 { return Cpp.GetULL(); } -// CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_wide_char_t.carbon:[[@LINE+4]]:32: error: semantics TODO: `Unsupported: return type: wchar_t` [SemanticsTodo] +// CHECK:STDERR: fn CallGetWC() -> u32 { return Cpp.GetWC(); } +// CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: -fn CallGetULL() -> u64 { return Cpp.GetULL(); } +fn CallGetWC() -> u32 { return Cpp.GetWC(); } diff --git a/toolchain/check/testdata/interop/cpp/macros.carbon b/toolchain/check/testdata/interop/cpp/macros.carbon index fe99bf92acb31..8d4deb97822e2 100644 --- a/toolchain/check/testdata/interop/cpp/macros.carbon +++ b/toolchain/check/testdata/interop/cpp/macros.carbon @@ -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 // // AUTOUPDATE // TIP: To test this file alone, run: @@ -85,18 +85,7 @@ library "[[@TEST_NAME]]"; import Cpp library "integer_literal_too_big.h"; fn F() { - // CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+15]]:3: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup] - // CHECK:STDERR: Cpp.CONFIG_VALUE; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: - // CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+11]]:3: error: invalid integer type [InCppConstantMapping] - // CHECK:STDERR: Cpp.CONFIG_VALUE; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+8]]:3: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup] - // CHECK:STDERR: Cpp.CONFIG_VALUE; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: - // CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+4]]:3: error: member name `CONFIG_VALUE` not found in `Cpp` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: fail_import_integer_literal_too_big.carbon:[[@LINE+4]]:3: note: in `Cpp` name lookup for `CONFIG_VALUE` [InCppNameLookup] // CHECK:STDERR: Cpp.CONFIG_VALUE; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/diagnostics/coverage_test.cpp b/toolchain/diagnostics/coverage_test.cpp index 626fd25e3c262..0bca0f10c5495 100644 --- a/toolchain/diagnostics/coverage_test.cpp +++ b/toolchain/diagnostics/coverage_test.cpp @@ -54,6 +54,9 @@ constexpr Kind UntestedKinds[] = { // unpredictable names in the module cache, which bazel doesn't permit. Kind::InCppModule, + // TODO: We should add tests that trigger this. + Kind::InCppConstantMapping, + // TODO: This can only fire if the first message in a diagnostic is rooted // in a file other than the file being compiled. The language server // currently only supports compiling one file at a time. Do one of: diff --git a/toolchain/sem_ir/type_info.cpp b/toolchain/sem_ir/type_info.cpp index 07edfefee9a09..d535f55caf53b 100644 --- a/toolchain/sem_ir/type_info.cpp +++ b/toolchain/sem_ir/type_info.cpp @@ -177,6 +177,9 @@ auto RecognizedTypeInfo::ForType(const File& file, ClassType class_type) if (parent_name_ident == "CppCompat") { Kind kind = llvm::StringSwitch(*name_ident) .Case("Long32", CppLong32) + .Case("ULong32", CppULong32) + .Case("LongLong64", CppLongLong64) + .Case("ULongLong64", CppULongLong64) .Case("NullptrT", CppNullptrT) .Default(None); return {.kind = kind}; @@ -185,6 +188,26 @@ auto RecognizedTypeInfo::ForType(const File& file, ClassType class_type) return {.kind = None}; } +// Prints a `Core.CppCompat` integer type name. Typically, when the C++ integer +// type width matches the Carbon type width, prints +// `Core.CppCompat.builtin_type`. Otherwise prints the +// `Core.CppCompat.BuiltinType`. +static auto PrintCppCompatLiteral( + const File& file, clang::CanQualType clang::ASTContext::* qual_type_member, + unsigned int carbon_bit_width, llvm::StringRef cpp_builtin_name, + llvm::StringRef cpp_compat_name, llvm::raw_ostream& out) -> void { + if (file.clang_ast_unit()) { + const clang::ASTContext& ast_context = + file.clang_ast_unit()->getASTContext(); + if (ast_context.getIntWidth(ast_context.*qual_type_member) == + carbon_bit_width) { + out << "Cpp." << cpp_builtin_name; + return; + } + } + out << "Core.CppCompat." << cpp_compat_name; +} + auto RecognizedTypeInfo::PrintLiteral(const File& file, llvm::raw_ostream& out) const -> void { switch (kind) { @@ -197,15 +220,20 @@ auto RecognizedTypeInfo::PrintLiteral(const File& file, out << "char"; break; case CppLong32: - if (file.clang_ast_unit()) { - const clang::ASTContext& ast_context = - file.clang_ast_unit()->getASTContext(); - if (ast_context.getIntWidth(ast_context.LongTy) == 32) { - out << "Cpp.long"; - break; - } - } - out << "Core.CppCompat.Long32"; + PrintCppCompatLiteral(file, &clang::ASTContext::LongTy, 32, "long", + "Long32", out); + break; + case CppULong32: + PrintCppCompatLiteral(file, &clang::ASTContext::UnsignedLongTy, 32, + "unsigned_long", "ULong32", out); + break; + case CppLongLong64: + PrintCppCompatLiteral(file, &clang::ASTContext::LongLongTy, 64, + "long_long", "LongLong64", out); + break; + case CppULongLong64: + PrintCppCompatLiteral(file, &clang::ASTContext::UnsignedLongLongTy, 64, + "unsigned_long_long", "ULongLong64", out); break; case CppNullptrT: out << "Cpp.nullptr_t"; diff --git a/toolchain/sem_ir/type_info.h b/toolchain/sem_ir/type_info.h index 658fb24cc8be7..063de1920cad8 100644 --- a/toolchain/sem_ir/type_info.h +++ b/toolchain/sem_ir/type_info.h @@ -238,6 +238,15 @@ struct RecognizedTypeInfo { Char, // `Core.CppCompat.Long32` which is `Cpp.long` when `long` is 32 bits. CppLong32, + // `Core.CppCompat.ULong32` which is `Cpp.unsigned_long` when `unsigned + // long` is 32 bits. + CppULong32, + // `Core.CppCompat.LongLong64` which is `Cpp.long_long` when `long` is 64 + // bits. + CppLongLong64, + // `Core.CppCompat.ULongLong64` which is `Cpp.unsigned_long_long` when + // `unsigned long` is 64 bits. + CppULongLong64, // `Cpp.nullptr_t` / `Core.CppCompat.NullptrT`. CppNullptrT, // `str` / `Core.String`.