[committed] testsuite: Adjust gcc.dg/cpp/if-2.c for 16-bit targets

Message ID ZVR6Ggrw8q5oUsi7@tucnak
State Unresolved
Headers
Series [committed] testsuite: Adjust gcc.dg/cpp/if-2.c for 16-bit targets |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek Nov. 15, 2023, 7:58 a.m. UTC
  On Tue, Nov 14, 2023 at 09:47:31PM -0700, Jeff Law wrote:
> >     c++: Implement C++26 P1854R4 - Making non-encodable string literals ill-formed [PR110341]
> >     This paper voted in as DR makes some multi-character literals ill-formed.
> >     'abcd' stays valid, but e.g. 'á' is newly invalid in UTF-8 exec charset
> >     while valid e.g. in ISO-8859-1, because it is a single character which needs
> >     2 bytes to be encoded.
> 
> Is causing 16 bit targets such as arc-elf, msp430-elf, rl78-elf to fail
> gcc.dg/cpp/if-2.c:
> 
> > Tests that now fail, but worked before (2 tests):
> > 
> > arc-sim: gcc.dg/cpp/if-2.c (test for excess errors)
> > arc-sim: gcc.dg/cpp/if-2.c multi-character charconst (test for warnings, line 21)
> 
> It's visible with just a cross compiler, so you don't need a full cross
> setup.    I'm not currently looking into these failures at all, just thought
> you might want to know.

Fixed thusly, tested with msp430-elf cross and on x86_64-linux, committed to
trunk as obvious:

2023-11-15  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/cpp/if-2.c: Adjust expected diagnostics for 16-bit targets.



	Jakub
  

Patch

--- gcc/testsuite/gcc.dg/cpp/if-2.c.jj	2023-11-14 18:28:21.068696191 +0100
+++ gcc/testsuite/gcc.dg/cpp/if-2.c	2023-11-15 08:49:05.805629059 +0100
@@ -17,8 +17,8 @@ 
 #error 0x1234	/* { dg-bogus "error" "wide charconst recognition 3" } */
 #endif
 
-/* The 'character constant (is )?too long' message is produced by 16-bit targets.  */
-#if 'abcd' /* { dg-warning "(multi-character character constant)|(character constant (is )?too long)" "multi-character charconst" } */
+/* The 'multi-character literal with 4 characters exceeds 'int' size of \[0-9]+ bytes' message is produced by 16-bit targets.  */
+#if 'abcd' /* { dg-warning "(multi-character character constant)|(multi-character literal with 4 characters exceeds 'int' size of \[0-9]+ bytes)" "multi-character charconst" } */
 #endif
 
 #if 'abcdefghi' /* { dg-warning "multi-character literal with \[0-9]+ characters exceeds 'int' size of \[0-9]+ bytes" } */