xref: /llvm-project/compiler-rt/test/nsan/helpers.h (revision f4e8fbc5e90a4f2959a0eb6d7b01e7e279fb693b)
1 // Prevents the compiler from optimizing everything away.
2 template <class T> void DoNotOptimize(const T &var) {
3   asm volatile("" : "+m"(const_cast<T &>(var)));
4 }
5