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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [task-5.c] - Rev 865

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

/* { dg-do run } */
 
#include <omp.h>
#include <stdlib.h>
 
int err;
 
int
main ()
{
  int e;
#pragma omp parallel shared(err)
  {
    if (omp_in_final ())
      #pragma omp atomic write
	err = 1;
    #pragma omp task if (0) shared(err)
      {
	if (omp_in_final ())
	  #pragma omp atomic write
	    err = 1;
	#pragma omp task if (0) shared(err)
	  if (omp_in_final ())
	    #pragma omp atomic write
	      err = 1;
      }
    #pragma omp task final (1) shared(err)
      {
	if (!omp_in_final ())
	  #pragma omp atomic write
	    err = 1;
	#pragma omp taskyield
	#pragma omp taskwait
	#pragma omp task shared(err)
	  if (!omp_in_final ())
	    #pragma omp atomic write
	      err = 1;
      }
  }
  #pragma omp atomic read
    e = err;
  if (e)
    abort ();
  return 0;
}
 

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

powered by: WebSVN 2.1.0

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