[libunwind] b25e989 - [libunwind] [test] Add a mingw specific test config file

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 01:09:27 PDT 2023


Author: Martin Storsjö
Date: 2023-04-06T11:07:41+03:00
New Revision: b25e989e68372ab604e6da1934e51344880db87c

URL: https://github.com/llvm/llvm-project/commit/b25e989e68372ab604e6da1934e51344880db87c
DIFF: https://github.com/llvm/llvm-project/commit/b25e989e68372ab604e6da1934e51344880db87c.diff

LOG: [libunwind] [test] Add a mingw specific test config file

This matches how it is done for libcxx and libcxxabi.

Differential Revision: https://reviews.llvm.org/D147633

Added: 
    libunwind/test/configs/llvm-libunwind-mingw.cfg.in

Modified: 
    libunwind/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 647b1c41955b5..6f12a160307d1 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -67,7 +67,9 @@ if(LIBUNWIND_SYSROOT OR LIBUNWIND_TARGET_TRIPLE OR LIBUNWIND_GCC_TOOLCHAIN)
   message(WARNING "LIBUNWIND_SYSROOT, LIBUNWIND_TARGET_TRIPLE and LIBUNWIND_GCC_TOOLCHAIN are not supported anymore, please use the native CMake equivalents instead")
 endif()
 
-if (LIBUNWIND_ENABLE_SHARED)
+if(MINGW)
+  set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-mingw.cfg.in")
+elseif (LIBUNWIND_ENABLE_SHARED)
   set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-shared.cfg.in")
 else()
   set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-static.cfg.in")

diff  --git a/libunwind/test/configs/llvm-libunwind-mingw.cfg.in b/libunwind/test/configs/llvm-libunwind-mingw.cfg.in
new file mode 100644
index 0000000000000..99d0aac9015ca
--- /dev/null
+++ b/libunwind/test/configs/llvm-libunwind-mingw.cfg.in
@@ -0,0 +1,25 @@
+# This testing configuration handles running the test suite against LLVM's libunwind
+# using either a DLL or a static library, with MinGW/Clang on Windows.
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -I %{include} -funwind-tables'
+))
+config.substitutions.append(('%{link_flags}',
+    '-L %{lib} -lunwind'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T --env PATH=%{lib} -- '
+))
+
+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
+)


        


More information about the cfe-commits mailing list