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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [nestedfn-5.c] - Blame information for rev 280

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

Line No. Rev Author Line
1 273 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
 
4
extern void abort (void);
5
 
6
void
7
foo (int *j)
8
{
9
  int i = 5;
10
  int bar (void) { return i + 1; }
11
#pragma omp sections
12
  {
13
    #pragma omp section
14
      {
15
        if (bar () != 6)
16
        #pragma omp atomic
17
          ++*j;
18
      }
19
    #pragma omp section
20
      {
21
        if (bar () != 6)
22
        #pragma omp atomic
23
          ++*j;
24
      }
25
  }
26
}
27
 
28
int
29
main (void)
30
{
31
  int j = 0;
32
#pragma omp parallel num_threads (2)
33
  foo (&j);
34
  if (j)
35
    abort ();
36
  return 0;
37
}
38
 

powered by: WebSVN 2.1.0

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