summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
blob: a276c24ed982a3e4e88e02faaf1aedd254fb0978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* PR c/39495 */
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */

#define INT_MIN (-__INT_MAX__ - 1)
#define INT_MAX __INT_MAX__
#define UINT_MAX (2U * __INT_MAX__ + 1)

int
foo (void)
{
  int i;
  unsigned int u;

#pragma omp for
  for (i = INT_MIN + 6; i != INT_MIN; i--)	/* { dg-error "invalid controlling predicate" } */
    ;
#pragma omp for
  for (i = INT_MIN + 6; i == INT_MIN; i--)	/* { dg-error "invalid controlling predicate" } */
    ;
#pragma omp for
  for (i = INT_MAX - 6; i != INT_MAX; i++)	/* { dg-error "invalid controlling predicate" } */
    ;
#pragma omp for
  for (i = INT_MAX - 6; i == INT_MAX; i++)	/* { dg-error "invalid controlling predicate" } */
    ;
#pragma omp for
  for (u = 6; u != 0; u--)			/* { dg-error "invalid controlling predicate" } */
    ;
#pragma omp for
  for (u = 6; u == 0; u--)			/* { dg-error "invalid controlling predicate" } */
    ;
#pragma omp for
  for (u = UINT_MAX - 6; u != UINT_MAX; u++)	/* { dg-error "invalid controlling predicate" } */
    ;
#pragma omp for
  for (u = UINT_MAX - 6; u == UINT_MAX; u++)	/* { dg-error "invalid controlling predicate" } */
    ;
}