summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/i386-signbit-3.c
blob: ae97f215603210ad5460ffdeb959f31d15847893 (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
/* PR optimization/8746 */
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-O1 -mtune=i586" } */

extern void abort (void);

volatile int j;

void f0() { j=0; }
void f1() { j=1; }

int foo(int x)
{
  if ((short int)(x&0x8000) > (short int)0)
  {
    f0();
    return 0;
  }
  else
  {
    f1();
    return 1;
  }
}

int main(void)
{
  if (foo(0x8000) != 1)
    abort();

   return 0;
}
OpenPOWER on IntegriCloud