1 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && %run %t 2 3 // Regression test for a deadlock in pthread_getattr_np 4 5 #include <assert.h> 6 #include <pthread.h> 7 ThreadFn(void *)8void *ThreadFn(void *) { 9 pthread_attr_t attr; 10 int res = pthread_getattr_np(pthread_self(), &attr); 11 assert(!res); 12 return 0; 13 } 14 main(void)15int main(void) { 16 pthread_t t; 17 int res = pthread_create(&t, 0, ThreadFn, 0); 18 assert(!res); 19 res = pthread_join(t, 0); 20 assert(!res); 21 return 0; 22 } 23