Skip to content

Commit 100f261

Browse files
committed
[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
1 parent 7c7f9fd commit 100f261

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/DriverTool/sil_opt_main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ int sil_opt_main(ArrayRef<const char *> argv, void *MainAddr) {
794794
}
795795

796796
Invocation.getLangOptions().EnableCXXInterop = options.EnableCxxInterop;
797+
Invocation.computeCXXStdlibOptions();
797798

798799
Invocation.getLangOptions().UnavailableDeclOptimizationMode =
799800
options.UnavailableDeclOptimization;

validation-test/SIL/verify_all_overlays.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@
3838
# TODO: fix the DifferentiationUnittest module.
3939
if module_name == "DifferentiationUnittest":
4040
continue
41-
# Backtracing needs its own additional modules in the module path
41+
# Runtime needs its own additional modules in the module path, and
42+
# also needs C++ interop enabled
4243
if module_name == "Runtime":
4344
extra_args = ["-I", os.path.join(source_dir, "stdlib",
4445
"public", "RuntimeModule", "modules"),
45-
"-I", os.path.join(source_dir, "include")]
46+
"-I", os.path.join(source_dir, "include"),
47+
"--enable-experimental-cxx-interop"]
4648
# _Concurrency needs its own additional modules in the module path
4749
if module_name == "_Concurrency":
4850
extra_args = ["-I", os.path.join(source_dir, "stdlib",

0 commit comments

Comments
 (0)