Alexander Shaposhnikov f4e8fbc5e9
[compiler-rt][nsan] Add lit config for tests (#100286)
Initial setup for tests.

Test plan: ninja check-nsan
2024-07-23 22:48:05 -07:00

5 lines
163 B
C++

// Prevents the compiler from optimizing everything away.
template <class T> void DoNotOptimize(const T &var) {
asm volatile("" : "+m"(const_cast<T &>(var)));
}