aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/excess-precision-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/excess-precision-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/excess-precision-2.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/excess-precision-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/excess-precision-2.c
new file mode 100644
index 000000000..b5035e5a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/excess-precision-2.c
@@ -0,0 +1,33 @@
+/* Excess precision tests. Test excess precision of constants. */
+/* { dg-do run } */
+/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */
+
+#include <float.h>
+
+extern void abort (void);
+extern void exit (int);
+
+volatile long double ldadd1 = 1.0l + 0x1.0p-30l;
+volatile long double ld11f = 1.1f;
+volatile long double ld11d = 1.1;
+volatile long double ld11 = 1.1;
+
+void
+test_const (void)
+{
+ if (1.0f + 0x1.0p-30f != ldadd1)
+ abort ();
+ if (ld11f != ld11)
+ abort ();
+ if (ld11d != ld11)
+ abort ();
+ if (1.1f != ld11)
+ abort ();
+}
+
+int
+main (void)
+{
+ test_const ();
+ exit (0);
+}