OSDN Git Service

PR preprocessor/29612
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Dec 2006 08:15:08 +0000 (08:15 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Dec 2006 08:15:08 +0000 (08:15 +0000)
* 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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/pr29612-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/pr29612-2.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/directives.c

index 7a5a719..8c072e2 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR preprocessor/29612
+       * gcc.dg/cpp/pr29612-1.c: New test.
+       * gcc.dg/cpp/pr29612-2.c: New test.
+
 2006-12-28  Paul Thomas  <pault@gcc.gnu.org>
 
        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 (file)
index 0000000..f840c38
--- /dev/null
@@ -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 (file)
index 0000000..813eb77
--- /dev/null
@@ -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
index 1b1f833..de8eb92 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR preprocessor/29612
+       * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
+       only when new_sysp is non-zero.
+
 2006-12-28  Tom Tromey  <tromey@redhat.com>
 
        PR preprocessor/30001:
index e08698d..7fb142e 100644 (file)
@@ -942,8 +942,8 @@ do_linemarker (cpp_reader *pfile)
          flag = read_flag (pfile, flag);
          if (flag == 4)
            new_sysp = 2;
-         pfile->buffer->sysp = new_sysp;
        }
+      pfile->buffer->sysp = new_sysp;
 
       check_eol (pfile);
     }