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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 735 jeremybenn
// { dg-do run }
2
 
3
#include 
4
#include 
5
 
6
int errval;
7
 
8
int
9
main ()
10
{
11
  int e;
12
#pragma omp parallel shared(errval)
13
  {
14
    if (omp_in_final ())
15
      #pragma omp atomic write
16
        errval = 1;
17
    #pragma omp task if (0) shared(errval)
18
      {
19
        if (omp_in_final ())
20
          #pragma omp atomic write
21
            errval = 1;
22
        #pragma omp task if (0) shared(errval)
23
          if (omp_in_final ())
24
            #pragma omp atomic write
25
              errval = 1;
26
      }
27
    #pragma omp task final (1) shared(errval)
28
      {
29
        if (!omp_in_final ())
30
          #pragma omp atomic write
31
            errval = 1;
32
        #pragma omp taskyield
33
        #pragma omp taskwait
34
        #pragma omp task shared(errval)
35
          if (!omp_in_final ())
36
            #pragma omp atomic write
37
              errval = 1;
38
      }
39
  }
40
  #pragma omp atomic read
41
    e = errval;
42
  if (e)
43
    abort ();
44
}

powered by: WebSVN 2.1.0

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