8sa1-gcc/gcc/testsuite/gcc.dg/cpp/escape-2.c
Neil Booth f8710242d3 cpp.texi: Update for handling of charconsts.
* cpp.texi: Update for handling of charconsts.
	* cpplex.c (maybe_read_ucs): Don't accept D800-DFFF.  Update
	diagnostics.  Skip to the end if the UCS is too short.
	(cpp_interpret_charconst): Long charconsts issue a warning
	not an error.

	* gcc.dg/cpp/charconst.c: New tests.
	* gcc.dg/cpp/escape.c: New tests.
	* gcc.dg/cpp/escape-1.c: New tests.
	* gcc.dg/cpp/escape-2.c: New tests.
	* gcc.dg/cpp/ucs.c: New tests.

From-SVN: r42514
2001-05-23 22:50:28 +00:00

21 lines
577 B
C

/* Copyright (C) 2001 Free Software Foundation, Inc. */
/* { dg-do compile } */
/* { dg-options "-pedantic -std=c99 -fno-show-column" } */
/* This tests various diagnostics with -pedantic about escape
sequences, for both the preprocessor and the compiler.
Neil Booth, 22 May 2001. */
#if '\e' /* { dg-warning "non-ISO" "non-ISO \\e" } */
#endif
#if '\u00a0' /* { dg-bogus "unknown" "\\u is known in C99" } */
#endif
void foo ()
{
int c = '\E'; /* { dg-warning "non-ISO" "non-ISO \\E" } */
c = '\u00a0'; /* { dg-bogus "unknown" "\\u is known in C99" } */
}