[llvm] Stop including unordered_map (NFC)
[llvm-project.git] / openmp / runtime / test / master / omp_master.c
blob1cc7f9e83f488118f13494c647eef2c4507ca5d7
1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include "omp_testsuite.h"
5 int test_omp_master()
7 int nthreads;
8 int executing_thread;
10 nthreads = 0;
11 executing_thread = -1;
13 #pragma omp parallel
15 #pragma omp master
17 #pragma omp critical
19 nthreads++;
21 executing_thread = omp_get_thread_num();
22 } /* end of master*/
23 } /* end of parallel*/
24 return ((nthreads == 1) && (executing_thread == 0));
27 int main()
29 int i;
30 int num_failed=0;
32 for(i = 0; i < REPETITIONS; i++) {
33 if(!test_omp_master()) {
34 num_failed++;
37 return num_failed;