[compiler-rt] Fix passing debug information to unittest.

Summary:
On windows, the debug information was not present in the unittest executables,
which make them hard to debug.

The Sanitizer Unittests are compiled with a local clang build.
The link pass is also done by calling clang.

This pass is adding the appropriate flags to bring the right debug information
to these executables.

Reviewers: rnk

Subscribers: kubabrecka, llvm-commits, wang0109, chrisha

Differential Revision: http://reviews.llvm.org/D21838

llvm-svn: 274153
This commit is contained in:
Etienne Bergeron 2016-06-29 19:58:02 +00:00
parent 8e10380b73
commit f1d4e44d61
2 changed files with 8 additions and 0 deletions

View File

@ -45,6 +45,10 @@ if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang")
else()
list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -g)
endif()
if(MSVC)
list(APPEND SANITIZER_TEST_CFLAGS_COMMON -gcodeview)
endif()
list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -g)
# Use -D instead of definitions to please custom compile command.
list(APPEND ASAN_UNITTEST_COMMON_CFLAGS

View File

@ -65,6 +65,10 @@ if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang")
else()
list(APPEND SANITIZER_TEST_CFLAGS_COMMON -g)
endif()
if(MSVC)
list(APPEND SANITIZER_TEST_CFLAGS_COMMON -gcodeview)
endif()
list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -g)
if(NOT MSVC)
list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON --driver-mode=g++)