aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/ifcvt-onecmpl-abs-1.c
blob: 7d26f31c72534069ef212e52eb08c3542a541e3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* This test checks for if-conversion of one's complement
 * abs function.  */
/* { dg-options "-O -mtune=generic" } */
/* { dg-final { scan-assembler "cltd" } } */
/* { dg-final { scan-assembler "xor" } } */

/* Check code generation for one's complement version of abs */

int onecmplabs(int x)
{
  if (x < 0)
    x = ~x;
  return x;
}