From 9d30f270db7f21cd6a501dc94b28a76831444e87 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 29 Dec 2006 09:15:08 +0100 Subject: re PR preprocessor/29612 (gcc --save-temps does not give "multi-character character constant" error) PR preprocessor/29612 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not only when new_sysp is non-zero. * gcc.dg/cpp/pr29612-1.c: New test. * gcc.dg/cpp/pr29612-2.c: New test. From-SVN: r120257 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/cpp/pr29612-1.c | 15 +++++++++++++++ gcc/testsuite/gcc.dg/cpp/pr29612-2.c | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cpp/pr29612-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/pr29612-2.c (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7a5a719..8c072e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-12-29 Jakub Jelinek + + PR preprocessor/29612 + * gcc.dg/cpp/pr29612-1.c: New test. + * gcc.dg/cpp/pr29612-2.c: New test. + 2006-12-28 Paul Thomas PR fortran/30034 diff --git a/gcc/testsuite/gcc.dg/cpp/pr29612-1.c b/gcc/testsuite/gcc.dg/cpp/pr29612-1.c new file mode 100644 index 0000000..f840c38 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr29612-1.c @@ -0,0 +1,15 @@ +/* PR preprocessor/29612 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +# 6 "pr29612-1.c" + +int foo (void) { return 'ab'; } /* { dg-warning "multi-character" } */ + +# 1 "foo.h" 1 3 + +int bar (void) { return 'ab'; } /* No warning in system header. */ + +# 14 "pr29612-1.c" 2 + +int baz (void) { return 'ab'; } /* { dg-warning "multi-character" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/pr29612-2.c b/gcc/testsuite/gcc.dg/cpp/pr29612-2.c new file mode 100644 index 0000000..813eb77 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr29612-2.c @@ -0,0 +1,18 @@ +/* PR preprocessor/29612 */ +/* { dg-do preprocess } */ +/* { dg-options "-Wtraditional -fno-show-column" } */ + +# 6 "pr29612-2.c" + +#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */ +#endif + +# 1 "foo.h" 1 3 + +#if 1U +#endif /* No warning in system header. */ + +# 16 "pr29612-2.c" 2 + +#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */ +#endif -- cgit v1.1