aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2017-01-09 23:31:38 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2017-01-09 16:31:38 -0700
commitdfa6951fdc5a4e840aa9974dd8179ffebf8f0593 (patch)
treeefb26f15f1570dd6c3b1b84cf9badad41b290bad
parenta271e415611a80f1e86e625fd61360e193d04474 (diff)
downloadgcc-dfa6951fdc5a4e840aa9974dd8179ffebf8f0593.zip
gcc-dfa6951fdc5a4e840aa9974dd8179ffebf8f0593.tar.gz
gcc-dfa6951fdc5a4e840aa9974dd8179ffebf8f0593.tar.bz2
PR testsuite/79036 - gcc.dg/tree-ssa/builtin-sprintf.c fails starting with r244037
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
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 724763f..1054e20 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c
index 275cb28..7757d5e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c
@@ -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);