cpphash.c (trad_stringify): Adjust p after stringification as well.
authorJakub Jelinek <jakub@redhat.com>
Tue, 2 May 2000 16:33:44 +0000 (18:33 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 2 May 2000 16:33:44 +0000 (18:33 +0200)
* cpphash.c (trad_stringify): Adjust p after stringification as
well.

* gcc.dg/cpp-tradstringify.c: New test.

From-SVN: r33612

gcc/ChangeLog
gcc/cpphash.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp-tradstringify.c [new file with mode: 0644]

index f983bc7249fb7fcdc398d4a896f0b3e302429b18..c751b6fe49c3a6e66593eb5e3521b7678eeeb724 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * cpphash.c (trad_stringify): Adjust p after stringification as
+       well.
+
 2000-05-02  Zack Weinberg  <zack@wolery.cumb.org>
 
        * cpplib.h (CPP_POP, parse_cleanup_t): Delete.
index 6ad8350a69fc834f24b3dbdedeb37a7a3d39a8b4..3fcd006962be34394d88b4da86b12c47a7bea84e 100644 (file)
@@ -433,6 +433,7 @@ trad_stringify (pfile, base, len, argc, argv, pat, endpat, last)
                     argv[i].rest_arg);
            last = CPP_WRITTEN (pfile);
            base = p + argv[i].len;
+           p = base;
            goto proceed;
          }
       p++;
index cbe09a0679a9b3a4d9223c1c2f3454e93d287018..33cac7c238d362ceadae9ca4d84c34af5a9b10f7 100644 (file)
@@ -2,6 +2,7 @@
 
        * gcc.c-torture/compile/20000502-1.c: New test.
        * g++.old-deja/g++.other/align.C: New test.
+       * gcc.dg/cpp-tradstringify.c: New test.
 
 Sun Apr 23 14:41:33 2000  Jeffrey A Law  (law@cygnus.com)
 
diff --git a/gcc/testsuite/gcc.dg/cpp-tradstringify.c b/gcc/testsuite/gcc.dg/cpp-tradstringify.c
new file mode 100644 (file)
index 0000000..3a568ce
--- /dev/null
@@ -0,0 +1,4 @@
+/* Test whether traditional stringify works.  */
+/* { dg-do preprocess } */
+/* { dg-options "-traditional" } */
+#define foo(a, b) c="a"; d="b";