summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr55236.c
blob: dc66c04c3272d606b29c40c0deb8515bc627c58d (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
/* PR tree-optimization/55236 */
/* { dg-do run } */
/* { dg-options "-O2 -fwrapv" } */

extern void abort ();

__attribute__((noinline, noclone)) void
foo (int i)
{
  if (i > 0)
    abort ();
  i = -i;
  if (i < 0)
    return;
  abort ();
}

__attribute__((noinline, noclone)) void
bar (int i)
{
  if (i > 0 || (-i) >= 0)
    abort ();
}

int
main ()
{
  foo (-__INT_MAX__ - 1);
  bar (-__INT_MAX__ - 1);
  return 0;
}