[flang][cuda] Do not register global constants (#118582)
[llvm-project.git] / openmp / runtime / test / tasking / omp_task_shared.c
blob03040261064e460e5cb219d1fd26bd104cace14e
1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include <math.h>
4 #include "omp_testsuite.h"
6 /* Utility function do spend some time in a loop */
7 int test_omp_task_imp_shared()
9 int i;
10 int k = 0;
11 int result = 0;
12 i=0;
14 #pragma omp parallel
16 #pragma omp single
17 for (k = 0; k < NUM_TASKS; k++) {
18 #pragma omp task shared(i)
20 #pragma omp atomic
21 i++;
22 //this should be shared implicitly
26 result = i;
27 return ((result == NUM_TASKS));
30 int main()
32 int i;
33 int num_failed=0;
35 for(i = 0; i < REPETITIONS; i++) {
36 if(!test_omp_task_imp_shared()) {
37 num_failed++;
40 return num_failed;