Skip to content

Commit 3fa07ed

Browse files
authored
Rename config.host_os to config.target_os.
config.host_os is derived from CMAKE_SYSTEM_NAME which specifies the target. See: https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html To reduce confusion, rename it to config.target_os. The variable name config.target_os was already being used by the Orc tests. Rename it to config.orc_test_target_os with a FIXME to remove. Reviewers: JDevlieghere, MaskRay Reviewed By: MaskRay Pull Request: #149015
1 parent f480e1b commit 3fa07ed

File tree

39 files changed

+107
-106
lines changed

39 files changed

+107
-106
lines changed

compiler-rt/lib/tysan/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ config.substitutions.append( ("%clangxx_tysan ", build_invocation(clang_tysan_cx
2727
config.suffixes = ['.c', '.cc', '.cpp']
2828

2929
# TypeSanitizer tests are currently supported on Linux only.
30-
if config.host_os not in ['Linux']:
30+
if config.target_os not in ['Linux']:
3131
config.unsupported = True
3232

3333
if config.target_arch != 'aarch64':

compiler-rt/test/asan/lit.cfg.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_required_attr(config, attr_name):
2828
# tests to prevent regressions.
2929
# Currently, detect_leaks for asan tests only work on Intel MacOS.
3030
if (
31-
config.host_os == "Darwin"
31+
config.target_os == "Darwin"
3232
and config.apple_platform == "osx"
3333
and config.target_arch == "x86_64"
3434
):
@@ -45,7 +45,7 @@ def get_required_attr(config, attr_name):
4545
# Setup source root.
4646
config.test_source_root = os.path.dirname(__file__)
4747

48-
if config.host_os not in ["FreeBSD", "NetBSD"]:
48+
if config.target_os not in ["FreeBSD", "NetBSD"]:
4949
libdl_flag = "-ldl"
5050
else:
5151
libdl_flag = ""
@@ -125,17 +125,17 @@ def build_invocation(compile_flags, with_lto=False):
125125
("%clangxx_asan_lto ", build_invocation(clang_asan_cxxflags, True))
126126
)
127127
if config.asan_dynamic:
128-
if config.host_os in ["Linux", "FreeBSD", "NetBSD", "SunOS"]:
128+
if config.target_os in ["Linux", "FreeBSD", "NetBSD", "SunOS"]:
129129
shared_libasan_path = os.path.join(
130130
config.compiler_rt_libdir,
131131
"libclang_rt.asan{}.so".format(config.target_suffix),
132132
)
133-
elif config.host_os == "Darwin":
133+
elif config.target_os == "Darwin":
134134
shared_libasan_path = os.path.join(
135135
config.compiler_rt_libdir,
136136
"libclang_rt.asan_{}_dynamic.dylib".format(config.apple_platform),
137137
)
138-
elif config.host_os == "Windows":
138+
elif config.target_os == "Windows":
139139
shared_libasan_path = os.path.join(
140140
config.compiler_rt_libdir,
141141
"clang_rt.asan_dynamic-{}.lib".format(config.target_suffix),
@@ -274,16 +274,16 @@ def build_invocation(compile_flags, with_lto=False):
274274
and (config.target_arch in ["x86_64", "i386", "i686", "aarch64"])
275275
)
276276
leak_detection_linux = (
277-
(config.host_os == "Linux")
277+
(config.target_os == "Linux")
278278
and (not config.android)
279279
and (config.target_arch in ["x86_64", "i386", "riscv64", "loongarch64"])
280280
)
281281
leak_detection_mac = (
282-
(config.host_os == "Darwin")
282+
(config.target_os == "Darwin")
283283
and (config.apple_platform == "osx")
284284
and (config.target_arch == "x86_64")
285285
)
286-
leak_detection_netbsd = (config.host_os == "NetBSD") and (
286+
leak_detection_netbsd = (config.target_os == "NetBSD") and (
287287
config.target_arch in ["x86_64", "i386"]
288288
)
289289
if (
@@ -296,7 +296,7 @@ def build_invocation(compile_flags, with_lto=False):
296296

297297
# Add the RT libdir to PATH directly so that we can successfully run the gtest
298298
# binary to list its tests.
299-
if config.host_os == "Windows":
299+
if config.target_os == "Windows":
300300
os.environ["PATH"] = os.path.pathsep.join(
301301
[config.compiler_rt_libdir, os.environ.get("PATH", "")]
302302
)
@@ -310,10 +310,10 @@ def build_invocation(compile_flags, with_lto=False):
310310
# Default test suffixes.
311311
config.suffixes = [".c", ".cpp"]
312312

313-
if config.host_os == "Darwin":
313+
if config.target_os == "Darwin":
314314
config.suffixes.append(".mm")
315315

316-
if config.host_os == "Windows":
316+
if config.target_os == "Windows":
317317
config.substitutions.append(("%fPIC", ""))
318318
config.substitutions.append(("%fPIE", ""))
319319
config.substitutions.append(("%pie", ""))
@@ -323,11 +323,11 @@ def build_invocation(compile_flags, with_lto=False):
323323
config.substitutions.append(("%pie", "-pie"))
324324

325325
# Only run the tests on supported OSs.
326-
if config.host_os not in ["Linux", "Darwin", "FreeBSD", "SunOS", "Windows", "NetBSD"]:
326+
if config.target_os not in ["Linux", "Darwin", "FreeBSD", "SunOS", "Windows", "NetBSD"]:
327327
config.unsupported = True
328328

329329
if not config.parallelism_group:
330330
config.parallelism_group = "shadow-memory"
331331

332-
if config.host_os == "NetBSD":
332+
if config.target_os == "NetBSD":
333333
config.substitutions.insert(0, ("%run", config.netbsd_noaslr_prefix))

compiler-rt/test/asan_abi/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def build_invocation(compile_flags):
6868

6969
config.suffixes = ['.c', '.cpp']
7070

71-
if config.host_os == 'Darwin':
71+
if config.target_os == 'Darwin':
7272
config.suffixes.append('.mm')
7373
else:
7474
config.unsupported = True

compiler-rt/test/builtins/Unit/lit.cfg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ def get_libgcc_file_name():
8080
config.compiler_rt_libdir, "clang_rt.builtins%s.lib " % config.target_suffix
8181
)
8282
config.substitutions.append(("%librt ", base_lib))
83-
elif config.host_os == "Darwin":
83+
elif config.target_os == "Darwin":
8484
base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.osx.a ")
8585
config.substitutions.append(("%librt ", base_lib + " -lSystem "))
86-
elif config.host_os == "Windows":
86+
elif config.target_os == "Windows":
8787
base_lib = os.path.join(
8888
config.compiler_rt_libdir, "libclang_rt.builtins%s.a" % config.target_suffix
8989
)
@@ -104,7 +104,7 @@ def get_libgcc_file_name():
104104
if sys.platform in ["win32"] and execute_external:
105105
# Don't pass dosish path separator to msys bash.exe.
106106
base_lib = base_lib.replace("\\", "/")
107-
if config.host_os == "Haiku":
107+
if config.target_os == "Haiku":
108108
config.substitutions.append(("%librt ", base_lib + " -lroot "))
109109
else:
110110
config.substitutions.append(("%librt ", base_lib + " -lc -lm "))

compiler-rt/test/builtins/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
("%clang ", " " + config.clang + " " + " ".join(extra_flags) + " ")
2222
)
2323

24-
if config.host_os == "Darwin":
24+
if config.target_os == "Darwin":
2525
config.substitutions.append(
2626
("%macos_version_major", str(config.darwin_osx_version[0]))
2727
)

compiler-rt/test/ctx_profile/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import lit.formats
88

99
# Only run the tests on supported OSs.
10-
if config.host_os not in ["Linux"]:
10+
if config.target_os not in ["Linux"]:
1111
config.unsupported = True
1212

1313

compiler-rt/test/dfsan/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ def build_invocation(compile_flags):
2525
config.suffixes = [".c", ".cpp"]
2626

2727
# DataFlowSanitizer tests are currently supported on Linux only.
28-
if not (config.host_os in ["Linux"] and config.target_arch in ["aarch64", "x86_64", "loongarch64"]):
28+
if not (config.target_os in ["Linux"] and config.target_arch in ["aarch64", "x86_64", "loongarch64"]):
2929
config.unsupported = True

compiler-rt/test/fuzzer/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,5 @@ def generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True, msan_enabled=False):
149149
if not config.parallelism_group:
150150
config.parallelism_group = "shadow-memory"
151151

152-
if config.host_os == "NetBSD":
152+
if config.target_os == "NetBSD":
153153
config.substitutions.insert(0, ("%run", config.netbsd_noaslr_prefix))

compiler-rt/test/gwp_asan/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ def build_invocation(compile_flags):
6767
)
6868

6969
# GWP-ASan tests are currently supported on Linux only.
70-
if config.host_os not in ["Linux"]:
70+
if config.target_os not in ["Linux"]:
7171
config.unsupported = True

compiler-rt/test/hwasan/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ def build_invocation(compile_flags):
8686
# Default test suffixes.
8787
config.suffixes = [".c", ".cpp"]
8888

89-
if config.host_os not in ["Linux", "Android"] or not config.has_lld:
89+
if config.target_os not in ["Linux", "Android"] or not config.has_lld:
9090
config.unsupported = True

0 commit comments

Comments
 (0)