1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s 2 3 #include <stdio.h> 4 5 namespace __tsan { 6 OnPotentiallyBlockingRegionBegin()7void OnPotentiallyBlockingRegionBegin() { 8 printf("Enter __cxa_guard_acquire\n"); 9 } 10 OnPotentiallyBlockingRegionEnd()11void OnPotentiallyBlockingRegionEnd() { printf("Exit __cxa_guard_acquire\n"); } 12 13 } // namespace __tsan 14 main(int argc,char ** argv)15int main(int argc, char **argv) { 16 // CHECK: Enter main 17 printf("Enter main\n"); 18 // CHECK-NEXT: Enter __cxa_guard_acquire 19 // CHECK-NEXT: Exit __cxa_guard_acquire 20 static int s = argc; 21 (void)s; 22 // CHECK-NEXT: Exit main 23 printf("Exit main\n"); 24 return 0; 25 } 26