From 1723592cef9164c8e72d57417f5a33162b867f63 Mon Sep 17 00:00:00 2001 From: David Callahan Date: Fri, 22 Jan 2016 13:34:32 -0800 Subject: [PATCH] avoid aggressive optimization Summary: GCC will now dead-code eliminate the folly-based version of this test without a mechanisms to force the result to be live. Reviewed By: ttsugriy Differential Revision: D2854633 fb-gh-sync-id: 0e3841ed22c040fda7653bcfb5a3f19ca3d1f835 --- folly/test/AsciiCaseInsensitiveBenchmark.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/folly/test/AsciiCaseInsensitiveBenchmark.cpp b/folly/test/AsciiCaseInsensitiveBenchmark.cpp index 00865763..f075f941 100644 --- a/folly/test/AsciiCaseInsensitiveBenchmark.cpp +++ b/folly/test/AsciiCaseInsensitiveBenchmark.cpp @@ -100,6 +100,7 @@ inline void test_operator_on_search(int iters) { cmp ) - lorem_ipsum.begin(); } + doNotOptimizeAway(dummy); } BENCHMARK(LegacyCaseInsensitiveCheck, iters) { -- 2.34.1