]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/tsan/mutex_bad_read_unlock.cc
1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
2 extern "C" void AnnotateRWLockAcquired(const char *f
, int l
, void *m
, long rw
);
3 extern "C" void AnnotateRWLockReleased(const char *f
, int l
, void *m
, long rw
);
7 AnnotateRWLockAcquired(__FILE__
, __LINE__
, &m
, 1);
8 AnnotateRWLockReleased(__FILE__
, __LINE__
, &m
, 0);
12 // CHECK: WARNING: ThreadSanitizer: read unlock of a write locked mutex
13 // CHECK: #0 AnnotateRWLockReleased
15 // CHECK: Location is stack of main thread.
16 // CHECK: Mutex {{.*}}) created at:
17 // CHECK: #0 AnnotateRWLockAcquired
19 // CHECK: SUMMARY: ThreadSanitizer: read unlock of a write locked mutex