aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/pr104952-1.c
blob: a3bfb1e77df28c0090b633d3fba55282e2979af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#define N 32

static char arr[N];

int
main (void)
{
  unsigned int result = 0;

  for (unsigned int i = 0; i < N; ++i)
    arr[i] = 0;

  arr[5] = 42;

#pragma omp target map(tofrom:result) map(to:arr)
#pragma omp simd reduction(||: result)
  for (unsigned int i = 0; i < N; ++i)
    result = result || arr[i];

  if (result != 1)
    __builtin_abort ();

  return 0;
}