summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/omp-loop03.c
blob: 7bb9a194331efc18f354dbb638e393978c0e1a24 (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
extern void abort (void);
int a;

void
foo ()
{
  int i;
  a = 30;
#pragma omp barrier
#pragma omp for lastprivate (a)
  for (i = 0; i < 1024; i++)
    {
      a = i;
    }
  if (a != 1023)
    abort ();
}

int
main (void)
{
#pragma omp parallel num_threads (64)
  foo ();

  return 0;
}