[PATCH] D91620: [compiler-rt][test] Heed COMPILER_RT_DEBUG when compiling unittests
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 23:32:15 PST 2020
vitalybuka added inline comments.
================
Comment at: compiler-rt/lib/asan/tests/CMakeLists.txt:43
+if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang" AND NOT COMPILER_RT_DEBUG)
list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -gline-tables-only)
+elseif(COMPILER_RT_DEBUG)
----------------
ro wrote:
> vitalybuka wrote:
> > why do we need this after list(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS -gline-tables-only) above
> AFAICS `COMPILER_RT_TEST_COMPILER_CFLAGS` is only used in `compiler-rt/test/*` (via `get_test_cc_for_arch`) whereas `ASAN_UNITTEST_COMMON_CFLAGS` is used in `compiler-rt/lib/asan/test`. Pretty confusing IMO ;-)
Maybe better to update COMPILER_RT_UNITTEST_CFLAGS where we update COMPILER_RT_TEST_COMPILER_CFLAGS
and remove all following blocks
```
if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang" AND NOT COMPILER_RT_DEBUG)
list(APPEND *_TEST_CFLAGS_COMMON -gline-tables-only)
elseif(COMPILER_RT_DEBUG)
# -g3 already in COMPILER_RT_UNITEST_CFLAGS.
else()
list(APPEND *_TEST_CFLAGS_COMMON -g)
endif()
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91620/new/
https://reviews.llvm.org/D91620
More information about the llvm-commits
mailing list