[OpenACC] Implement 'collapse' for combined constructs.
[llvm-project.git] / openmp / runtime / test / affinity / disabled.c
blob18261010a096aed7636452c4b7d67b760417e52e
1 // RUN: %libomp-compile
2 // RUN: env KMP_AFFINITY=disabled %libomp-run
3 // RUN: env KMP_AFFINITY=disabled,reset %libomp-run
4 // REQUIRES: affinity
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <omp.h>
9 int main() {
10 int nthreads, correct_value;;
11 int a = 0;
12 #pragma omp parallel reduction(+: a)
14 a += omp_get_thread_num();
15 #pragma omp single
16 nthreads = omp_get_num_threads();
18 correct_value = nthreads * (nthreads - 1) / 2;
19 if (a != correct_value) {
20 printf("Incorrect value: %d should be %d\n", a, correct_value);
21 return EXIT_FAILURE;
23 return EXIT_SUCCESS;