-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++/libc++abi/libunwind] Add new test configs for Clang runtime library. NFC. #82734
base: main
Are you sure you want to change the base?
[libc++/libc++abi/libunwind] Add new test configs for Clang runtime library. NFC. #82734
Conversation
…ibrary. NFC. These configurations use the target "just-built" Clang's runtime library (clang_rt.builtins) to link the tests.
@llvm/pr-subscribers-libcxx @llvm/pr-subscribers-libcxxabi Author: Vladimir Vereschaka (vvereschaka) ChangesThese configurations use the target "just-built" Clang's runtime library (clang_rt.builtins) to link the tests. Full diff: https://github.com/llvm/llvm-project/pull/82734.diff 3 Files Affected:
diff --git a/libcxx/test/configs/llvm-libc++-static-clang-rt.cfg.in b/libcxx/test/configs/llvm-libc++-static-clang-rt.cfg.in
new file mode 100644
index 00000000000000..ce6680ddc2908d
--- /dev/null
+++ b/libcxx/test/configs/llvm-libc++-static-clang-rt.cfg.in
@@ -0,0 +1,32 @@
+# This testing configuration handles running the test suite against LLVM's libc++
+# using a static library.
+#
+# This configuration uses a 'just-built' Clang runtime builtins library to link with
+# the tests instead of the target system library.
+#
+# Provided for testing of the LLVM/Clang toolchain builds.
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',
+ '-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')
+))
+config.substitutions.append(('%{compile_flags}',
+ '-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I %{libcxx-dir}/test/support'
+))
+config.substitutions.append(('%{link_flags}',
+ '-nostdlib++ -L %{lib-dir} -lclang_rt.builtins -lc++ -lc++abi'
+))
+config.substitutions.append(('%{exec}',
+ '%{executor} --execdir %T -- '
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ config,
+ lit_config
+)
diff --git a/libcxxabi/test/configs/llvm-libc++abi-static-clang-rt.cfg.in b/libcxxabi/test/configs/llvm-libc++abi-static-clang-rt.cfg.in
new file mode 100644
index 00000000000000..11b89e22fca9d6
--- /dev/null
+++ b/libcxxabi/test/configs/llvm-libc++abi-static-clang-rt.cfg.in
@@ -0,0 +1,32 @@
+# This testing configuration handles running the test suite against LLVM's libc++abi
+# using a static library.
+#
+# This configuration uses a 'just-built' Clang runtime builtins library to link with
+# the tests instead of the target system library.
+#
+# Provided for testing of the LLVM/Clang toolchain builds.
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',
+ '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
+))
+config.substitutions.append(('%{compile_flags}',
+ '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
+))
+config.substitutions.append(('%{link_flags}',
+ '-nostdlib++ -L %{lib} -lclang_rt.builtins -lc++ -lc++abi -pthread'
+))
+config.substitutions.append(('%{exec}',
+ '%{executor} --execdir %T -- '
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ config,
+ lit_config
+)
diff --git a/libunwind/test/configs/llvm-libunwind-static-clang-rt.cfg.in b/libunwind/test/configs/llvm-libunwind-static-clang-rt.cfg.in
new file mode 100644
index 00000000000000..d908a5d55c891c
--- /dev/null
+++ b/libunwind/test/configs/llvm-libunwind-static-clang-rt.cfg.in
@@ -0,0 +1,51 @@
+# Configuration file for running the libunwind tests against the static library.
+#
+# This configuration uses a 'just-built' Clang runtime builtins library to link with
+# the tests instead of the target system library.
+#
+# Provided for testing of the LLVM/Clang toolchain builds.
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+compile_flags = []
+link_flags = ['-lclang_rt.builtins']
+
+if @LIBUNWIND_ENABLE_THREADS@:
+ link_flags.append('-lpthread')
+
+if @LIBUNWIND_ENABLE_CET@:
+ compile_flags.append('-fcf-protection=full')
+
+# On ELF platforms, link tests with -Wl,--export-dynamic if supported by the linker.
+if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'):
+ link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@')
+
+if '@CMAKE_DL_LIBS@':
+ link_flags.append('-l@CMAKE_DL_LIBS@')
+
+# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
+compile_flags.append('-funwind-tables')
+
+local_sysroot = '@CMAKE_OSX_SYSROOT@' or '@CMAKE_SYSROOT@'
+config.substitutions.append(('%{flags}',
+ '-isysroot {}'.format(local_sysroot) if local_sysroot else ''
+))
+config.substitutions.append(('%{compile_flags}',
+ '-nostdinc++ -I %{{include}} {}'.format(' '.join(compile_flags))
+))
+config.substitutions.append(('%{link_flags}',
+ '%{{lib}}/libunwind.a {}'.format(' '.join(link_flags))
+))
+config.substitutions.append(('%{exec}',
+ '%{executor} --execdir %T -- '
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ config,
+ lit_config
+)
|
Also it fixes the |
@ldionne , would take a quick look? These test configurations are based on the default llvm test configurations for the static libraries, but just added |
These configurations use the target "just-built" Clang's runtime library (clang_rt.builtins) to link the tests.