avoid aggressive optimization
authorDavid Callahan <dcallahan@fb.com>
Fri, 22 Jan 2016 21:34:32 +0000 (13:34 -0800)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Fri, 22 Jan 2016 22:20:24 +0000 (14:20 -0800)
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

index 0086576351b43b58688ad6753940f783a101f218..f075f941e0e94a091b2d5f1c9c492379e3313837 100644 (file)
@@ -100,6 +100,7 @@ inline void test_operator_on_search(int iters) {
       cmp
     ) - lorem_ipsum.begin();
   }
+  doNotOptimizeAway(dummy);
 }
 
 BENCHMARK(LegacyCaseInsensitiveCheck, iters) {