aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/387-9.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/387-9.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/387-9.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/387-9.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/387-9.c
new file mode 100644
index 000000000..2667aa468
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/387-9.c
@@ -0,0 +1,35 @@
+/* Verify that 387 fsincos instruction is generated. */
+/* { dg-do compile } */
+/* { dg-options "-O -funsafe-math-optimizations -mfpmath=387 -mfancy-math-387" } */
+
+extern double sin (double);
+extern double cos (double);
+extern void sincos (double, double *, double *);
+
+double f1(double x)
+{
+ double s, c;
+ sincos (x, &s, &c);
+ return s + c;
+}
+
+double f2(double x)
+{
+ double s, c, tmp;
+ sincos (x, &s, &tmp);
+ c = cos (x);
+ return s + c;
+}
+
+double f3(double x)
+{
+ double s, c, tmp;
+ sincos (x, &tmp, &c);
+ s = sin (x);
+ return s + c;
+}
+
+/* { dg-final { scan-assembler "fsincos" } } */
+/* { dg-final { scan-assembler-not "fsin " } } */
+/* { dg-final { scan-assembler-not "fcos" } } */
+/* { dg-final { scan-assembler-not "call" } } */