[Tests] Enable C++ interop for Runtime in the overlay verification test.

The Runtime module requires C++ interop enabled, because that's
the only way to robustly fix things so that it is able to declare various
types and constants without clashing with system headers.

To make this work, we also need to add a missing invocation to sil-opt to
make it pick the correct C++ runtime library.

rdar://143050566
This commit is contained in:
Alastair Houghton
2025-01-23 18:22:45 +00:00
parent 7c7f9fd956
commit 100f2615cb
2 changed files with 5 additions and 2 deletions

View File

@@ -794,6 +794,7 @@ int sil_opt_main(ArrayRef<const char *> argv, void *MainAddr) {
} }
Invocation.getLangOptions().EnableCXXInterop = options.EnableCxxInterop; Invocation.getLangOptions().EnableCXXInterop = options.EnableCxxInterop;
Invocation.computeCXXStdlibOptions();
Invocation.getLangOptions().UnavailableDeclOptimizationMode = Invocation.getLangOptions().UnavailableDeclOptimizationMode =
options.UnavailableDeclOptimization; options.UnavailableDeclOptimization;

View File

@@ -38,11 +38,13 @@ for module_file in os.listdir(sdk_overlay_dir):
# TODO: fix the DifferentiationUnittest module. # TODO: fix the DifferentiationUnittest module.
if module_name == "DifferentiationUnittest": if module_name == "DifferentiationUnittest":
continue continue
# Backtracing needs its own additional modules in the module path # Runtime needs its own additional modules in the module path, and
# also needs C++ interop enabled
if module_name == "Runtime": if module_name == "Runtime":
extra_args = ["-I", os.path.join(source_dir, "stdlib", extra_args = ["-I", os.path.join(source_dir, "stdlib",
"public", "RuntimeModule", "modules"), "public", "RuntimeModule", "modules"),
"-I", os.path.join(source_dir, "include")] "-I", os.path.join(source_dir, "include"),
"--enable-experimental-cxx-interop"]
# _Concurrency needs its own additional modules in the module path # _Concurrency needs its own additional modules in the module path
if module_name == "_Concurrency": if module_name == "_Concurrency":
extra_args = ["-I", os.path.join(source_dir, "stdlib", extra_args = ["-I", os.path.join(source_dir, "stdlib",