[flang][cuda] Do not register global constants (#118582)
[llvm-project.git] / openmp / runtime / test / tasking / omp_task_if.c
blob8b4728efee1a30bfd94c06f3110cd993cf108405
1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include <math.h>
4 #include "omp_testsuite.h"
5 #include "omp_my_sleep.h"
7 int test_omp_task_if()
9 int condition_false;
10 int count;
11 int result;
13 count=0;
14 condition_false = (count == 1);
15 #pragma omp parallel
17 #pragma omp single
19 #pragma omp task if (condition_false) shared(count, result)
21 my_sleep (SLEEPTIME);
22 #pragma omp critical
23 result = (0 == count);
24 } /* end of omp task */
25 #pragma omp critical
26 count = 1;
27 } /* end of single */
28 } /*end of parallel */
29 return result;
32 int main()
34 int i;
35 int num_failed=0;
37 for(i = 0; i < REPETITIONS; i++) {
38 if(!test_omp_task_if()) {
39 num_failed++;
42 return num_failed;