summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/20141202-1.c
blob: 0ea6369f4960f0ea962a834214347a640ded8e0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do run } */

extern void abort (void);

int foo (int x)
{
  return (x / 2) / ((-__INT_MAX__ - 1) / -2);
}

int main()
{
  if (foo (- __INT_MAX__ - 1) != -1)
    abort ();
  return 0;
}