aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr57656.c
blob: 02490140105984cc4cf424912fbebbd2e77ddcb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do run } */
/* { dg-additional-options "-fstrict-overflow" } */

int main (void)
{
  int a = -1;
  int b = __INT_MAX__;
  int c = 2;
  int t = 1 - ((a - b) / c);  // t = 1 - ( __INT_MIN__ / 2 )
  if (t != (1 - (-1 - __INT_MAX__) / 2))
    __builtin_abort();
  return 0;
}