summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/signbit-1.c
blob: 745796d706fe87e641ba042457bab34fb4af8e9f (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
/* PR optimization/8746 */
/* { dg-do run } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O1 -mtune=i586" } */

extern void abort (void);

unsigned char r0;

int foo(int x)
{
  unsigned char r = x&0xf0;

  if (!(r&0x80))
  {
    r0 = r;
    return 0;
  }
  else
    return 1;
}

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

   return 0;
}