PR testsuite/79036 - gcc.dg/tree-ssa/builtin-sprintf.c fails starting with r244037
authorMartin Sebor <msebor@redhat.com>
Mon, 9 Jan 2017 23:31:38 +0000 (23:31 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Mon, 9 Jan 2017 23:31:38 +0000 (16:31 -0700)
PR testsuite/79036 - gcc.dg/tree-ssa/builtin-sprintf.c fails starting with r244037
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/builtin-sprintf.c: Handle extended formats
with different precisions.

From-SVN: r244250

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c

index 724763f..1054e20 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-09  Martin Sebor  <msebor@redhat.com>
+
+       PR testsuite/79036
+       * gcc.dg/tree-ssa/builtin-sprintf.c: Handle extended formats
+       with different precisions.
+
 2017-01-09  Eric Botcazou  <ebotcazou@adacore.com>
 
        * g++.dg/opt/call2.C: New test.
index 275cb28..7757d5e 100644 (file)
@@ -714,7 +714,16 @@ test_g_long_double (void)
   EQL ( 10,  11, "%Lg", 1.0L / 512);
 
   /* Numbers that are not exactly representable.  */
+#if __LDBL_DIG__ < 31
+  /* x86_64, for example, represents 0.1 as 1.000000...1...e-1
+     and formats it as either "0.1" (when rounded down) or "0.100001"
+     (rounded up).  */
   RNG ( 3,  8,  9, "%Lg", 0.1L);
+#else
+  /* powerpc64 represents 0.1 as 9.999999...6e-2 and formats it
+   as "0.0999999" (rounded down) or "0.1" (rounded up).  */
+  RNG ( 3,  9, 10, "%Lg", 0.1L);
+#endif
   RNG ( 4,  8,  9, "%Lg", 0.12L);
   RNG ( 5,  8,  9, "%Lg", 0.123L);
   RNG ( 6,  8,  9, "%Lg", 0.1234L);