summaryrefslogtreecommitdiffstats
path: root/llvm/utils/benchmark/cmake/std_regex.cpp
diff options
context:
space:
mode:
authorKirill Bobyrev <kbobyrev.opensource@gmail.com>2018-08-28 09:42:41 +0000
committerKirill Bobyrev <kbobyrev.opensource@gmail.com>2018-08-28 09:42:41 +0000
commit0addd170ab0880941fa4089c2717f3f3a0e4e25a (patch)
tree71d7a249b508800e1be898aa7cb789d4ed7c8f2b /llvm/utils/benchmark/cmake/std_regex.cpp
parent0c4b84e2df541b42238b1e15d2abb5ee4b262402 (diff)
downloadbcm5719-llvm-0addd170ab0880941fa4089c2717f3f3a0e4e25a.tar.gz
bcm5719-llvm-0addd170ab0880941fa4089c2717f3f3a0e4e25a.zip
Pull google/benchmark library to the LLVM tree
This patch pulls google/benchmark v1.4.1 into the LLVM tree so that any project could use it for benchmark generation. A dummy benchmark is added to `llvm/benchmarks/DummyYAML.cpp` to validate the correctness of the build process. The current version does not utilize LLVM LNT and LLVM CMake infrastructure, but that might be sufficient for most users. Two introduced CMake variables: * `LLVM_INCLUDE_BENCHMARKS` (`ON` by default) generates benchmark targets * `LLVM_BUILD_BENCHMARKS` (`OFF` by default) adds generated benchmark targets to the list of default LLVM targets (i.e. if `ON` benchmarks will be built upon standard build invocation, e.g. `ninja` or `make` with no specific targets) List of modifications: * `BENCHMARK_ENABLE_TESTING` is disabled * `BENCHMARK_ENABLE_EXCEPTIONS` is disabled * `BENCHMARK_ENABLE_INSTALL` is disabled * `BENCHMARK_ENABLE_GTEST_TESTS` is disabled * `BENCHMARK_DOWNLOAD_DEPENDENCIES` is disabled Original discussion can be found here: http://lists.llvm.org/pipermail/llvm-dev/2018-August/125023.html Reviewed by: dberris, lebedev.ri Subscribers: ilya-biryukov, ioeric, EricWF, lebedev.ri, srhines, dschuff, mgorny, krytarowski, fedor.sergeev, mgrang, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D50894 llvm-svn: 340809
Diffstat (limited to 'llvm/utils/benchmark/cmake/std_regex.cpp')
-rw-r--r--llvm/utils/benchmark/cmake/std_regex.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/utils/benchmark/cmake/std_regex.cpp b/llvm/utils/benchmark/cmake/std_regex.cpp
new file mode 100644
index 00000000000..8177c482e83
--- /dev/null
+++ b/llvm/utils/benchmark/cmake/std_regex.cpp
@@ -0,0 +1,9 @@
+#include <regex>
+#include <string>
+int main() {
+ const std::string str = "test0159";
+ std::regex re;
+ re = std::regex("^[a-z]+[0-9]+$",
+ std::regex_constants::extended | std::regex_constants::nosubs);
+ return std::regex_search(str, re) ? 0 : -1;
+}
OpenPOWER on IntegriCloud