This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
adjust gcc.dg/cpp/ucs.c
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Dec 2001 17:56:52 -0800
- Subject: adjust gcc.dg/cpp/ucs.c
This has been failing on Alpha since it was added. I finally got
around to looking at it.
On x86, HOST_WIDE_INT is normally 32 bits wide, as is wchar_t, so
the number of wide characters we can represent is one, thus the
expected "character constant too long" warning.
On Alpha, HOST_WIDE_INT is normally 64 bits wide, but wchar_t is
32 bits wide, thus we can represent a wide multi-character constant
with two elements, and we fall into the "multi-character character
constant" warning.
I.e. everything's kosher after all (unless you want to take the
stance that we should have suppressed the additional warnings after
cpp_parse_escape fails, which I don't since that's more work).
r~
* gcc.dg/cpp/ucs.c: Adjust expected warning for 64-bit hosts.
Index: gcc.dg/cpp/ucs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/ucs.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 ucs.c
*** ucs.c 2001/05/23 22:50:28 1.1
--- ucs.c 2001/12/08 01:49:49
*************** void foo ()
*** 22,28 ****
c = L"\U1234"[0]; /* { dg-error "incomplete" "incompete UCN 2" } */
c = L'\u000x'; /* { dg-error "non-hex" "non-hex digit in UCN" } */
! /* { dg-warning "too long" "" { target *-*-* } 24 } */
c = '\u0024'; /* { dg-bogus "invalid" "0024 is a valid UCN" } */
c = "\u0040"[0]; /* { dg-bogus "invalid" "0040 is a valid UCN" } */
--- 22,30 ----
c = L"\U1234"[0]; /* { dg-error "incomplete" "incompete UCN 2" } */
c = L'\u000x'; /* { dg-error "non-hex" "non-hex digit in UCN" } */
! /* If sizeof(HOST_WIDE_INT) > sizeof(wchar_t), we can get a multi-character
! constant warning even for wide characters. */
! /* { dg-warning "too long|multi-character" "" { target *-*-* } 24 } */
c = '\u0024'; /* { dg-bogus "invalid" "0024 is a valid UCN" } */
c = "\u0040"[0]; /* { dg-bogus "invalid" "0040 is a valid UCN" } */