1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
5 void *thread(void *arg
) {
7 pthread_mutex_init(&m
, 0);
8 pthread_mutex_lock(&m
);
9 pthread_mutex_destroy(&m
);
15 pthread_create(&th
, 0, thread
, 0);
20 // CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
21 // CHECK: #0 pthread_mutex_destroy
24 // CHECK: #0 pthread_mutex_lock
26 // CHECK: Mutex {{.*}} created at:
27 // CHECK: #0 pthread_mutex_init
29 // CHECK: SUMMARY: ThreadSanitizer: destroy of a locked mutex {{.*}} in thread