aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/minmax-2.c
blob: 8990c188e0511b0ff0a93db7a89980a414b3abce (plain)
1
2
3
4
5
6
7
8
9
10
11
/* { dg-do compile } */
/* { dg-options "-O -fstrict-overflow -fdump-tree-optimized" } */
/* { dg-require-effective-target c99_runtime } */

static int max(int a,int b){return (a<b)?b:a;}
int f(int x,int y){return max(-x,-y);}
int g(int x,int y){return max(~x,~y);}
double h(double x,double y){return __builtin_fmax(-x,-y);}

/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "optimized" } } */
/* { dg-final { scan-tree-dump "__builtin_fmin" "optimized" } } */