summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/rsqrt-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/rsqrt-3.c')
-rw-r--r--gcc/testsuite/gcc.target/mips/rsqrt-3.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/rsqrt-3.c b/gcc/testsuite/gcc.target/mips/rsqrt-3.c
new file mode 100644
index 000000000..cfa771ef8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/rsqrt-3.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 isa=4 -mhard-float" } */
+/* { dg-final { scan-assembler-not "rsqrt.d" } } */
+/* { dg-final { scan-assembler-not "rsqrt.s" } } */
+
+extern double sqrt(double);
+extern float sqrtf(float);
+
+double foo(double x)
+{
+ return 1.0/sqrt(x);
+}
+
+double bar(double x)
+{
+ return sqrt(1.0/x);
+}
+
+float foof(float x)
+{
+ return 1.0f/sqrtf(x);
+}
+
+float barf(float x)
+{
+ return sqrtf(1.0f/x);
+}