public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5639] testsuite: Fix up pr111309-2.c on arm [PR111309]
@ 2023-11-21  9:04 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2023-11-21  9:04 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1fcfd224ff67afd08ea5aa66a8bd687bb21798b2

commit r14-5639-g1fcfd224ff67afd08ea5aa66a8bd687bb21798b2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Nov 21 10:03:26 2023 +0100

    testsuite: Fix up pr111309-2.c on arm [PR111309]
    
    ARM defaults to -fshort-enums and the following testcase FAILs there in 2
    lines.  The difference is that in C++, E0 has enum E type, which normally
    has unsigned int underlying type, so it isn't int nor something that
    promotes to int, which is why we diagnose it (in C it is promoted to int).
    But with -fshort-enums, the underlying type is unsigned char in that case,
    which promotes to int just fine.
    
    The following patch adjusts the expectations, such that we don't expect
    it on arm or when people manually test with -fshort-enums.
    
    2023-11-21  Jakub Jelinek  <jakub@redhat.com>
    
            PR c/111309
            * c-c++-common/pr111309-2.c (foo): Don't expect errors for C++ with
            -fshort-enums if second argument is E0.

Diff:
---
 gcc/testsuite/c-c++-common/pr111309-2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/pr111309-2.c b/gcc/testsuite/c-c++-common/pr111309-2.c
index 535208b1cd3..13e967353bf 100644
--- a/gcc/testsuite/c-c++-common/pr111309-2.c
+++ b/gcc/testsuite/c-c++-common/pr111309-2.c
@@ -32,7 +32,7 @@ foo (void)
   __builtin_clzg (0U, 2LL);	/* { dg-error "does not have 'int' type" } */
   __builtin_clzg (0U, 2U);	/* { dg-error "does not have 'int' type" } */
   __builtin_clzg (0U, true);
-  __builtin_clzg (0U, E0);	/* { dg-error "does not have 'int' type" "" { target c++ } } */
+  __builtin_clzg (0U, E0);	/* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */
   __builtin_ctzg ();		/* { dg-error "too few arguments" } */
   __builtin_ctzg (0U, 1, 2);	/* { dg-error "too many arguments" } */
   __builtin_ctzg (0);		/* { dg-error "has signed type" } */
@@ -51,7 +51,7 @@ foo (void)
   __builtin_ctzg (0U, 2LL);	/* { dg-error "does not have 'int' type" } */
   __builtin_ctzg (0U, 2U);	/* { dg-error "does not have 'int' type" } */
   __builtin_ctzg (0U, true);
-  __builtin_ctzg (0U, E0);	/* { dg-error "does not have 'int' type" "" { target c++ } } */
+  __builtin_ctzg (0U, E0);	/* { dg-error "does not have 'int' type" "" { target { c++ && { ! short_enums } } } } */
   __builtin_clrsbg ();		/* { dg-error "too few arguments" } */
   __builtin_clrsbg (0, 1);	/* { dg-error "too many arguments" } */
   __builtin_clrsbg (0U);	/* { dg-error "has unsigned type" } */

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

only message in thread, other threads:[~2023-11-21  9:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21  9:04 [gcc r14-5639] testsuite: Fix up pr111309-2.c on arm [PR111309] 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).