Dmitry Vyukov | 21dc68f | 2018-04-27 08:59:35 +0000 | [diff] [blame] | 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 | |
| 4 | void __attribute__((noinline)) suppress_this(pthread_mutex_t *mu) { |
| 5 | pthread_mutex_destroy(mu); |
| 6 | } |
| 7 | |
| 8 | int 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 |