summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-pr85529-2.c
blob: dbdb5856b127c1ffac9b3ce0abb66fd0f6614caf (plain) (blame)
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
/*
pr85529-2.c from the execute part of the gcc torture tests.
*/

#include <testfwk.h>

/* PR tree-optimization/85529 */

int
foo (int x)
{
  x &= 63;
  x -= 50;
  x |= 1;
  if (x < 0)
    return 1;
  int y = x >> 2;
  if (x >= y)
    return 1;
  return 0;
}

void
testTortureExecute (void)
{
#if !(defined (__GNUC__) && (__GNUC__ < 8))
  int i;
  for (i = 0; i < 63; i++)
    if (foo (i) != 1)
      ASSERT (0);
  return;
#endif
}