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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [gomp/] [for-1.c] - Rev 708

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

/* { dg-do compile } */
/* { dg-options "-fopenmp -fshow-column" } */
 
void foo (int j, int k)
{
  int i;
 
  /* Valid loops.  */
  #pragma omp for
  for (i = 0; i < 10; i++)
    baz (i);
 
  #pragma omp for
  for (i = j; i <= 10; i+=4)
    baz (i);
 
  #pragma omp for
  for (i = j; i > 0; i = i - 1)
    baz (j);
 
  #pragma omp for
  for (i = j; i >= k; i--)
    baz (i);
 
  /* Malformed parallel loops.  */
  #pragma omp for
  i = 0;		/* { dg-error "3:for statement expected" } */
  for ( ; i < 10; )
    {
      baz (i);
      i++;
    }
 
  #pragma omp for
  for (i = 0; ; i--)	/* { dg-error "missing controlling predicate" } */
    {
      if (i >= 10)
	break;		/* { dg-error "break" } */
      baz (i);
    }
 
  #pragma omp for
  for (i = 0; i < 10 && j > 4; i-=3)	/* { dg-error "15:invalid controlling predicate" } */
    baz (i);
 
  #pragma omp for
  for (i = 0; i < 10; i-=3, j+=2)	/* { dg-error "27:invalid increment expression" } */
    baz (i);
}
 

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.