| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target c99_runtime } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-optimized -funsafe-math-optimizations -fno-math-errno -ffinite-math-only" } */ |
| 4 |
|
| 5 |
#define FOO(type, cmp, suffix, no) \ |
| 6 |
int f_##no(type x, type y) \ |
| 7 |
{ \ |
| 8 |
type gen_##no(); \ |
| 9 |
type xs = __builtin_sqrt##suffix((gen_##no())); \ |
| 10 |
type xy = __builtin_sqrt##suffix((gen_##no())); \ |
| 11 |
return (xs cmp xy); \ |
| 12 |
} |
| 13 |
|
| 14 |
#define GEN_FOO(type, suffix) \ |
| 15 |
FOO(type, <, suffix, suffix##1) \ |
| 16 |
FOO(type, <=, suffix, suffix##2) \ |
| 17 |
FOO(type, >, suffix, suffix##3) \ |
| 18 |
FOO(type, >=, suffix, suffix##4) \ |
| 19 |
FOO(type, ==, suffix, suffix##5) \ |
| 20 |
FOO(type, !=, suffix, suffix##6) |
| 21 |
|
| 22 |
GEN_FOO(float, f) |
| 23 |
GEN_FOO(double, ) |
| 24 |
GEN_FOO(long double, l) |
| 25 |
|
| 26 |
/* { dg-final { scan-tree-dump-not "__builtin_sqrtf" "optimized" } } */ |
| 27 |
/* { dg-final { scan-tree-dump-not "__builtin_sqrt" "optimized" } } */ |
| 28 |
/* { dg-final { scan-tree-dump-not "__builtin_sqrtl" "optimized" } } */ |