OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c++/] [nested-1.C] - Blame information for rev 800

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 735 jeremybenn
// { dg-do run }
2
 
3
extern "C" void abort(void);
4
#define N 1000
5
 
6
int foo()
7
{
8
  int i = 0, j;
9
 
10
  #pragma omp parallel for num_threads(2) shared (i)
11
  for (j = 0; j < N; ++j)
12
    {
13
      #pragma omp parallel num_threads(1) shared (i)
14
      {
15
        #pragma omp atomic
16
        i++;
17
      }
18
    }
19
 
20
  return i;
21
}
22
 
23
int main()
24
{
25
  if (foo() != N)
26
    abort ();
27
  return 0;
28
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.