summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/tsan/cxa_guard_acquire.cpp
blob: cdbe609003d4323d38cdd18c1c98efc7246a5ea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s

#include <stdio.h>

namespace __tsan {

void OnPotentiallyBlockingRegionBegin() {
  printf("Enter __cxa_guard_acquire\n");
}

void OnPotentiallyBlockingRegionEnd() { printf("Exit __cxa_guard_acquire\n"); }

} // namespace __tsan

int main(int argc, char **argv) {
  // CHECK: Enter main
  printf("Enter main\n");
  // CHECK-NEXT: Enter __cxa_guard_acquire
  // CHECK-NEXT: Exit __cxa_guard_acquire
  static int s = argc;
  (void)s;
  // CHECK-NEXT: Exit main
  printf("Exit main\n");
  return 0;
}
OpenPOWER on IntegriCloud