diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/recip-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/recip-1.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/recip-1.c b/gcc/testsuite/gcc.dg/tree-ssa/recip-1.c new file mode 100644 index 000000000..36f2c23de --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/recip-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -funsafe-math-optimizations -fdump-tree-recip" } */ + +float e(float *x, float *y, float *z) +{ + float m = __builtin_sqrt (*x * *x + *y * *y + *z * *z); + *x /= m; + *y /= m; + *z /= m; +} + +/* Look for only one division. */ +/* { dg-final { scan-tree-dump-times "= .* /" 1 "recip" } } */ +/* { dg-final { cleanup-tree-dump "recip" } } */ |