summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-29 08:15:08 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-29 08:15:08 +0000
commit5d70627e0fc18d73184b9dc1d3d23ace30710dab (patch)
tree56b100954658b22feb7776f7f8a55f56531a16e0 /gcc/testsuite/gcc.dg/cpp
parent702addadee81263ac543b28d14fd7725d60247ac (diff)
downloadgcc-5d70627e0fc18d73184b9dc1d3d23ace30710dab.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120257 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr29612-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr29612-2.c18
2 files changed, 33 insertions, 0 deletions
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 00000000000..f840c3823a6
--- /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 00000000000..813eb77af13
--- /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