aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-1.c
blob: 855515edb97778f245147bf0798083cf98f34c93 (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
/* { dg-do run } */
/* { dg-additional-options "-fstrict-overflow" } */

extern void abort (void);

int a, b, c, d, e, f, g, h = 1, i;

int foo (int p)
{
  return p < 0 && a < - __INT_MAX__ - 1 - p ? 0 : 1;
}

int *bar ()
{
  int j; 
  i = h ? 0 : 1 % h;
  for (j = 0; j < 1; j++)
    for (d = 0; d; d++)
      for (e = 1; e;)
	return 0;
  return 0;
}

int baz ()
{
  for (; b >= 0; b--)
    for (c = 1; c >= 0; c--)
      {
	int *k = &c;
	for (;;)
	  {
	    for (f = 0; f < 1; f++)
	      {
		g = foo (*k);
		bar ();
	      }
	    if (*k)
	      break;
	    return 0;
	  }
      }
  return 0;
}

int main ()
{
  baz ();
  if (b != 0)
    abort ();
  return 0;
}