blob: 5d3a5d05289f1117e93881594fa65f232d51df12 [file] [log] [blame]
Dmitry Vyukov21dc68f2018-04-27 08:59:35 +00001// 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(mu);
6}
7
8int main() {
9 pthread_mutex_t mu;
10 pthread_mutex_init(&mu, 0);
11 pthread_mutex_lock(&mu);
12 suppress_this(&mu);
13 fprintf(stderr, "DONE\n");
14 return 0;
15}
16
17// CHECK-NOT: failed to open suppressions file
18// CHECK-NOT: WARNING: ThreadSanitizer:
19// CHECK: DONE