[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / tsan / cxa_guard_acquire.cpp
blobd483cd37f328fe8a81dcb769af3c53a1dc583ea0
1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <stdio.h>
5 namespace __tsan {
7 #if (__APPLE__)
8 __attribute__((weak))
9 #endif
10 void OnPotentiallyBlockingRegionBegin() {
11 printf("Enter __cxa_guard_acquire\n");
14 #if (__APPLE__)
15 __attribute__((weak))
16 #endif
17 void OnPotentiallyBlockingRegionEnd() { printf("Exit __cxa_guard_acquire\n"); }
19 } // namespace __tsan
21 int main(int argc, char **argv) {
22 // CHECK: Enter main
23 printf("Enter main\n");
24 // CHECK-NEXT: Enter __cxa_guard_acquire
25 // CHECK-NEXT: Exit __cxa_guard_acquire
26 static int s = argc;
27 (void)s;
28 // CHECK-NEXT: Exit main
29 printf("Exit main\n");
30 return 0;