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

Subversion Repositories openrisc

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

Go to most recent revision | 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 parallel shared (i) num_threads (4)
25
          {
26
            if (omp_get_num_threads () != 4)
27
            #pragma omp atomic
28
              n += 1;
29
            #pragma omp critical
30
              i += 1;
31
          }
32
        else
33
        #pragma omp atomic
34
          q += i;
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.