summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/neg-abs-1.c
blob: 20691ff2c4b9a9d8ce456c0b2ae26d5171ea19ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Make sure that we use abs.fmt and neg.fmt when the signs of NaNs don't
   matter.  */
/* { dg-do compile } */
/* { dg-options "-O2 -mhard-float -ffinite-math-only" } */
/* { dg-final { scan-assembler "neg.s" } } */
/* { dg-final { scan-assembler "neg.d" } } */
/* { dg-final { scan-assembler "abs.s" } } */
/* { dg-final { scan-assembler "abs.d" } } */

NOMIPS16 float f1 (float f) { return -f; }
NOMIPS16 float f2 (float f) { return __builtin_fabsf (f); }
NOMIPS16 double d1 (double d) { return -d; }
NOMIPS16 double d2 (double d) { return __builtin_fabs (d); }