Summary: Critical tests in benchmarks should not be in asserts since they will be stripped out in release mode, which is the only mode interesting for benchmarks.
Reviewed By: yfeldblum
Differential Revision:
D4384411
fbshipit-source-id:
5237ab48f99ddcd2bce7a159fcf82900303efec2
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
+ bool b = static_cast<bool>(ep);
+ folly::doNotOptimizeAway(b);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
+ bool b = static_cast<bool>(ew);
+ folly::doNotOptimizeAway(b);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
+ bool b = static_cast<bool>(ep);
+ folly::doNotOptimizeAway(b);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
+ bool b = static_cast<bool>(ew);
+ folly::doNotOptimizeAway(b);
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
} catch (std::runtime_error&) {
}
}
} catch (std::runtime_error&) {
}
}
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
} catch (std::runtime_error&) {
}
}
} catch (std::runtime_error&) {
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew.is_compatible_with<std::runtime_error>());
+ bool b = ew.is_compatible_with<std::runtime_error>();
+ folly::doNotOptimizeAway(b);
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
} catch (std::runtime_error&) {
}
}
} catch (std::runtime_error&) {
}
}
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
} catch (std::runtime_error&) {
}
}
} catch (std::runtime_error&) {
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew.is_compatible_with<std::runtime_error>());
+ bool b = ew.is_compatible_with<std::runtime_error>();
+ folly::doNotOptimizeAway(b);