1 /* { dg-do compile } */
2 /* { dg-options "-O -fstrict-overflow -fdump-tree-optimized" } */
3 /* { dg-add-options c99_runtime } */
4 /* { dg-require-effective-target c99_runtime } */
5
max(int a,int b)6 static int max(int a,int b){return (a<b)?b:a;}
f(int x,int y)7 int f(int x,int y){return max(-x,-y);}
g(int x,int y)8 int g(int x,int y){return max(~x,~y);}
h(double x,double y)9 double h(double x,double y){return __builtin_fmax(-x,-y);}
10
11 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "optimized" } } */
12 /* { dg-final { scan-tree-dump "__builtin_fmin" "optimized" } } */
13