summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/20060102-1.c
blob: 04b6a67d928a0231979fc52ab5f7fe9bf4a92458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern void abort ();

int f(int x)
{
  return (x >> (sizeof (x) * __CHAR_BIT__ - 1)) ? -1 : 1;
}

volatile int one = 1;
int main (void)
{
  /* Test that the function above returns different values for
     different signs.  */
  if (f(one) == f(-one))
    abort ();
  return 0;
}