diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/signbit-2.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/signbit-2.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/signbit-2.c b/gcc/testsuite/gcc.target/i386/signbit-2.c new file mode 100644 index 00000000000..8ca63965062 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/signbit-2.c @@ -0,0 +1,29 @@ +/* PR optimization/8746 */ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O1 -mtune=i586" } */ + +extern void abort (void); + +unsigned short r0; + +int foo(int x) +{ + unsigned short r = x&0xf000; + + if (!(r&0x8000)) + { + r0 = r; + return 0; + } + else + return 1; +} + +int main(void) +{ + if (foo(0x8000) != 1) + abort(); + + return 0; +} |