diff options
Diffstat (limited to 'libcxx/test/support/test_macros.h')
-rw-r--r-- | libcxx/test/support/test_macros.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index cec5f5a5e03..75b7885f8f6 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -188,9 +188,11 @@ inline void DoNotOptimize(Tp const& value) { asm volatile("" : : "g"(value) : "memory"); } #else +#include <intrin.h> template <class Tp> -inline void DoNotOptimize(Tp const&) { - // FIXME: Do something here... +inline void DoNotOptimize(Tp const& value) { + const volatile void* volatile = __builtin_addressof(value); + _ReadWriteBarrier(); } #endif |