[RISCV][VLOPT] Add vector narrowing integer right shift instructions to isSupportedIn...
[llvm-project.git] / openmp / runtime / test / master / omp_master_3.c
blob2e9fdf85e13362d7edba7603330d42e94e8a4836
1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include "omp_testsuite.h"
5 int test_omp_master_3()
7 int nthreads;
8 int executing_thread;
9 int tid_result = 0; /* counts up the number of wrong thread no. for
10 the master thread. (Must be 0) */
11 nthreads = 0;
12 executing_thread = -1;
14 #pragma omp parallel
16 #pragma omp master
18 int tid = omp_get_thread_num();
19 if (tid != 0) {
20 #pragma omp critical
21 { tid_result++; }
23 #pragma omp critical
25 nthreads++;
27 executing_thread = omp_get_thread_num ();
28 } /* end of master*/
29 } /* end of parallel*/
30 return ((nthreads == 1) && (executing_thread == 0) && (tid_result == 0));
33 int main()
35 int i;
36 int num_failed=0;
38 for(i = 0; i < REPETITIONS; i++) {
39 if(!test_omp_master_3()) {
40 num_failed++;
43 return num_failed;