summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/pr43893.c
blob: b85e9242bb33cf11b3c891fa952dc4cc2fe4b0a6 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* PR c/43893 */
/* { dg-do run } */

extern void abort (void);

int
main ()
{
  int c;
  unsigned int i;
  int j;
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (i = 0; i < 1; i++)
    c++;
  if (c != 1)
    abort ();
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (i = 0; i <= 0; i++)
    c++;
  if (c != 1)
    abort ();
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (j = - __INT_MAX__ - 1; j < - __INT_MAX__; j++)
    c++;
  if (c != 1)
    abort ();
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (j = - __INT_MAX__ - 1; j <= - __INT_MAX__ - 1; j++)
    c++;
  if (c != 1)
    abort ();
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (i = 2U * __INT_MAX__ + 1; i > 2U * __INT_MAX__; i--)
    c++;
  if (c != 1)
    abort ();
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (i = 2U * __INT_MAX__ + 1; i >= 2U * __INT_MAX__ + 1; i--)
    c++;
  if (c != 1)
    abort ();
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (j = __INT_MAX__; j > __INT_MAX__ - 1; j--)
    c++;
  if (c != 1)
    abort ();
  c = 0;
#pragma omp parallel for reduction(+:c)
  for (j = __INT_MAX__; j >= __INT_MAX__; j--)
    c++;
  if (c != 1)
    abort ();
  return 0;
}