]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/compiler-rt/lib/tsan/benchmarks/func_entry_exit.cc
Fix a memory leak in if_delgroups() introduced in r334118.
[FreeBSD/FreeBSD.git] / contrib / llvm-project / compiler-rt / lib / tsan / benchmarks / func_entry_exit.cc
1 // Synthetic benchmark for __tsan_func_entry/exit (spends ~75% there).
2
3 void foo(bool x);
4
5 int main() {
6   volatile int kRepeat1 = 1 << 30;
7   const int kRepeat = kRepeat1;
8   for (int i = 0; i < kRepeat; i++)
9     foo(false);
10 }
11
12 __attribute__((noinline)) void bar(volatile bool x) {
13   if (x)
14     foo(x);
15 }
16
17 __attribute__((noinline)) void foo(bool x) {
18   if (__builtin_expect(x, false))
19     bar(x);
20 }