Files
clang-p2996/compiler-rt/test/sanitizer_common/TestCases/pthread_mutexattr_get.cpp
Paul Robinson 975fa72506 [sanitizer-common] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
2022-12-19 11:01:09 -08:00

23 lines
556 B
C++

// RUN: %clangxx -O0 %s -o %t && %run %t
// pthread_mutexattr_setpshared and pthread_mutexattr_getpshared unavailable
// UNSUPPORTED: target={{.*netbsd.*}}
#include <assert.h>
#include <pthread.h>
int main(void) {
pthread_mutexattr_t ma;
int res = pthread_mutexattr_init(&ma);
assert(res == 0);
res = pthread_mutexattr_setpshared(&ma, 1);
assert(res == 0);
int pshared;
res = pthread_mutexattr_getpshared(&ma, &pshared);
assert(res == 0);
assert(pshared == 1);
res = pthread_mutexattr_destroy(&ma);
assert(res == 0);
return 0;
}