From: Dmitry Pleshkov Date: Wed, 19 Oct 2016 22:57:39 +0000 (-0700) Subject: Fix ExceptionCounter.oneThread test case X-Git-Tag: v2016.10.24.00~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3770474ab39350c78dd1afea93c7f41fbab84726;p=folly.git Fix ExceptionCounter.oneThread test case Summary: Test fails because of loop unrolling: frames are not being grouped up Reviewed By: ot Differential Revision: D4034910 fbshipit-source-id: 159d3a4f116f90fdd0d51ee9de38634167ed0dc4 --- diff --git a/folly/experimental/exception_tracer/test/ExceptionCounterTest.cpp b/folly/experimental/exception_tracer/test/ExceptionCounterTest.cpp index 24b413e9..706177b8 100644 --- a/folly/experimental/exception_tracer/test/ExceptionCounterTest.cpp +++ b/folly/experimental/exception_tracer/test/ExceptionCounterTest.cpp @@ -45,7 +45,9 @@ void throwAndCatch(F f) { TEST(ExceptionCounter, oneThread) { throwAndCatch(foo); - for (int i = 0; i < 10; ++i) { + + // Use volatile to prevent loop unrolling (it screws up stack frame grouping). + for (volatile int i = 0; i < 10; ++i) { throwAndCatch(bar); }