Mercurial > hg > CbC > CbC_llvm
view compiler-rt/test/tsan/cxa_guard_acquire.cpp @ 266:00f31e85ec16 default tip
Added tag current for changeset 31d058e83c98
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 14 Oct 2023 10:13:55 +0900 |
parents | 1f2b6ac9f198 |
children |
line wrap: on
line source
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include <sanitizer/tsan_interface.h> #include <stdio.h> namespace __tsan { #if (__APPLE__) __attribute__((weak)) #endif void OnPotentiallyBlockingRegionBegin() { printf("Enter __cxa_guard_acquire\n"); } #if (__APPLE__) __attribute__((weak)) #endif 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; }