RISC-V: testsuite: fix old-style function definition error [NFC]
[official-gcc.git] / libgomp / testsuite / libgomp.c / target-32.c
blob1444523615eaf127a913e5b8b5f628d2ce7f41f6
1 #include <stdlib.h>
2 #include <unistd.h>
3 #include "usleep.h"
5 int main ()
7 int a = 0, b = 0, c = 0, d[7];
9 #pragma omp parallel
10 #pragma omp single
12 #pragma omp task depend(out: d[0])
13 a = 2;
15 #pragma omp target enter data nowait map(to: a,b,c) depend(in: d[0]) depend(out: d[1])
17 #pragma omp target nowait map(alloc: a) depend(in: d[1]) depend(out: d[2])
18 a++;
20 #pragma omp target nowait map(alloc: b) depend(in: d[2]) depend(out: d[3])
22 tgt_usleep (1000);
23 #pragma omp atomic update
24 b |= 4;
27 #pragma omp target nowait map(alloc: b) depend(in: d[2]) depend(out: d[4])
29 tgt_usleep (5000);
30 #pragma omp atomic update
31 b |= 1;
34 #pragma omp target nowait map(alloc: c) depend(in: d[3], d[4]) depend(out: d[5])
36 tgt_usleep (5000);
37 #pragma omp atomic update
38 c |= 8;
41 #pragma omp target nowait map(alloc: c) depend(in: d[3], d[4]) depend(out: d[6])
43 tgt_usleep (1000);
44 #pragma omp atomic update
45 c |= 2;
48 #pragma omp target exit data map(always,from: a,b,c) depend(in: d[5], d[6])
51 if (a != 3 || b != 5 || c != 10)
52 abort ();
54 return 0;