[libunwind] Add a from-scratch config for running libunwind tests

Running tests for libunwind is a lot simpler than running tests for
libc++, so a simple Lit config file is sufficient. The benefit is that
we disentangle the libunwind test configuration from the libc++ and
libc++abi test configuration. The setup was too complicated, which led
to some bugs (notably we were running against the system libunwind on
Apple platforms).

Differential Revision: https://reviews.llvm.org/D111664
This commit is contained in:
Louis Dionne 2021-10-12 12:46:21 -04:00
parent cf68e1b2fb
commit 6fd55bba61
12 changed files with 212 additions and 62 deletions

View File

@ -199,102 +199,117 @@ check-generated-output)
generic-cxx03) generic-cxx03)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-cxx11) generic-cxx11)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-cxx14) generic-cxx14)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-cxx17) generic-cxx17)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-cxx20) generic-cxx20)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-cxx2b) generic-cxx2b)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-assertions) generic-assertions)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-debug-iterators) generic-debug-iterators)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
check-abi-list check-abi-list
;; ;;
generic-noexceptions) generic-noexceptions)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-modules) generic-modules)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-static) generic-static)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-static.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-32bit) generic-32bit)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-32bits.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-32bits.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-clang-11) generic-clang-11)
export CC=clang-11 export CC=clang-11
export CXX=clang++-11 export CXX=clang++-11
clean clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-clang-12) generic-clang-12)
export CC=clang-12 export CC=clang-12
export CXX=clang++-12 export CXX=clang++-12
clean clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-gcc) generic-gcc)
export CC=gcc-11 export CC=gcc-11
export CXX=g++-11 export CXX=g++-11
clean clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-gcc-cxx11) generic-gcc-cxx11)
@ -302,79 +317,92 @@ generic-gcc-cxx11)
export CXX=g++-11 export CXX=g++-11
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-asan) generic-asan)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-msan) generic-msan)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-tsan) generic-tsan)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-ubsan) generic-ubsan)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-with_llvm_unwinder) generic-with_llvm_unwinder)
clean clean
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-singlethreaded) generic-singlethreaded)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-no-debug) generic-no-debug)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-no-filesystem) generic-no-filesystem)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-no-random_device) generic-no-random_device)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-no-localization) generic-no-localization)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-no-unicode) generic-no-unicode)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
generic-no-wide-characters) generic-no-wide-characters)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
apple-system) apple-system)
@ -427,7 +455,8 @@ apple-system-backdeployment-*)
;; ;;
benchmarks) benchmarks)
clean clean
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-cxx-benchmarks check-cxx-benchmarks
;; ;;
documentation) documentation)
@ -456,7 +485,8 @@ runtimes-build)
-DLLVM_RUNTIME_TARGETS="x86_64-unknown-linux-gnu" \ -DLLVM_RUNTIME_TARGETS="x86_64-unknown-linux-gnu" \
-DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_ENABLE_ASSERTIONS=ON \
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
echo "+++ Running the libc++ and libc++abi tests" echo "+++ Running the libc++ and libc++abi tests"
${NINJA} -C "${BUILD_DIR}" check-runtimes ${NINJA} -C "${BUILD_DIR}" check-runtimes
@ -528,7 +558,8 @@ legacy-standalone)
aarch64) aarch64)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
aarch64-noexceptions) aarch64-noexceptions)
@ -536,33 +567,38 @@ aarch64-noexceptions)
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
# Aka Armv8 32 bit # Aka Armv8 32 bit
armv8) armv8)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
armv8-noexceptions) armv8-noexceptions)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
# Armv7 32 bit. One building Arm only one Thumb only code. # Armv7 32 bit. One building Arm only one Thumb only code.
armv7) armv7)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
armv7-noexceptions) armv7-noexceptions)
clean clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
check-runtimes check-runtimes
;; ;;
windows-dll) windows-dll)

View File

