[PATCH] D67093: [test-suite][WIP] Allow GCC to build test suite

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 05:39:10 PDT 2019


lenary created this revision.
lenary added a reviewer: asb.
Herald added subscribers: llvm-commits, jfb, mgorny.
Herald added a project: LLVM.

The (CMake-based) test suite has errors if you try to build it with
GCC. It seems useful to be able to test GCC with the relevant parts of the LLVM
test suite, just as it is relevant to run clang against the GCC torture suite.

This patch is an initial attempt to fix any build configuration issues
associated with running the lnt test suite with GCC.


Repository:
  rT test-suite

https://reviews.llvm.org/D67093

Files:
  CMakeLists.txt
  MultiSource/Benchmarks/7zip/CMakeLists.txt


Index: MultiSource/Benchmarks/7zip/CMakeLists.txt
===================================================================
--- MultiSource/Benchmarks/7zip/CMakeLists.txt
+++ MultiSource/Benchmarks/7zip/CMakeLists.txt
@@ -1,6 +1,9 @@
 set(RUN_OPTIONS b)
 list(APPEND CFLAGS -DBREAK_HANDLER -DUNICODE -D_UNICODE -I${CMAKE_CURRENT_SOURCE_DIR}/C -I${CMAKE_CURRENT_SOURCE_DIR}/CPP/myWindows -I${CMAKE_CURRENT_SOURCE_DIR}/CPP/include_windows -I${CMAKE_CURRENT_SOURCE_DIR}/CPP -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -DENV_UNIX -D_7ZIP_LARGE_PAGES -pthread)
-list(APPEND CXXFLAGS -Wno-error=c++11-narrowing -DBREAK_HANDLER -DUNICODE -D_UNICODE -I${CMAKE_CURRENT_SOURCE_DIR}/C -I${CMAKE_CURRENT_SOURCE_DIR}/CPP/myWindows -I${CMAKE_CURRENT_SOURCE_DIR}/CPP/include_windows -I${CMAKE_CURRENT_SOURCE_DIR}/CPP -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -DENV_UNIX -D_7ZIP_LARGE_PAGES -pthread)
+if(NOT ${CMAKE_C_COMPILR_ID} STREQUAL "GNU")
+list(APPEND CXXFLAGS -Wno-error=c++11-narrowing)
+endif()
+list(APPEND CXXFLAGS -DBREAK_HANDLER -DUNICODE -D_UNICODE -I${CMAKE_CURRENT_SOURCE_DIR}/C -I${CMAKE_CURRENT_SOURCE_DIR}/CPP/myWindows -I${CMAKE_CURRENT_SOURCE_DIR}/CPP/include_windows -I${CMAKE_CURRENT_SOURCE_DIR}/CPP -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -DENV_UNIX -D_7ZIP_LARGE_PAGES -pthread)
 list(APPEND LDFLAGS -lstdc++ -pthread)
 set(NO_REFERENCE_OUTPUT 1)
 llvm_multisource(7zip-benchmark
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -269,11 +269,14 @@
   set(TEST_SUITE_SUBDIRS "")
   foreach(entry ${sub_cmakelists})
     get_filename_component(subdir ${entry} DIRECTORY)
-	 # Exclude tools and CTMark from default list
-    if(NOT ${subdir} STREQUAL tools AND NOT ${subdir} STREQUAL CTMark)
-      list(APPEND TEST_SUITE_SUBDIRS ${subdir})
-    endif()
+    list(APPEND TEST_SUITE_SUBDIRS ${subdir})
   endforeach()
+  # Exclude tools and CTMark from default list
+  list(REMOVE_ITEM TEST_SUITE_SUBDIRS tools CTMark)
+  # Exclude Bitcode tests on GCC
+  if(${CMAKE_C_COMPILR_ID} STREQUAL "GNU")
+    list(REMOVE_ITEM TEST_SUITE_SUBDIRS Bitcode)
+  endif()
   set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}")
 endif()
 set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}" CACHE STRING


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67093.218441.patch
Type: text/x-patch
Size: 2343 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190903/64219313/attachment.bin>


More information about the llvm-commits mailing list