Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.target / i386 / ifcvt-onecmpl-abs-1.c
1 /* { dg-do compile } */
2 /* This test checks for if-conversion of one's complement
3  * abs function.  */
4 /* { dg-options "-O -mtune=generic" } */
5 /* { dg-final { scan-assembler "cltd" } } */
6 /* { dg-final { scan-assembler "xor" } } */
7
8 /* Check code generation for one's complement version of abs */
9
10 int onecmplabs(int x)
11 {
12   if (x < 0)
13     x = ~x;
14   return x;
15 }