1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
12 pthread_mutex_lock(&m
);
18 pthread_mutexattr_t a
;
19 pthread_mutexattr_init(&a
);
20 pthread_mutexattr_setrobust(&a
, PTHREAD_MUTEX_ROBUST
);
21 pthread_mutex_init(&m
, &a
);
23 pthread_create(&th
, 0, thr
, 0);
25 if (pthread_mutex_trylock(&m
) != EOWNERDEAD
) {
26 fprintf(stderr
, "not EOWNERDEAD\n");
31 fprintf(stderr
, "DONE\n");
34 // This is a false positive, tsan must not bark at the data race.
35 // But currently it does.
36 // CHECK-NOT: WARNING: ThreadSanitizer WARNING: double lock of mutex
37 // CHECK: WARNING: ThreadSanitizer: data race
38 // CHECK-NOT: EOWNERDEAD
40 // CHECK-NOT: WARNING: ThreadSanitizer