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] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-fopenmp -fshow-column" } */
3
 
4
void foo (int j, int k)
5
{
6
  int i;
7
 
8
  /* Valid loops.  */
9
  #pragma omp for
10
  for (i = 0; i < 10; i++)
11
    baz (i);
12
 
13
  #pragma omp for
14
  for (i = j; i <= 10; i+=4)
15
    baz (i);
16
 
17
  #pragma omp for
18
  for (i = j; i > 0; i = i - 1)
19
    baz (j);
20
 
21
  #pragma omp for
22
  for (i = j; i >= k; i--)
23
    baz (i);
24
 
25
  /* Malformed parallel loops.  */
26
  #pragma omp for
27
  i = 0;         /* { dg-error "3:for statement expected" } */
28
  for ( ; i < 10; )
29
    {
30
      baz (i);
31
      i++;
32
    }
33
 
34
  #pragma omp for
35
  for (i = 0; ; i--)     /* { dg-error "missing controlling predicate" } */
36
    {
37
      if (i >= 10)
38
        break;          /* { dg-error "break" } */
39
      baz (i);
40
    }
41
 
42
  #pragma omp for
43
  for (i = 0; i < 10 && j > 4; i-=3)     /* { dg-error "15:invalid controlling predicate" } */
44
    baz (i);
45
 
46
  #pragma omp for
47
  for (i = 0; i < 10; i-=3, j+=2)        /* { dg-error "27:invalid increment expression" } */
48
    baz (i);
49
}

powered by: WebSVN 2.1.0

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