• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clangxx -O0 %s -o %t && %run %t
2 
3 #include <assert.h>
4 #include <pthread.h>
5 
main(void)6 int main(void) {
7   pthread_mutexattr_t ma;
8   int res = pthread_mutexattr_init(&ma);
9   assert(res == 0);
10   res = pthread_mutexattr_setpshared(&ma, 1);
11   assert(res == 0);
12   int pshared;
13   res = pthread_mutexattr_getpshared(&ma, &pshared);
14   assert(res == 0);
15   assert(pshared == 1);
16   res = pthread_mutexattr_destroy(&ma);
17   assert(res == 0);
18   return 0;
19 }
20