[all-commits] [llvm/llvm-project] 93b125: [compiler-rt][test] Heed COMPILER_RT_DEBUG when co...

rorth via All-commits all-commits at lists.llvm.org
Wed Oct 5 00:54:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 93b1256e38f63a81561288b9a90c5d52af63cb6e
      https://github.com/llvm/llvm-project/commit/93b1256e38f63a81561288b9a90c5d52af63cb6e
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2022-10-05 (Wed, 05 Oct 2022)

  Changed paths:
    M compiler-rt/CMakeLists.txt
    M compiler-rt/lib/asan/tests/CMakeLists.txt
    M compiler-rt/lib/fuzzer/tests/CMakeLists.txt
    M compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
    M compiler-rt/lib/interception/tests/CMakeLists.txt
    M compiler-rt/lib/msan/tests/CMakeLists.txt
    M compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
    M compiler-rt/lib/sanitizer_common/tests/sanitizer_type_traits_test.cpp

  Log Message:
  -----------
  [compiler-rt][test] Heed COMPILER_RT_DEBUG when compiling unittests

When trying to debug some `compiler-rt` unittests, I initially had a hard
time because

- even in a `Debug` build one needs to set `COMPILER_RT_DEBUG` to get
  debugging info for some of the code and
- even so the unittests used a hardcoded `-O2` which often makes debugging
  impossible.

This patch addresses this by instead using `-O0` if `COMPILER_RT_DEBUG`.
Two tests in `sanitizer_type_traits_test.cpp` need to be disabled since
they have undefined references to `__sanitizer::integral_constant<bool,
true>::value`.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

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




More information about the All-commits mailing list