Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / mutex_bad_read_lock.cpp
blob8f1fe773900a0619a5488ed07d4190f89acfbb51
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 AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 0);
8 return 0;
11 // CHECK: WARNING: ThreadSanitizer: read lock of a write locked mutex
12 // CHECK: #0 AnnotateRWLockAcquired
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 lock of a write locked mutex