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