summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr23518.c
blob: 3c6bd2754e68e4b82c87c5282c234893b1afe1f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR tree-optimization/23518.
   make_range used to transform a + 1 < 0 into a < -1 even when a is
   signed and -fwrapv is given.  Make sure that no longer happens.  */

/* { dg-do run } */
/* { dg-options "-O2 -fwrapv" } */

#include <limits.h>

extern void abort (void);
extern void exit (int);

int
main (void)
{
  int a = INT_MAX;
  if ((a < 0) || (a + 1 < 0))
    exit (0);

  abort ();
}