1// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s
2#include "test.h"
3
4void __attribute__((noinline)) suppress_this(pthread_mutex_t *mu) {
5 pthread_mutex_destroy(mutex: mu);
6}
7
8int main() {
9 pthread_mutex_t mu;
10 pthread_mutex_init(mutex: &mu, mutexattr: 0);
11 pthread_mutex_lock(mutex: &mu);
12 suppress_this(mu: &mu);
13 fprintf(stderr, format: "DONE\n");
14 return 0;
15}
16
17// CHECK-NOT: failed to open suppressions file
18// CHECK-NOT: WARNING: ThreadSanitizer:
19// CHECK: DONE
20

source code of compiler-rt/test/tsan/suppressions_mutex.cpp