@ -194,15 +194,20 @@ def compilerMacros(config, flags=''):
If the optional `flags` argument (a string) is provided, these flags will If the optional `flags` argument (a string) is provided, these flags will
be added to the compiler invocation when generating the macros. be added to the compiler invocation when generating the macros.
If we fail to extract the compiler macros because of a compiler error, None
is returned instead.
""" """
with _makeConfigTest(config) as test: with _makeConfigTest(config) as test:
with open(test.getSourcePath(), 'w') as sourceFile: with open(test.getSourcePath(), 'w') as sourceFile:
# Make sure files like <__config> are included, since they can define # Make sure files like <__config> are included, since they can define
# additional macros. # additional macros.
sourceFile.write("#include <cstddef>") sourceFile.write("#include <stddef.h>")
unparsedOutput, err, exitCode, timeoutInfo = _executeScriptInternal(test, [ unparsedOutput, err, exitCode, timeoutInfo = _executeScriptInternal(test, [
"%{{cxx}} %s -dM -E %{{flags}} %{{compile_flags}} {}".format(flags) "%{{cxx}} %s -dM -E %{{flags}} %{{compile_flags}} {}".format(flags)
]) ])
if exitCode != 0:
return None
parsedMacros = dict() parsedMacros = dict()
defines = (l.strip() for l in unparsedOutput.split('\n') if l.startswith('#define ')) defines = (l.strip() for l in unparsedOutput.split('\n') if l.startswith('#define '))
for line in defines: for line in defines:

View File

@ -89,9 +89,9 @@ set(LIBUNWIND_TEST_COMPILER_FLAGS "" CACHE STRING
"Additional compiler flags for test programs.") "Additional compiler flags for test programs.")
set(LIBUNWIND_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING set(LIBUNWIND_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING
"The path to the Lit testing configuration to use when running the tests. "The path to the Lit testing configuration to use when running the tests.
If a relative path is provided, it is assumed to be relative to '<monorepo>/libcxx/test/configs'.") If a relative path is provided, it is assumed to be relative to '<monorepo>/libunwind/test/configs'.")
if (NOT IS_ABSOLUTE "${LIBUNWIND_TEST_CONFIG}") if (NOT IS_ABSOLUTE "${LIBUNWIND_TEST_CONFIG}")
set(LIBUNWIND_TEST_CONFIG "${LIBUNWIND_LIBCXX_PATH}/test/configs/${LIBUNWIND_TEST_CONFIG}") set(LIBUNWIND_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/${LIBUNWIND_TEST_CONFIG}")
endif() endif()
set(LIBUNWIND_TEST_PARAMS "" CACHE STRING set(LIBUNWIND_TEST_PARAMS "" CACHE STRING
"A list of parameters to run the Lit test suite with.") "A list of parameters to run the Lit test suite with.")

View File

@ -0,0 +1,64 @@
@AUTO_GEN_COMMENT@
@SERIALIZED_LIT_PARAMS@
#
# Configuration file for running the libunwind tests against the shared library.
#
# This file is a lot simpler than the ones for libc++ and libc++abi because
# while libunwind is written in C++, it doesn't use the C++ Standard Library
# so we don't need to set that up to run the tests correctly.
#
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.format
# Basic configuration of the test suite
config.name = os.path.basename('@LIBUNWIND_TEST_CONFIG@')
config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
config.test_exec_root = '@CMAKE_BINARY_DIR@'
compile_flags = []
link_flags = []
if @LIBUNWIND_USES_ARM_EHABI@:
config.available_features.add('libunwind-arm-ehabi')
if not @LIBUNWIND_ENABLE_THREADS@:
compile_flags.append('-D_LIBUNWIND_HAS_NO_THREADS')
config.available_features.add('libunwind-no-threads')
if @LIBUNWIND_ENABLE_CET@:
compile_flags.append('-fcf-protection=full')
if '@CMAKE_SYSTEM_NAME@' == 'Linux':
link_flags.append('-Wl,--export-dynamic')
# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
compile_flags.append('-funwind-tables')
config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I {}/include {}'.format('@LIBUNWIND_SOURCE_DIR@', ' '.join(compile_flags))
))
config.substitutions.append(('%{link_flags}',
'-nodefaultlibs -L {0}/lib -Wl,-rpath,{0}/lib -lunwind -ldl -lc {1}'.format('@CMAKE_BINARY_DIR@', ' '.join(link_flags))
))
config.substitutions.append(('%{exec}',
'{} {}/utils/run.py --execdir %T -- '.format(sys.executable, '@LIBUNWIND_LIBCXX_PATH@')
))
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
libcxx.test.newconfig.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)

View File

