[libcxx-commits] [libcxx] 60fe1f5 - [runtimes][ci] Run the tests for libunwind in the CI

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 6 08:25:37 PDT 2021


Author: Louis Dionne
Date: 2021-10-06T11:25:26-04:00
New Revision: 60fe1f59d08b815a280761e625d12a74a501f444

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

LOG: [runtimes][ci] Run the tests for libunwind in the CI

We should arguably have always been doing that. The state of libunwind
is quite sad, so this commit adds several XFAILs to make the CI pass.
We need to investigate why so many tests are not passing in some
configurations, but I'll defer that to folks who actually work on
libunwind for lack of bandwidth.

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

Added: 
    

Modified: 
    libcxx/utils/ci/run-buildbot
    libcxx/utils/libcxx/test/params.py
    libunwind/test/forceunwind.pass.cpp
    libunwind/test/frameheadercache_test.pass.cpp
    libunwind/test/libunwind_01.pass.cpp
    libunwind/test/libunwind_02.pass.cpp
    libunwind/test/remember_state_leak.pass.sh.s
    libunwind/test/signal_frame.pass.cpp
    libunwind/test/signal_unwind.pass.cpp
    libunwind/test/unw_getcontext.pass.cpp
    libunwind/test/unwind_leaffunction.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 5ac0a39a53a7..5c97aef605c5 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -113,15 +113,18 @@ function generate-cmake-libcxx-win() {
           "${@}"
 }
 
-function check-cxx-cxxabi() {
-    echo "--- Installing libc++ and libc++abi to a fake location"
-    ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi
+function check-runtimes() {
+    echo "--- Installing libc++, libc++abi and libunwind to a fake location"
+    ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi install-unwind
 
     echo "+++ Running the libc++ tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxx
 
     echo "+++ Running the libc++abi tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxxabi
+
+    echo "+++ Running the libunwind tests"
+    ${NINJA} -vC "${BUILD_DIR}" check-unwind
 }
 
 # TODO: The goal is to test this against all configurations. We should also move
@@ -190,181 +193,181 @@ generic-cxx03)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-cxx11)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-cxx14)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-cxx17)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-cxx20)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-cxx2b)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-assertions)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-debug-iterators)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
     check-abi-list
 ;;
 generic-noexceptions)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-modules)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-static)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-32bit)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-32bits.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-clang-11)
     export CC=clang-11
     export CXX=clang++-11
     clean
     generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-clang-12)
     export CC=clang-12
     export CXX=clang++-12
     clean
     generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-gcc)
     export CC=gcc-11
     export CXX=g++-11
     clean
     generate-cmake
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-gcc-cxx11)
     export CC=gcc-11
     export CXX=g++-11
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-asan)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-msan)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-tsan)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-ubsan)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-with_llvm_unwinder)
     clean
     generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-singlethreaded)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-no-debug)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-no-filesystem)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-no-random_device)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-no-localization)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 generic-no-unicode)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 x86_64-apple-system)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
                    -DLIBCXX_TEST_CONFIG="apple-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 x86_64-apple-system-noexceptions)
     clean
@@ -372,7 +375,7 @@ x86_64-apple-system-noexceptions)
                    -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
                    -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
                    -DLIBCXX_TEST_CONFIG="apple-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 x86_64-apple-system-backdeployment-*)
     clean
@@ -401,7 +404,7 @@ x86_64-apple-system-backdeployment-*)
                    -DLIBCXX_TEST_PARAMS="${PARAMS}" \
                    -DLIBCXXABI_TEST_PARAMS="${PARAMS}"
 
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 benchmarks)
     clean
@@ -428,7 +431,7 @@ unified-standalone)
           -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind" \
           -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
 
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 new-standalone)
     clean
@@ -443,7 +446,7 @@ new-standalone)
           -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
           -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
 
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 runtimes-build)
     clean
@@ -475,7 +478,7 @@ runtimes-build)
 legacy-test-config)
     clean
     generate-cmake -DLIBCXX_TEST_CONFIG="legacy.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 legacy-standalone)
     clean
@@ -522,7 +525,7 @@ aarch64)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 aarch64-noexceptions)
     clean
@@ -530,33 +533,33 @@ aarch64-noexceptions)
                    -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
                    -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 # Aka Armv8 32 bit
 armv8)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 armv8-noexceptions)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 # Armv7 32 bit. One building Arm only one Thumb only code.
 armv7)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 armv7-noexceptions)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
-    check-cxx-cxxabi
+    check-runtimes
 ;;
 windows-dll)
     clean

