[test-suite] r334097 - [test-suite] Enable MicroBenchmarks by default and enable benchmark library to cross compile.

Brian Homerding via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 07:06:47 PDT 2018


Author: homerdin
Date: Wed Jun  6 07:06:46 2018
New Revision: 334097

URL: http://llvm.org/viewvc/llvm-project?rev=334097&view=rev
Log:
[test-suite] Enable MicroBenchmarks by default and enable benchmark library to cross compile.

With the changes in https://reviews.llvm.org/rL327422 and
https://reviews.llvm.org/rL327710 the MicroBenchmarks directory produces
additional meaningful data. The patch enables the MicroBenchmarks directory
to build by default and forces the benchmark library to build with C++11 and
use std::regex to circumvent cmake try_run tests that are limited when cross
compiling.

Reviewers: MatzeB, hfinkel

Differential Revision: https://reviews.llvm.org/D46267

Modified:
    test-suite/trunk/CMakeLists.txt
    test-suite/trunk/MicroBenchmarks/CMakeLists.txt
    test-suite/trunk/MicroBenchmarks/libs/CMakeLists.txt

Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=334097&r1=334096&r2=334097&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Wed Jun  6 07:06:46 2018
@@ -211,9 +211,8 @@ if(NOT TEST_SUITE_SUBDIRS)
   set(TEST_SUITE_SUBDIRS "")
   foreach(entry ${sub_cmakelists})
     get_filename_component(subdir ${entry} DIRECTORY)
-	 # Exclude tools, CTMark, and MicroBenchmarks from default list
-    if(NOT ${subdir} STREQUAL tools AND NOT ${subdir} STREQUAL CTMark
-       AND NOT ${subdir} STREQUAL MicroBenchmarks)
+	 # Exclude tools and CTMark from default list
+    if(NOT ${subdir} STREQUAL tools AND NOT ${subdir} STREQUAL CTMark)
       list(APPEND TEST_SUITE_SUBDIRS ${subdir})
     endif()
   endforeach()

Modified: test-suite/trunk/MicroBenchmarks/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/CMakeLists.txt?rev=334097&r1=334096&r2=334097&view=diff
==============================================================================
--- test-suite/trunk/MicroBenchmarks/CMakeLists.txt (original)
+++ test-suite/trunk/MicroBenchmarks/CMakeLists.txt Wed Jun  6 07:06:46 2018
@@ -1,5 +1,7 @@
-file(COPY lit.local.cfg DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+if(NOT DEFINED DISABLE_CXX)
+  file(COPY lit.local.cfg DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 
-add_subdirectory(libs)
-add_subdirectory(XRay)
-add_subdirectory(LCALS)
+  add_subdirectory(libs)
+  add_subdirectory(XRay)
+  add_subdirectory(LCALS)
+endif()

Modified: test-suite/trunk/MicroBenchmarks/libs/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/libs/CMakeLists.txt?rev=334097&r1=334096&r2=334097&view=diff
==============================================================================
--- test-suite/trunk/MicroBenchmarks/libs/CMakeLists.txt (original)
+++ test-suite/trunk/MicroBenchmarks/libs/CMakeLists.txt Wed Jun  6 07:06:46 2018
@@ -1,3 +1,10 @@
+# The benchmark library build system uses try_run tests to determine regex
+# Circumvent these tests and enforce std::regex
+set(CMAKE_CXX_STANDARD 11)
+set(HAVE_STD_REGEX 1)
+# When enforcing c++11 we need to disable one of the benchmark library's tests
+set(BENCHMARK_HAS_CXX03_FLAG 0)
+
 add_subdirectory(benchmark-1.3.0)
 test_suite_add_build_dependencies(benchmark)
 test_suite_add_build_dependencies(output_test_helper)




More information about the llvm-commits mailing list