[CMake] Silence unused variable warning in compiler check

This is breaking the compiler check.

llvm-svn: 332936
This commit is contained in:
Petr Hosek 2018-05-22 02:53:32 +00:00
parent 0dd56dcdd4
commit 4ca5af0721
1 changed files with 2 additions and 2 deletions

View File

@ -131,11 +131,11 @@ macro(test_target_arch arch def)
if(SANITIZER_CXX_ABI_INTREE)
# We're using in tree C++ ABI, only test the C compiler for now.
set(TARGET_${arch}_FILENAME "${TARGET_${arch}_NAME}/CheckTarget.c")
file(WRITE "${TARGET_${arch}_FILENAME}" "#include <stdlib.h>\nint main() { void *p = malloc(1); return 0; }\n")
file(WRITE "${TARGET_${arch}_FILENAME}" "#include <stdlib.h>\nint main() { (void)malloc(sizeof(int)); return 0; }\n")
else()
# We're using the system C++ ABI, test that we can build C++ programs.
set(TARGET_${arch}_FILENAME "${TARGET_${arch}_NAME}/CheckTarget.cpp")
file(WRITE "${TARGET_${arch}_FILENAME}" "#include <new>\nint main() { int *p = new int; return 0; }\n")
file(WRITE "${TARGET_${arch}_FILENAME}" "#include <new>\nint main() { (void) new int; return 0; }\n")
endif()
set(TARGET_${arch}_CFLAGS ${ARGN})