diff  --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 5836c7760d9b..73dd544bed3d 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -176,7 +176,8 @@ def getStdFlag(cfg, std):
             help="Whether to build the test suite in 32 bit mode even on a 64 bit target. This basically controls "
                  "whether -m32 is used when building the test suite.",
             actions=lambda enabled: [] if not enabled else [
-              AddFlag('-m32')
+              AddFlag('-m32'),
+              AddFeature('32bits-on-64bits')
             ]),
 
   Parameter(name='additional_features', type=list, default=[],

diff  --git a/libunwind/test/forceunwind.pass.cpp b/libunwind/test/forceunwind.pass.cpp
index 466697264035..a3191f8f7460 100644
--- a/libunwind/test/forceunwind.pass.cpp
+++ b/libunwind/test/forceunwind.pass.cpp
@@ -9,6 +9,12 @@
 
 // REQUIRES: linux
 
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
 // Basic test for _Unwind_ForcedUnwind.
 // See libcxxabi/test/forced_unwind* tests too.
 

diff  --git a/libunwind/test/frameheadercache_test.pass.cpp b/libunwind/test/frameheadercache_test.pass.cpp
index 9abff5e8cda9..dd1d3dd93912 100644
--- a/libunwind/test/frameheadercache_test.pass.cpp
+++ b/libunwind/test/frameheadercache_test.pass.cpp
@@ -1,3 +1,9 @@
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
 // The other libunwind tests don't test internal interfaces, so the include path
 // is a little wonky.
 #include "../src/config.h"

diff  --git a/libunwind/test/libunwind_01.pass.cpp b/libunwind/test/libunwind_01.pass.cpp
index 277e3e6ded4f..aceb8bedf8e4 100644
--- a/libunwind/test/libunwind_01.pass.cpp
+++ b/libunwind/test/libunwind_01.pass.cpp
@@ -1,3 +1,12 @@
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate these failures on x86_64 macOS
+// XFAIL: target=x86_64-apple-darwin{{.+}}
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
 #include <libunwind.h>
 #include <stdlib.h>
 #include <string.h>

diff  --git a/libunwind/test/libunwind_02.pass.cpp b/libunwind/test/libunwind_02.pass.cpp
index b188fad8ee5b..64d8d5883132 100644
--- a/libunwind/test/libunwind_02.pass.cpp
+++ b/libunwind/test/libunwind_02.pass.cpp
@@ -1,3 +1,9 @@
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
 #include <assert.h>
 #include <stdlib.h>
 #include <unwind.h>

diff  --git a/libunwind/test/remember_state_leak.pass.sh.s b/libunwind/test/remember_state_leak.pass.sh.s
index f18d1768e7c4..fceac212c8a0 100644
--- a/libunwind/test/remember_state_leak.pass.sh.s
+++ b/libunwind/test/remember_state_leak.pass.sh.s
@@ -2,6 +2,15 @@
 # RUN: %{build}
 # RUN: %{run}
 
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
+# TODO: Investigate this failure on GCC.
+# XFAIL: gcc
+
 # The following assembly is a translation of this code:
 #
 #   _Unwind_Reason_Code callback(int, _Unwind_Action, long unsigned int,

diff  --git a/libunwind/test/signal_frame.pass.cpp b/libunwind/test/signal_frame.pass.cpp
index 28f8d99a6a65..fea189794bc2 100644
--- a/libunwind/test/signal_frame.pass.cpp
+++ b/libunwind/test/signal_frame.pass.cpp
@@ -9,6 +9,15 @@
 
 // Ensure that functions marked as signal frames are reported as such.
 
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate this failure on macOS
+// XFAIL: target={{.+}}-apple-darwin{{.+}}
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
 // UNSUPPORTED: libunwind-arm-ehabi
 
 #include <assert.h>

diff  --git a/libunwind/test/signal_unwind.pass.cpp b/libunwind/test/signal_unwind.pass.cpp
index c16adeb4d18c..5468c7f6724e 100644
--- a/libunwind/test/signal_unwind.pass.cpp
+++ b/libunwind/test/signal_unwind.pass.cpp
@@ -10,6 +10,12 @@
 // Ensure that the unwinder can cope with the signal handler.
 // REQUIRES: linux && (target={{aarch64-.+}} || target={{x86_64-.+}})
 
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
 #include <assert.h>
 #include <dlfcn.h>
 #include <signal.h>

diff  --git a/libunwind/test/unw_getcontext.pass.cpp b/libunwind/test/unw_getcontext.pass.cpp
index a1f2baee12b4..a02c8e54032a 100644
--- a/libunwind/test/unw_getcontext.pass.cpp
+++ b/libunwind/test/unw_getcontext.pass.cpp
@@ -1,3 +1,6 @@
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
 #include <assert.h>
 #include <libunwind.h>
 

diff  --git a/libunwind/test/unwind_leaffunction.pass.cpp b/libunwind/test/unwind_leaffunction.pass.cpp
index a05e315d9baf..8fc343304cde 100644
--- a/libunwind/test/unwind_leaffunction.pass.cpp
+++ b/libunwind/test/unwind_leaffunction.pass.cpp
@@ -10,6 +10,12 @@
 // Ensure that leaf function can be unwund.
 // REQUIRES: linux && (target={{aarch64-.+}} || target={{x86_64-.+}})
 
+// TODO: Investigate these failures
+// XFAIL: asan, tsan, ubsan
+
+// TODO: Investigate this failure
+// XFAIL: 32bits-on-64bits
+
 #include <assert.h>
 #include <dlfcn.h>
 #include <signal.h>


        


More information about the libcxx-commits mailing list