Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / pthread_mutexattr_get.cpp
blob1363e12bdea9142849bbe6466a472f9dbd22eace
1 // RUN: %clangxx -O0 %s -o %t && %run %t
3 // pthread_mutexattr_setpshared and pthread_mutexattr_getpshared unavailable
4 // UNSUPPORTED: target={{.*netbsd.*}}
6 #include <assert.h>
7 #include <pthread.h>
9 int main(void) {
10 pthread_mutexattr_t ma;
11 int res = pthread_mutexattr_init(&ma);
12 assert(res == 0);
13 res = pthread_mutexattr_setpshared(&ma, 1);
14 assert(res == 0);
15 int pshared;
16 res = pthread_mutexattr_getpshared(&ma, &pshared);
17 assert(res == 0);
18 assert(pshared == 1);
19 res = pthread_mutexattr_destroy(&ma);
20 assert(res == 0);
21 return 0;