aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/pr90009.c
blob: 58d1039dd8d9984f894084d84a5134887f664480 (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
25
26
27
28
29
30
31
32
33
34
/* { dg-do run } */

#include <stdlib.h>

#define N 100

int data[N];

int
main (void)
{
  int n = N, b = 3;
#pragma acc parallel num_workers(2)
  {
    int c;
    if (n)
      c = 0;
    else
      c = b;

#pragma acc loop worker
    for (int i = 0; i < n; i++)
      data[i] = 1;

    if (c)
      data[0] = 2;
  }

  for (int i = 0; i < n; i++)
    if (data[i] != 1)
      abort ();

  return 0;
}