aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr55152-2.c
blob: 24068cffa4a8e2807ba7d16c4ed3def4f736e797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O -ffinite-math-only -fno-signed-zeros -fstrict-overflow -fdump-tree-optimized" } */
/* { dg-additional-options "-msse -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */

double g (double a)
{
  return (a<-a)?a:-a;
}
int f(int a)
{
  return (a<-a)?a:-a;
}

/* { dg-final { scan-tree-dump-times "\.COPYSIGN" 1 "optimized" { target ifn_copysign } } } */
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "optimized" { target ifn_copysign } } } */
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 2 "optimized" { target { ! ifn_copysign } } } } */