1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
11 pthread_mutex_lock(&m
);
16 pthread_mutexattr_t a
;
17 pthread_mutexattr_init(&a
);
18 pthread_mutexattr_setrobust(&a
, PTHREAD_MUTEX_ROBUST
);
19 pthread_mutex_init(&m
, &a
);
21 pthread_create(&th
, 0, thr
, 0);
23 if (pthread_mutex_lock(&m
) != EOWNERDEAD
) {
24 fprintf(stderr
, "not EOWNERDEAD\n");
28 fprintf(stderr
, "DONE\n");
31 // This is a correct code, and tsan must not bark.
32 // CHECK-NOT: WARNING: ThreadSanitizer
33 // CHECK-NOT: EOWNERDEAD
35 // CHECK-NOT: WARNING: ThreadSanitizer