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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [pr36802-2.c] - Blame information for rev 735

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 735 jeremybenn
/* PR middle-end/36802 */
2
 
3
extern void abort (void);
4
 
5
int q;
6
 
7
int
8
foo (int k)
9
{
10
  int i = 6, n = 0;
11
  omp_set_dynamic (0);
12
  omp_set_nested (1);
13
#pragma omp parallel shared (i) num_threads (3)
14
  {
15
    int l;
16
 
17
    if (omp_get_num_threads () != 3)
18
    #pragma omp atomic
19
      n += 1;
20
    else
21
    #pragma omp for
22
      for (l = 0; l < 3; l++)
23
        if (k)
24
        #pragma omp atomic
25
          q += i;
26
        else
27
        #pragma omp parallel shared (i) num_threads (4)
28
          {
29
            if (omp_get_num_threads () != 4)
30
            #pragma omp atomic
31
              n += 1;
32
            #pragma omp critical
33
              i += 1;
34
          }
35
  }
36
  if (n == 0 && i != 6 + 3 * 4)
37
    abort ();
38
  return 0;
39
}
40
 
41
int
42
main (void)
43
{
44
  foo (0);
45
  return 0;
46
}

powered by: WebSVN 2.1.0

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