public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] testsuite: Fix up cheri-overloads-4.c
@ 2023-02-28 12:10 Alex Coplan
  0 siblings, 0 replies; only message in thread
From: Alex Coplan @ 2023-02-28 12:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0ad9a9e9b3882f6d2bf5c14e3b7ce47e60040f21

commit 0ad9a9e9b3882f6d2bf5c14e3b7ce47e60040f21
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Mon Jan 30 15:19:49 2023 +0000

    testsuite: Fix up cheri-overloads-4.c
    
    This test was failing in C++ mode since it tested for a -Wsign-conversion
    warning but -Wsign-conversion isn't enabled by -Wconversion in C++ mode.
    This patch fixes the issue by adding -Wsign-conversion to the options used for
    the test.
    
    A couple of other dg-warning directives in the test did account for this
    difference between C and C++ modes by XFAILing in C++ mode; with this change, we
    can now drop these XFAILs.

Diff:
---
 gcc/testsuite/c-c++-common/cheri-overloads-4.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/cheri-overloads-4.c b/gcc/testsuite/c-c++-common/cheri-overloads-4.c
index 6e437165f96..89c3a1e7f14 100644
--- a/gcc/testsuite/c-c++-common/cheri-overloads-4.c
+++ b/gcc/testsuite/c-c++-common/cheri-overloads-4.c
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target cheri_capability_any } */
-/* { dg-options "-W -Wall -Wconversion" } */
+/* { dg-options "-W -Wall -Wconversion -Wsign-conversion" } */
 
 #include <stddef.h>
 #include <string.h>
@@ -77,7 +77,7 @@ intcap_ret_voidp (__intcap_t a, __uintcap_t b)
 int *__capability
 intp_intcap (int *__capability a, __intcap_t b)
 {
-  return __builtin_cheri_cap_build (a, b); /* { dg-warning {may change the sign} "" { xfail c++ } } */
+  return __builtin_cheri_cap_build (a, b); /* { dg-warning {may change the sign} "" } */
 }
 
 int *__capability
@@ -90,7 +90,7 @@ intp_intp (int *__capability a, int *__capability b)
 int *__capability
 intp_int64 (int *__capability a, int64_t b)
 {
-  return __builtin_cheri_cap_build (a, b); /* { dg-warning {may change the sign} "" { xfail c++ } } */
+  return __builtin_cheri_cap_build (a, b); /* { dg-warning {may change the sign} "" } */
 }
 
 int *__capability

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

only message in thread, other threads:[~2023-02-28 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 12:10 [gcc(refs/vendors/ARM/heads/morello)] testsuite: Fix up cheri-overloads-4.c Alex Coplan

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).