Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / cxa_guard_acquire.cpp
blob100a40b28141092a51bc9b8d3ad765b70e520fc7
1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <sanitizer/tsan_interface.h>
4 #include <stdio.h>
6 namespace __tsan {
8 #if (__APPLE__)
9 __attribute__((weak))
10 #endif
11 void OnPotentiallyBlockingRegionBegin() {
12 printf("Enter __cxa_guard_acquire\n");
15 #if (__APPLE__)
16 __attribute__((weak))
17 #endif
18 void OnPotentiallyBlockingRegionEnd() { printf("Exit __cxa_guard_acquire\n"); }
20 } // namespace __tsan
22 int main(int argc, char **argv) {
23 // CHECK: Enter main
24 printf("Enter main\n");
25 // CHECK-NEXT: Enter __cxa_guard_acquire
26 // CHECK-NEXT: Exit __cxa_guard_acquire
27 static int s = argc;
28 (void)s;
29 // CHECK-NEXT: Exit main
30 printf("Exit main\n");
31 return 0;