diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/escape-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/escape-2.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/escape-2.c b/gcc/testsuite/gcc.dg/cpp/escape-2.c new file mode 100644 index 000000000..902fad3a2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/escape-2.c @@ -0,0 +1,20 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. */ + +/* { dg-do compile } */ +/* { dg-options "-pedantic -std=c99" } */ + +/* 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 L'\u00a0' /* { dg-bogus "unknown" "\\u is known in C99" } */ +#endif + +void foo () +{ + int c = '\E'; /* { dg-warning "non-ISO" "non-ISO \\E" } */ + c = L'\u00a0'; /* { dg-bogus "unknown" "\\u is known in C99" } */ +} |