1 // RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
8 void bar(jmp_buf env
) {
14 void foo(jmp_buf env
) {
20 __attribute__((noinline
)) void badguy() {
22 pthread_mutex_init(&mtx
, 0);
23 pthread_mutex_lock(&mtx
);
24 pthread_mutex_destroy(&mtx
);
27 __attribute__((noinline
)) void mymain() {
29 if (setjmp(env
) == 42) {
34 fprintf(stderr
, "FAILED\n");
44 // CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
45 // CHECK: #0 pthread_mutex_destroy