aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ginclude/float.h3
-rw-r--r--gcc/testsuite/gcc.dg/cr-decimal-dig-3.c14
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h
index 83c5ad5..39139ee 100644
--- a/gcc/ginclude/float.h
+++ b/gcc/ginclude/float.h
@@ -285,7 +285,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif /* C2X */
-#ifdef __STDC_WANT_IEC_60559_BFP_EXT__
+#if (defined __STDC_WANT_IEC_60559_BFP_EXT__ \
+ || defined __STDC_WANT_IEC_60559_EXT__)
/* Number of decimal digits for which conversions between decimal
character strings and binary formats, in both directions, are
correctly rounded. */
diff --git a/gcc/testsuite/gcc.dg/cr-decimal-dig-3.c b/gcc/testsuite/gcc.dg/cr-decimal-dig-3.c
new file mode 100644
index 0000000..8e07b67
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cr-decimal-dig-3.c
@@ -0,0 +1,14 @@
+/* Test C2x CR_DECIMAL_DIG: defined for __STDC_WANT_IEC_60559_EXT__. */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x" } */
+
+#define __STDC_WANT_IEC_60559_EXT__
+#include <float.h>
+
+#ifndef CR_DECIMAL_DIG
+#error "CR_DECIMAL_DIG not defined"
+#endif
+
+#if CR_DECIMAL_DIG < DECIMAL_DIG + 3
+#error "CR_DECIMAL_DIG too small"
+#endif