@ -0,0 +1,66 @@
@AUTO_GEN_COMMENT@
@SERIALIZED_LIT_PARAMS@
#
# Configuration file for running the libunwind tests against the static library.
#
# This file is a lot simpler than the ones for libc++ and libc++abi because
# while libunwind is written in C++, it doesn't use the C++ Standard Library
# so we don't need to set that up to run the tests correctly.
#
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.format
# Basic configuration of the test suite
config.name = os.path.basename('@LIBUNWIND_TEST_CONFIG@')
config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
config.test_exec_root = '@CMAKE_BINARY_DIR@'
compile_flags = []
link_flags = []
if @LIBUNWIND_USES_ARM_EHABI@:
config.available_features.add('libunwind-arm-ehabi')
if not @LIBUNWIND_ENABLE_THREADS@:
compile_flags.append('-D_LIBUNWIND_HAS_NO_THREADS')
config.available_features.add('libunwind-no-threads')
else:
link_flags.append('-lpthread')
if @LIBUNWIND_ENABLE_CET@:
compile_flags.append('-fcf-protection=full')
if '@CMAKE_SYSTEM_NAME@' == 'Linux':
link_flags.append('-Wl,--export-dynamic')
# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
compile_flags.append('-funwind-tables')
config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I {}/include {}'.format('@LIBUNWIND_SOURCE_DIR@', ' '.join(compile_flags))
))
config.substitutions.append(('%{link_flags}',
'-nodefaultlibs {}/lib/libunwind.a -ldl -lc {}'.format('@CMAKE_BINARY_DIR@', ' '.join(link_flags))
))
config.substitutions.append(('%{exec}',
'{} {}/utils/run.py --execdir %T -- '.format(sys.executable, '@LIBUNWIND_LIBCXX_PATH@')
))
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
libcxx.test.newconfig.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)

View File

@ -12,9 +12,6 @@
// TODO: Investigate these failures // TODO: Investigate these failures
// XFAIL: asan, tsan, ubsan // XFAIL: asan, tsan, ubsan
// TODO: Investigate this failure
// XFAIL: 32bits-on-64bits
// Basic test for _Unwind_ForcedUnwind. // Basic test for _Unwind_ForcedUnwind.
// See libcxxabi/test/forced_unwind* tests too. // See libcxxabi/test/forced_unwind* tests too.

View File

@ -1,9 +1,6 @@
// TODO: Investigate these failures // TODO: Investigate these failures
// XFAIL: asan, tsan, ubsan // 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 // The other libunwind tests don't test internal interfaces, so the include path
// is a little wonky. // is a little wonky.
#include "../src/config.h" #include "../src/config.h"

View File

@ -1,11 +1,8 @@
// TODO: Investigate these failures // TODO: Investigate these failures
// XFAIL: asan, tsan, ubsan // XFAIL: asan, tsan, ubsan
// TODO: Investigate these failures on x86_64 macOS // TODO: Investigate these failures on x86_64 macOS back deployment
// XFAIL: target=x86_64-apple-darwin{{.+}} // UNSUPPORTED: target=x86_64-apple-darwin{{.+}}
// TODO: Investigate this failure
// XFAIL: 32bits-on-64bits
#include <libunwind.h> #include <libunwind.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -1,9 +1,6 @@
// TODO: Investigate these failures // TODO: Investigate these failures
// XFAIL: asan, tsan, ubsan // XFAIL: asan, tsan, ubsan
// TODO: Investigate this failure
// XFAIL: 32bits-on-64bits
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <unwind.h> #include <unwind.h>

View File

@ -15,9 +15,6 @@
// TODO: Investigate this failure on macOS // TODO: Investigate this failure on macOS
// XFAIL: target={{.+}}-apple-darwin{{.+}} // XFAIL: target={{.+}}-apple-darwin{{.+}}
// TODO: Investigate this failure
// XFAIL: 32bits-on-64bits
// UNSUPPORTED: libunwind-arm-ehabi // UNSUPPORTED: libunwind-arm-ehabi
#include <assert.h> #include <assert.h>

View File

@ -13,9 +13,6 @@
// TODO: Investigate these failures // TODO: Investigate these failures
// XFAIL: asan, tsan, ubsan // XFAIL: asan, tsan, ubsan
// TODO: Investigate this failure
// XFAIL: 32bits-on-64bits
#include <assert.h> #include <assert.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <signal.h> #include <signal.h>

View File

@ -13,9 +13,6 @@
// TODO: Investigate these failures // TODO: Investigate these failures
// XFAIL: asan, tsan, ubsan // XFAIL: asan, tsan, ubsan
// TODO: Investigate this failure
// XFAIL: 32bits-on-64bits
#include <assert.h> #include <assert.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <signal.h> #include <signal.h>