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