1 /* PR c/39495 */ 2 /* { dg-do compile } */ 3 /* { dg-options "-fopenmp" } */ 4 5 #define INT_MIN (-__INT_MAX__ - 1) 6 #define INT_MAX __INT_MAX__ 7 #define UINT_MAX (2U * __INT_MAX__ + 1) 8 9 int foo(void)10foo (void) 11 { 12 int i; 13 unsigned int u; 14 15 #pragma omp for 16 for (i = INT_MIN + 6; i != INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */ 17 ; 18 #pragma omp for 19 for (i = INT_MIN + 6; i == INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */ 20 ; 21 #pragma omp for 22 for (i = INT_MAX - 6; i != INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */ 23 ; 24 #pragma omp for 25 for (i = INT_MAX - 6; i == INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */ 26 ; 27 #pragma omp for 28 for (u = 6; u != 0; u--) /* { dg-error "invalid controlling predicate" } */ 29 ; 30 #pragma omp for 31 for (u = 6; u == 0; u--) /* { dg-error "invalid controlling predicate" } */ 32 ; 33 #pragma omp for 34 for (u = UINT_MAX - 6; u != UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */ 35 ; 36 #pragma omp for 37 for (u = UINT_MAX - 6; u == UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */ 38 ; 39 } 40