[ORC] Fail materialization in tasks that are destroyed before running.
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Linux / pthread_getaffinity_np.cpp
blob2263a9ef5eebec59c6921ebd57c7ae61ba8b3b34
1 // RUN: %clangxx -O0 %s -o %t && %run %t
3 // Android does not implement pthread_getaffinity_np.
4 // (Note: libresolv is integrated with libc, but apparently only
5 // sched_getaffinity).
6 // UNSUPPORTED: android
8 #include <assert.h>
9 #include <pthread.h>
10 #include <sys/sysinfo.h>
12 #include <sanitizer/msan_interface.h>
14 int main() {
15 cpu_set_t set_x[4];
16 pthread_t tid = pthread_self();
17 int res = pthread_getaffinity_np(tid, sizeof(set_x), set_x);
18 assert(res == 0);
19 int cpus = CPU_COUNT_S(sizeof(set_x), set_x);
20 assert(cpus > 0 && cpus <= get_nprocs());
22 return 0;