From: David Callahan Date: Fri, 22 Jan 2016 21:34:32 +0000 (-0800) Subject: avoid aggressive optimization X-Git-Tag: deprecate-dynamic-initializer~144 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1723592cef9164c8e72d57417f5a33162b867f63;p=folly.git 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 --- 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) {