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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [gomp/] [for-11.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-std=c99 -fopenmp" } */
3
 
4
extern void baz (int);
5
 
6
void foo (int j, int k)
7
{
8
  int i;
9
 
10
  /* Valid loops.  */
11
  #pragma omp for
12
  for (i = 0; i < 10; i++)
13
    baz (i);
14
 
15
  #pragma omp for
16
  for (i = j; i <= 10; i+=4)
17
    baz (i);
18
 
19
  #pragma omp for
20
  for (i = j; i > 0; i = i - 1)
21
    baz (j);
22
 
23
  #pragma omp for
24
  for (i = j; i >= k; i--)
25
    baz (i);
26
 
27
  #pragma omp for
28
  for (int l = j; l < 10; l++)
29
    baz (l);
30
 
31
  /* Malformed parallel loops.  */
32
  #pragma omp for
33
  i = 0;         /* { dg-error "for statement expected" } */
34
  for ( ; i < 10; )
35
    {
36
      baz (i);
37
      i++;
38
    }
39
 
40
  #pragma omp for
41
  for (i = 0; ; i--)     /* { dg-error "missing controlling predicate" } */
42
    {
43
      if (i >= 10)
44
        break;          /* { dg-error "break" } */
45
      baz (i);
46
    }
47
 
48
  #pragma omp for
49
  for (i = 0;
50
       i < 10 && j > 4; /* { dg-error "invalid controlling predicate" } */
51
       i-=3)
52
    baz (i);
53
 
54
  #pragma omp for
55
  for (i = 0;
56
       i < 10;
57
       i-=3, j+=2)      /* { dg-error "invalid increment expression" } */
58
    baz (i);
59
 
60
  int m = 0;
61
  #pragma omp for
62
  for (; m < 10; m++)   /* { dg-error "expected" } */
63
    baz (m);
64
 
65
  m = 0;
66
  #pragma omp for
67
  for (int n = 0; m < 10; m++)   /* { dg-error "invalid controlling predicate|invalid increment expression" } */
68
    baz (m);
69
 
70
  #pragma omp for
71
  for (m = 0; m < 10; i++)       /* { dg-error "invalid increment expression" } */
72
    baz (m);
73
}

powered by: WebSVN 2.1.0

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