xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/i386-signbit-3.c (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 /* PR optimization/8746 */
2 /* { dg-do run { target i?86-*-* } } */
3 /* { dg-options "-O1 -mcpu=i586" } */
4 
5 extern void abort (void);
6 
7 volatile int j;
8 
f0()9 void f0() { j=0; }
f1()10 void f1() { j=1; }
11 
foo(int x)12 int foo(int x)
13 {
14   if ((short int)(x&0x8000) > (short int)0)
15   {
16     f0();
17     return 0;
18   }
19   else
20   {
21     f1();
22     return 1;
23   }
24 }
25 
main(void)26 int main(void)
27 {
28   if (foo(0x8000) != 1)
29     abort();
30 
31    return 0;
32 }
33