From 3770474ab39350c78dd1afea93c7f41fbab84726 Mon Sep 17 00:00:00 2001 From: Dmitry Pleshkov Date: Wed, 19 Oct 2016 15:57:39 -0700 Subject: [PATCH] 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 --- .../exception_tracer/test/ExceptionCounterTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.34.1