1*d11b16e1SNico Weber // Synthetic benchmark for __tsan_func_entry/exit (spends ~75% there). 2*d11b16e1SNico Weber 3*d11b16e1SNico Weber void foo(bool x); 4*d11b16e1SNico Weber main()5*d11b16e1SNico Weberint main() { 6*d11b16e1SNico Weber volatile int kRepeat1 = 1 << 30; 7*d11b16e1SNico Weber const int kRepeat = kRepeat1; 8*d11b16e1SNico Weber for (int i = 0; i < kRepeat; i++) 9*d11b16e1SNico Weber foo(false); 10*d11b16e1SNico Weber } 11*d11b16e1SNico Weber bar(volatile bool x)12*d11b16e1SNico Weber__attribute__((noinline)) void bar(volatile bool x) { 13*d11b16e1SNico Weber if (x) 14*d11b16e1SNico Weber foo(x); 15*d11b16e1SNico Weber } 16*d11b16e1SNico Weber foo(bool x)17*d11b16e1SNico Weber__attribute__((noinline)) void foo(bool x) { 18*d11b16e1SNico Weber if (__builtin_expect(x, false)) 19*d11b16e1SNico Weber bar(x); 20*d11b16e1SNico Weber } 21