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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 735 jeremybenn
// PR c++/34513
2
// { dg-do run }
3
 
4
#include 
5
 
6
extern "C" void abort ();
7
 
8
static int errors = 0;
9
static int thrs = 4;
10
 
11
int
12
main ()
13
{
14
  omp_set_dynamic (0);
15
 
16
  #pragma omp parallel num_threads (thrs)
17
  {
18
    static int shrd = 0;
19
 
20
    #pragma omp atomic
21
      shrd += 1;
22
 
23
    #pragma omp barrier
24
 
25
    if (shrd != thrs)
26
      #pragma omp atomic
27
        errors += 1;
28
  }
29
 
30
  if (errors)
31
    abort ();
32
}

powered by: WebSVN 2.1.0

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