summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-pr64255.c
blob: 8d075c14285697e879b697680b3bfdfee8f3d59f (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
32
33
34
35
36
37
38
/*
   pr64255.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

/* PR rtl-optimization/64255 */

void
bar (long i, unsigned long j)
{
  if (i != 1 || j != 1)
    ASSERT (0);
}

void
foo (long i)
{
  unsigned long j;

  if (!i)
    return;
  j = i >= 0 ? (unsigned long) i : - (unsigned long) i;
  if ((i >= 0 ? (unsigned long) i : - (unsigned long) i) != j)
    ASSERT (0);
  bar (i, j);
}

void
testTortureExecute (void)
{
  foo (1);
  return;
}