[libcxx-commits] [libcxx] 6d13961 - [libc++][test] Improves substitution naming (#80471)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Feb 9 08:40:11 PST 2024
Author: Mark de Wever
Date: 2024-02-09T17:40:08+01:00
New Revision: 6d1396148977ca275df243a965ac504448bf5faa
URL: https://github.com/llvm/llvm-project/commit/6d1396148977ca275df243a965ac504448bf5faa
DIFF: https://github.com/llvm/llvm-project/commit/6d1396148977ca275df243a965ac504448bf5faa.diff
LOG: [libc++][test] Improves substitution naming (#80471)
Using the `-dir` suffix for directories makes it easier to understand.
Fixes: https://github.com/llvm/llvm-project/issues/78310
Added:
Modified:
libcxx/test/configs/apple-libc++-backdeployment.cfg.in
libcxx/test/configs/apple-libc++-shared.cfg.in
libcxx/test/configs/armv7m-picolibc-libc++.cfg.in
libcxx/test/configs/cmake-bridge.cfg.in
libcxx/test/configs/ibm-libc++-shared.cfg.in
libcxx/test/configs/llvm-libc++-android-ndk.cfg.in
libcxx/test/configs/llvm-libc++-mingw.cfg.in
libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
libcxx/test/configs/llvm-libc++-shared.cfg.in
libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
libcxx/test/configs/llvm-libc++-static.cfg.in
libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
libcxx/test/libcxx/clang_modules_include.gen.py
libcxx/test/libcxx/clang_tidy.gen.py
libcxx/test/libcxx/double_include.gen.py
libcxx/test/libcxx/header_inclusions.gen.py
libcxx/test/libcxx/headers_in_modulemap.sh.py
libcxx/test/libcxx/libcpp_version.gen.py
libcxx/test/libcxx/module_std.gen.py
libcxx/test/libcxx/module_std_compat.gen.py
libcxx/test/libcxx/no_assert_include.gen.py
libcxx/test/libcxx/system_reserved_names.gen.py
libcxx/test/libcxx/transitive_includes.gen.py
libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
libcxx/test/libcxx/vendor/clang-cl/static-lib-exports.sh.cpp
libcxx/test/libcxx/vendor/mingw/static-lib-exports.sh.cpp
libcxx/utils/libcxx/test/features.py
libcxx/utils/libcxx/test/format.py
Removed:
################################################################################
diff --git a/libcxx/test/configs/apple-libc++-backdeployment.cfg.in b/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
index b471c02709c060..42594461f10e7e 100644
--- a/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
+++ b/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
@@ -45,10 +45,10 @@ config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{libcxx}/test/support'
+ '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++'
+ '-nostdlib++ -L %{lib-dir} -lc++'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
diff --git a/libcxx/test/configs/apple-libc++-shared.cfg.in b/libcxx/test/configs/apple-libc++-shared.cfg.in
index af1926e3859b9e..2d0aee3ae905e8 100644
--- a/libcxx/test/configs/apple-libc++-shared.cfg.in
+++ b/libcxx/test/configs/apple-libc++-shared.cfg.in
@@ -13,13 +13,13 @@ config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{libcxx}/test/support'
+ '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++'
+ '-nostdlib++ -L %{lib-dir} -lc++'
))
config.substitutions.append(('%{exec}',
- '%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib} -- '
+ '%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib-dir} -- '
))
config.stdlib = 'apple-libc++'
diff --git a/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in
index a39d43aec96aa4..8ca8603008200a 100644
--- a/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in
+++ b/libcxx/test/configs/armv7m-picolibc-libc++.cfg.in
@@ -5,7 +5,7 @@ libc_linker_script = '@CMAKE_INSTALL_PREFIX@/lib/picolibcpp.ld'
config.substitutions.append(('%{flags}', '--sysroot=@CMAKE_INSTALL_PREFIX@'))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
+ '-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support'
# Disable warnings in cxx_atomic_impl.h:
# "large atomic operation may incur significant performance penalty; the
@@ -17,7 +17,7 @@ config.substitutions.append(('%{compile_flags}',
' -include picolibc.h'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib -nostdlib++ -L %{lib} -lc++ -lc++abi'
+ '-nostdlib -nostdlib++ -L %{lib-dir} -lc++ -lc++abi'
' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' +
' -T {}'.format(libc_linker_script) +
' -Wl,--defsym=__flash=0x0'
diff --git a/libcxx/test/configs/cmake-bridge.cfg.in b/libcxx/test/configs/cmake-bridge.cfg.in
index 72b2ddf378bb64..84b3270a8940ac 100644
--- a/libcxx/test/configs/cmake-bridge.cfg.in
+++ b/libcxx/test/configs/cmake-bridge.cfg.in
@@ -25,9 +25,9 @@ config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
# Add substitutions for bootstrapping the test suite configuration
import shlex
config.substitutions.append(('%{cxx}', shlex.quote('@CMAKE_CXX_COMPILER@')))
-config.substitutions.append(('%{libcxx}', '@LIBCXX_SOURCE_DIR@'))
-config.substitutions.append(('%{include}', '@LIBCXX_GENERATED_INCLUDE_DIR@'))
-config.substitutions.append(('%{target-include}', '@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@'))
-config.substitutions.append(('%{lib}', '@LIBCXX_LIBRARY_DIR@'))
-config.substitutions.append(('%{module}', '@LIBCXX_GENERATED_MODULE_DIR@'))
-config.substitutions.append(('%{test-tools}', '@LIBCXX_TEST_TOOLS_PATH@'))
+config.substitutions.append(('%{libcxx-dir}', '@LIBCXX_SOURCE_DIR@'))
+config.substitutions.append(('%{include-dir}', '@LIBCXX_GENERATED_INCLUDE_DIR@'))
+config.substitutions.append(('%{target-include-dir}', '@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@'))
+config.substitutions.append(('%{lib-dir}', '@LIBCXX_LIBRARY_DIR@'))
+config.substitutions.append(('%{module-dir}', '@LIBCXX_GENERATED_MODULE_DIR@'))
+config.substitutions.append(('%{test-tools-dir}', '@LIBCXX_TEST_TOOLS_PATH@'))
diff --git a/libcxx/test/configs/ibm-libc++-shared.cfg.in b/libcxx/test/configs/ibm-libc++-shared.cfg.in
index 50061e9717ce06..0f86e741da10e4 100644
--- a/libcxx/test/configs/ibm-libc++-shared.cfg.in
+++ b/libcxx/test/configs/ibm-libc++-shared.cfg.in
@@ -12,13 +12,13 @@ if lit.util.isAIXTriple(config.target_triple):
config.substitutions.append(('%{flags}', '-pthread'))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -D__LIBC_NO_CPP_MATH_OVERLOADS__ -I %{include} -I %{libcxx}/test/support'
+ '-nostdinc++ -D__LIBC_NO_CPP_MATH_OVERLOADS__ -I %{include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++ -lc++abi -latomic -Wl,-bbigtoc'
+ '-nostdlib++ -L %{lib-dir} -lc++ -lc++abi -latomic -Wl,-bbigtoc'
))
config.substitutions.append(('%{exec}',
- '%{executor} --execdir %T --env LIBPATH=%{lib} -- '
+ '%{executor} --execdir %T --env LIBPATH=%{lib-dir} -- '
))
# LIBCXX-AIX-FIXME is the feature name used to XFAIL the
diff --git a/libcxx/test/configs/llvm-libc++-android-ndk.cfg.in b/libcxx/test/configs/llvm-libc++-android-ndk.cfg.in
index 1be85279a120aa..d5f1cccba3b76f 100644
--- a/libcxx/test/configs/llvm-libc++-android-ndk.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-android-ndk.cfg.in
@@ -16,7 +16,7 @@ config.substitutions.append(('%{flags}',
'--sysroot @CMAKE_SYSROOT@' if '@CMAKE_SYSROOT@' else ''
))
-compile_flags = '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
+compile_flags = '-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support'
if re.match(r'i686-linux-android(21|22|23)$', config.target_triple):
# 32-bit x86 Android has a bug where the stack is sometimes misaligned.
# The problem appears limited to versions before Android N (API 24) and only
@@ -31,7 +31,7 @@ config.substitutions.append(('%{compile_flags}', compile_flags))
# libc++_shared.so because older Bionic dynamic loaders don't support rpath
# lookup.
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++_shared'
+ '-nostdlib++ -L %{lib-dir} -lc++_shared'
))
config.substitutions.append(('%{exec}',
'%{executor}' +
diff --git a/libcxx/test/configs/llvm-libc++-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
index eb77f1142db61f..8a0cc96763a17b 100644
--- a/libcxx/test/configs/llvm-libc++-mingw.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
@@ -5,13 +5,13 @@ lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
config.substitutions.append(('%{flags}', ''))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
+ '-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++'
+ '-nostdlib++ -L %{lib-dir} -lc++'
))
config.substitutions.append(('%{exec}',
- '%{executor} --execdir %T --prepend_env PATH=%{lib} -- '
+ '%{executor} --execdir %T --prepend_env PATH=%{lib-dir} -- '
))
import os, site
diff --git a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
index 50d28eb67c77b7..cca88c8151c68b 100644
--- a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
@@ -5,13 +5,13 @@ lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
config.substitutions.append(('%{compile_flags}',
- '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
+ '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib -L %{lib} -lc++ -l' + config.cxx_lib
+ '-nostdlib -L %{lib-dir} -lc++ -l' + config.cxx_lib
))
config.substitutions.append(('%{exec}',
- '%{executor} --execdir %T --prepend_env PATH=%{lib} -- '
+ '%{executor} --execdir %T --prepend_env PATH=%{lib-dir} -- '
))
import os, site
diff --git a/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in b/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
index a75e90b198896d..7d107c8ffc1693 100644
--- a/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
@@ -6,10 +6,10 @@ lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
config.substitutions.append(('%{flags}', '-pthread'))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
+ '-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -lm'
+ '-nostdlib++ -L %{lib-dir} -Wl,-rpath,%{lib-dir} -lc++ -lm'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
diff --git a/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
index 4c88af3dbb6ebe..a8ad920897e61f 100644
--- a/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in
@@ -6,13 +6,13 @@ lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
config.substitutions.append(('%{compile_flags}',
- '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -D_HAS_EXCEPTIONS=0' + config.dbg_include
+ '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -D_HAS_EXCEPTIONS=0' + config.dbg_include
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib -L %{lib} -lc++ -l' + config.cxx_lib
+ '-nostdlib -L %{lib-dir} -lc++ -l' + config.cxx_lib
))
config.substitutions.append(('%{exec}',
- '%{executor} --execdir %T --prepend_env PATH=%{lib} -- '
+ '%{executor} --execdir %T --prepend_env PATH=%{lib-dir} -- '
))
import os, site
diff --git a/libcxx/test/configs/llvm-libc++-shared.cfg.in b/libcxx/test/configs/llvm-libc++-shared.cfg.in
index 143b3b3feae110..5199f64f551beb 100644
--- a/libcxx/test/configs/llvm-libc++-shared.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-shared.cfg.in
@@ -7,10 +7,10 @@ config.substitutions.append(('%{flags}',
'-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')
))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
+ '-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++'
+ '-nostdlib++ -L %{lib-dir} -Wl,-rpath,%{lib-dir} -lc++'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
diff --git a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
index 4baaad765a92d3..7c700bff32b9dc 100644
--- a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
@@ -5,10 +5,10 @@ lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
config.substitutions.append(('%{flags}', '--driver-mode=g++'))
config.substitutions.append(('%{compile_flags}',
- '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
+ '-fms-runtime-lib=' + config.fms_runtime_lib + ' -nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' + config.dbg_include
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib -L %{lib} -llibc++ -l' + config.cxx_lib
+ '-nostdlib -L %{lib-dir} -llibc++ -l' + config.cxx_lib
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
diff --git a/libcxx/test/configs/llvm-libc++-static.cfg.in b/libcxx/test/configs/llvm-libc++-static.cfg.in
index e866d4f52a0629..097cc4d49e4b24 100644
--- a/libcxx/test/configs/llvm-libc++-static.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-static.cfg.in
@@ -7,10 +7,10 @@ config.substitutions.append(('%{flags}',
'-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')
))
config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support'
+ '-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++ -lc++abi'
+ '-nostdlib++ -L %{lib-dir} -lc++ -lc++abi'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T -- '
diff --git a/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py b/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
index a4e1c3c29c9369..bd883aa0c14502 100644
--- a/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
+++ b/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
@@ -10,7 +10,7 @@
# is required for users to be able to include any public header and then override
# the function using a strong definition.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
diff --git a/libcxx/test/libcxx/clang_modules_include.gen.py b/libcxx/test/libcxx/clang_modules_include.gen.py
index 26ef2077449b88..e3593eefad2fe9 100644
--- a/libcxx/test/libcxx/clang_modules_include.gen.py
+++ b/libcxx/test/libcxx/clang_modules_include.gen.py
@@ -10,7 +10,7 @@
# This is important notably because the LLDB data formatters use
# libc++ headers with modules enabled.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
diff --git a/libcxx/test/libcxx/clang_tidy.gen.py b/libcxx/test/libcxx/clang_tidy.gen.py
index b2f1a171507d11..19b6a999df6073 100644
--- a/libcxx/test/libcxx/clang_tidy.gen.py
+++ b/libcxx/test/libcxx/clang_tidy.gen.py
@@ -8,7 +8,7 @@
# Run our custom libc++ clang-tidy checks on all public headers.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
@@ -27,8 +27,8 @@
{lit_header_restrictions.get(header, '')}
// TODO: run clang-tidy with modules enabled once they are supported
-// RUN{BLOCKLIT}: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{{test-tools}}/clang_tidy_checks/libcxx-tidy.plugin -- %{{compile_flags}} -fno-modules
-// RUN{BLOCKLIT}: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx}}/.clang-tidy -- -Wweak-vtables %{{compile_flags}} -fno-modules
+// RUN{BLOCKLIT}: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- %{{compile_flags}} -fno-modules
+// RUN{BLOCKLIT}: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy -- -Wweak-vtables %{{compile_flags}} -fno-modules
#include <{header}>
""")
diff --git a/libcxx/test/libcxx/double_include.gen.py b/libcxx/test/libcxx/double_include.gen.py
index 85055dfc703de6..2fcfa50db693b4 100644
--- a/libcxx/test/libcxx/double_include.gen.py
+++ b/libcxx/test/libcxx/double_include.gen.py
@@ -8,7 +8,7 @@
# Test that we can include each header in two TU's and link them together.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
diff --git a/libcxx/test/libcxx/header_inclusions.gen.py b/libcxx/test/libcxx/header_inclusions.gen.py
index cdbc5b34b51525..faaa4cf8710c11 100644
--- a/libcxx/test/libcxx/header_inclusions.gen.py
+++ b/libcxx/test/libcxx/header_inclusions.gen.py
@@ -9,7 +9,7 @@
# Test that all headers include all the other headers they're supposed to, as
# prescribed by the Standard.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
diff --git a/libcxx/test/libcxx/headers_in_modulemap.sh.py b/libcxx/test/libcxx/headers_in_modulemap.sh.py
index fe007f02d34e7f..237b006115ccdf 100644
--- a/libcxx/test/libcxx/headers_in_modulemap.sh.py
+++ b/libcxx/test/libcxx/headers_in_modulemap.sh.py
@@ -1,4 +1,4 @@
-# RUN: %{python} %s %{libcxx}/utils %{include}
+# RUN: %{python} %s %{libcxx-dir}/utils %{include-dir}
import sys
diff --git a/libcxx/test/libcxx/libcpp_version.gen.py b/libcxx/test/libcxx/libcpp_version.gen.py
index 47439b08fe51b2..7d9519d58955b3 100644
--- a/libcxx/test/libcxx/libcpp_version.gen.py
+++ b/libcxx/test/libcxx/libcpp_version.gen.py
@@ -8,7 +8,7 @@
# Test that all headers define the _LIBCPP_VERSION macro.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
diff --git a/libcxx/test/libcxx/module_std.gen.py b/libcxx/test/libcxx/module_std.gen.py
index a9a05a0cd74e61..fc23985caf30de 100644
--- a/libcxx/test/libcxx/module_std.gen.py
+++ b/libcxx/test/libcxx/module_std.gen.py
@@ -16,7 +16,7 @@
# to be one monolitic test. Since the test doesn't take very long it's
# not a huge issue.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
@@ -25,9 +25,9 @@
generator = module_test_generator(
"%t",
- "%{module}",
+ "%{module-dir}",
"%{clang-tidy}",
- "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
+ "%{test-tools-dir}/clang_tidy_checks/libcxx-tidy.plugin",
"%{cxx}",
"%{flags} %{compile_flags}",
"std",
diff --git a/libcxx/test/libcxx/module_std_compat.gen.py b/libcxx/test/libcxx/module_std_compat.gen.py
index 270d131779e5bf..000aa299861220 100644
--- a/libcxx/test/libcxx/module_std_compat.gen.py
+++ b/libcxx/test/libcxx/module_std_compat.gen.py
@@ -16,7 +16,7 @@
# to be one monolitic test. Since the test doesn't take very long it's
# not a huge issue.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
@@ -26,9 +26,9 @@
generator = module_test_generator(
"%t",
- "%{module}",
+ "%{module-dir}",
"%{clang-tidy}",
- "%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin",
+ "%{test-tools-dir}/clang_tidy_checks/libcxx-tidy.plugin",
"%{cxx}",
"%{flags} %{compile_flags}",
"std.compat",
diff --git a/libcxx/test/libcxx/no_assert_include.gen.py b/libcxx/test/libcxx/no_assert_include.gen.py
index a5e733d2b48a19..dd8006df937647 100644
--- a/libcxx/test/libcxx/no_assert_include.gen.py
+++ b/libcxx/test/libcxx/no_assert_include.gen.py
@@ -9,7 +9,7 @@
# Ensure that none of the standard C++ headers implicitly include cassert or
# assert.h (because assert() is implemented as a macro).
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
diff --git a/libcxx/test/libcxx/system_reserved_names.gen.py b/libcxx/test/libcxx/system_reserved_names.gen.py
index 5b75dba544ef20..0d935a18addeee 100644
--- a/libcxx/test/libcxx/system_reserved_names.gen.py
+++ b/libcxx/test/libcxx/system_reserved_names.gen.py
@@ -10,7 +10,7 @@
# alphabetic macros. Also ensure that we don't swallow the definition of user
# provided macros (in other words, ensure that we push/pop correctly everywhere).
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
diff --git a/libcxx/test/libcxx/transitive_includes.gen.py b/libcxx/test/libcxx/transitive_includes.gen.py
index 43f92d9c0cfcd6..28f223c422a9b0 100644
--- a/libcxx/test/libcxx/transitive_includes.gen.py
+++ b/libcxx/test/libcxx/transitive_includes.gen.py
@@ -16,7 +16,7 @@
# forever, however we do try to group removals for a couple of releases
# to avoid breaking users at every release.
-# RUN: %{python} %s %{libcxx}/utils
+# RUN: %{python} %s %{libcxx-dir}/utils
import sys
sys.path.append(sys.argv[1])
@@ -48,7 +48,7 @@
all_traces.append(f'%t/trace-includes.{normalized_header}.txt')
print(f"""\
-// RUN{BLOCKLIT}: %{{python}} %{{libcxx}}/test/libcxx/transitive_includes_to_csv.py {' '.join(all_traces)} > %{{libcxx}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv
+// RUN{BLOCKLIT}: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py {' '.join(all_traces)} > %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv
""")
else:
@@ -83,8 +83,8 @@
// RUN{BLOCKLIT}: mkdir %t
// RUN{BLOCKLIT}: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
-// RUN{BLOCKLIT}: %{{python}} %{{libcxx}}/test/libcxx/transitive_includes_to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
-// RUN{BLOCKLIT}: cat %{{libcxx}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv
+// RUN{BLOCKLIT}: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
+// RUN{BLOCKLIT}: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv
// RUN{BLOCKLIT}:
diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv
#include <{header}>
""")
diff --git a/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp b/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
index 6c84e0dfff2bab..3e2e080368f4c2 100644
--- a/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
+++ b/libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
@@ -13,17 +13,17 @@
// Make sure we install the libc++ headers in the right location.
//
-// RUN: stat "%{include}/__config"
+// RUN: stat "%{include-dir}/__config"
// Make sure we install libc++.1.dylib and libc++experimental.a in the right location.
//
-// RUN: stat "%{lib}/libc++.1.dylib"
-// RUN: stat "%{lib}/libc++experimental.a"
+// RUN: stat "%{lib-dir}/libc++.1.dylib"
+// RUN: stat "%{lib-dir}/libc++experimental.a"
// Make sure we install a symlink from libc++.dylib to libc++.1.dylib.
//
-// RUN: stat "%{lib}/libc++.dylib"
-// RUN: readlink "%{lib}/libc++.dylib" | grep "libc++.1.dylib"
+// RUN: stat "%{lib-dir}/libc++.dylib"
+// RUN: readlink "%{lib-dir}/libc++.dylib" | grep "libc++.1.dylib"
// Make sure the install_name is /usr/lib.
//
@@ -34,15 +34,15 @@
//
// TODO: We currently don't do that correctly in the CMake build.
//
-// XRUNX: otool -L "%{lib}/libc++.1.dylib" | grep '/usr/lib/libc++.1.dylib'
-// XRUNX: ! otool -l "%{lib}/libc++.1.dylib" | grep -E "LC_RPATH|@loader_path|@rpath"
+// XRUNX: otool -L "%{lib-dir}/libc++.1.dylib" | grep '/usr/lib/libc++.1.dylib'
+// XRUNX: ! otool -l "%{lib-dir}/libc++.1.dylib" | grep -E "LC_RPATH|@loader_path|@rpath"
// Make sure the compatibility_version of libc++ is 1.0.0.
// Failure to respect this can result in applications not being able to find libc++
// when they are loaded by dyld, if the compatibility version was bumped.
//
-// RUN: otool -L "%{lib}/libc++.1.dylib" | grep "libc++.1.dylib" | grep "compatibility version 1.0.0"
+// RUN: otool -L "%{lib-dir}/libc++.1.dylib" | grep "libc++.1.dylib" | grep "compatibility version 1.0.0"
// Make sure we use the libdispatch backend for the PSTL.
//
-// RUN: grep "%{include}/__config_site" -e '#define _LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH'
+// RUN: grep "%{include-dir}/__config_site" -e '#define _LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH'
diff --git a/libcxx/test/libcxx/vendor/clang-cl/static-lib-exports.sh.cpp b/libcxx/test/libcxx/vendor/clang-cl/static-lib-exports.sh.cpp
index 447454ee229ca2..7ed14921b10679 100644
--- a/libcxx/test/libcxx/vendor/clang-cl/static-lib-exports.sh.cpp
+++ b/libcxx/test/libcxx/vendor/clang-cl/static-lib-exports.sh.cpp
@@ -11,6 +11,6 @@
// This file checks that the built static libraries don't contain dllexport
// directives in clang-cl builds.
-// RUN: llvm-readobj --coff-directives "%{lib}/libc++.lib" | not grep -i "export:" > /dev/null
+// RUN: llvm-readobj --coff-directives "%{lib-dir}/libc++.lib" | not grep -i "export:" > /dev/null
-// RUN: llvm-readobj --coff-directives "%{lib}/libc++experimental.lib" | not grep -i "export:" > /dev/null
+// RUN: llvm-readobj --coff-directives "%{lib-dir}/libc++experimental.lib" | not grep -i "export:" > /dev/null
diff --git a/libcxx/test/libcxx/vendor/mingw/static-lib-exports.sh.cpp b/libcxx/test/libcxx/vendor/mingw/static-lib-exports.sh.cpp
index 8f29f5ad051d4e..e20269f91e4851 100644
--- a/libcxx/test/libcxx/vendor/mingw/static-lib-exports.sh.cpp
+++ b/libcxx/test/libcxx/vendor/mingw/static-lib-exports.sh.cpp
@@ -11,6 +11,6 @@
// This file checks that the built static libraries don't contain dllexport
// directives in MinGW builds.
-// RUN: llvm-readobj --coff-directives "%{lib}/libc++.a" | not grep -i "export:" > /dev/null
+// RUN: llvm-readobj --coff-directives "%{lib-dir}/libc++.a" | not grep -i "export:" > /dev/null
-// RUN: llvm-readobj --coff-directives "%{lib}/libc++experimental.a" | not grep -i "export:" > /dev/null
+// RUN: llvm-readobj --coff-directives "%{lib-dir}/libc++experimental.a" | not grep -i "export:" > /dev/null
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index a9fb64a8ce190c..6ef40755c59d97 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -27,7 +27,7 @@
def _getSuitableClangTidy(cfg):
try:
# If we didn't build the libcxx-tidy plugin via CMake, we can't run the clang-tidy tests.
- if runScriptExitCode(cfg, ["stat %{test-tools}/clang_tidy_checks/libcxx-tidy.plugin"]) != 0:
+ if runScriptExitCode(cfg, ["stat %{test-tools-dir}/clang_tidy_checks/libcxx-tidy.plugin"]) != 0:
return None
# TODO MODULES require ToT due module specific fixes.
diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 13175214879c41..229da224994f43 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -172,7 +172,7 @@ def parseScript(test, preamble):
f"{compileFlags} "
"-Wno-reserved-module-identifier -Wno-reserved-user-defined-literal "
"-fmodule-file=std=%T/std.pcm " # The std.compat module imports std.
- "--precompile -o %T/std.compat.pcm -c %{module}/std.compat.cppm",
+ "--precompile -o %T/std.compat.pcm -c %{module-dir}/std.compat.cppm",
)
moduleCompileFlags.extend(
["-fmodule-file=std.compat=%T/std.compat.pcm", "%T/std.compat.pcm"]
@@ -188,7 +188,7 @@ def parseScript(test, preamble):
"%dbg(MODULE std) %{cxx} %{flags} "
f"{compileFlags} "
"-Wno-reserved-module-identifier -Wno-reserved-user-defined-literal "
- "--precompile -o %T/std.pcm -c %{module}/std.cppm",
+ "--precompile -o %T/std.pcm -c %{module-dir}/std.cppm",
)
moduleCompileFlags.extend(["-fmodule-file=std=%T/std.pcm", "%T/std.pcm"])
More information about the libcxx-commits
mailing list