public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3385] testsuite: Fix up c2x-enum-1.c for 32-bit arches [PR107311]
@ 2022-10-19 16:53 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-10-19 16:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a01eae670600852f78e8df1b88259572f181d42e

commit r13-3385-ga01eae670600852f78e8df1b88259572f181d42e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Oct 19 18:49:03 2022 +0200

    testsuite: Fix up c2x-enum-1.c for 32-bit arches [PR107311]
    
    On Wed, Oct 19, 2022 at 02:57:59PM +0000, Joseph Myers wrote:
    > I think the type checked for e5a should be conditional on __LONG_MAX__ >
    > __INT_MAX__; everything else there should be OK regardless.
    
    This patch does that.
    
    2022-10-19  Jakub Jelinek  <jakub@redhat.com>
    
            PR c/107311
            * gcc.dg/c2x-enum-1.c (enum e5): Expect e5a type inside of
            enum to be int rather than long if long isn't wider than int.

Diff:
---
 gcc/testsuite/gcc.dg/c2x-enum-1.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/c2x-enum-1.c b/gcc/testsuite/gcc.dg/c2x-enum-1.c
index c4371faacee..984a4e70d37 100644
--- a/gcc/testsuite/gcc.dg/c2x-enum-1.c
+++ b/gcc/testsuite/gcc.dg/c2x-enum-1.c
@@ -82,7 +82,12 @@ enum e5 { e5a = __LONG_MAX__,
 	  e5b, e5c, e5d = ((typeof (e5b)) -1) < 0,
 	  e5e = (unsigned long) -1,
 	  e5f, e5g = ((typeof (e5e)) -1) > 0,
-	  TYPE_CHECK (e5a, long), TYPE_CHECK (e5e, unsigned long) };
+#if __LONG_MAX__ > __INT_MAX__
+	  TYPE_CHECK (e5a, long),
+#else
+	  TYPE_CHECK (e5a, int),
+#endif
+	  TYPE_CHECK (e5e, unsigned long) };
 extern enum e5 e5v;
 extern typeof (e5a) e5v;
 extern typeof (e5b) e5v;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-19 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 16:53 [gcc r13-3385] testsuite: Fix up c2x-enum-1.c for 32-bit arches [PR107311] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).