Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / mutex_bad_read_unlock.cpp
blob6a882618a48f1a933cab48d36ead61ca52d556ec
1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
2 #include "test.h"
4 int main() {
5 int m = 0;
6 AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 1);
7 AnnotateRWLockReleased(__FILE__, __LINE__, &m, 0);
8 return 0;
11 // CHECK: WARNING: ThreadSanitizer: read unlock of a write locked mutex
12 // CHECK: #0 AnnotateRWLockReleased
13 // CHECK: #1 main
14 // CHECK: Location is stack of main thread.
15 // CHECK: Mutex {{.*}}) created at:
16 // CHECK: #0 AnnotateRWLockAcquired
17 // CHECK: #1 main
18 // CHECK: SUMMARY: ThreadSanitizer: read unlock of a write locked mutex