Test calling std::make_unique on a Carbon type from Carbon. (#7563)

As a byproduct, this introduces a new top-level directory
`integration_tests` for tests like this.

This also fixes a latent bug with name mangling on Mac.
This commit is contained in:
Geoff Romer
2026-07-29 16:07:10 +00:00
committed by GitHub
parent 8ac0edb280
commit 2ac425e591
6 changed files with 86 additions and 5 deletions
+3 -1
View File
@@ -587,7 +587,7 @@ static auto BuildCppFunctionDeclForNonGenericCarbonFn(Context& context,
SemIR::Mangler m(context.sem_ir(), context.total_ir_count(),
context.mangle_string_fingerprint());
std::string mangled_name =
m.Mangle(target.function_id, SemIR::SpecificId::None);
m.MangleWithPlatform(target.function_id, SemIR::SpecificId::None);
function_decl->addAttr(
clang::AsmLabelAttr::Create(context.ast_context(), mangled_name));
@@ -1415,6 +1415,8 @@ auto ExportVarToCpp(Context& context, SemIR::InstId inst_id,
}
// Set the Carbon mangled variable name.
// TODO: do we need to apply the platform mangling, like we do for exported
// functions?
SemIR::Mangler m(context.sem_ir(), context.total_ir_count(),
context.mangle_string_fingerprint());
std::string mangled_name = m.MangleGlobalVariable(var_storage.pattern_id);