Debian Codegraph @

libgomp/testsuite/libgomp.c/target-43.c

raw
1 /* { dg-do run } */
2 /* { dg-additional-options "-foffload-options=nvptx-none=-latomic" { target { offload_target_nvptx } } } */
3
4 #include <stdlib.h>
5
6 #define N 32
7 #define TYPE char
8
9 int
10 main (void)
11 {
12 TYPE result = 1;
13 TYPE a[N];
14 for (int x = 0; x < N; ++x)
15 a[x] = 1;
16
17 #pragma omp target map(tofrom: result) map(to:a)
18 #pragma omp for simd reduction(&&:result)
19 for (int x = 0; x < N; ++x)
20 result = result && a[x];
21
22 if (result != 1)
23 abort ();
24
25 return 0;
26 }