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

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 08:21:49 PDT 2016


etienneb created this revision.
etienneb added a reviewer: rnk.
etienneb added subscribers: chrisha, wang0109, llvm-commits.
Herald added a subscriber: kubabrecka.

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.

http://reviews.llvm.org/D21838

Files:
  lib/asan/tests/CMakeLists.txt
  lib/sanitizer_common/tests/CMakeLists.txt

Index: lib/sanitizer_common/tests/CMakeLists.txt
===================================================================
--- lib/sanitizer_common/tests/CMakeLists.txt
+++ lib/sanitizer_common/tests/CMakeLists.txt
@@ -65,6 +65,10 @@
 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++)
Index: lib/asan/tests/CMakeLists.txt
===================================================================
--- lib/asan/tests/CMakeLists.txt
+++ lib/asan/tests/CMakeLists.txt
@@ -45,6 +45,10 @@
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21838.62223.patch
Type: text/x-patch
Size: 992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160629/a34acc6e/attachment.bin>


More information about the llvm-commits mailing list