cpptrad.c: Update comment.
authorNeil Booth <neil@daikokuya.co.uk>
Tue, 2 Jul 2002 22:33:38 +0000 (22:33 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Tue, 2 Jul 2002 22:33:38 +0000 (22:33 +0000)
* cpptrad.c: Update comment.
testsuite:
* gcc.dg/cpp/trad/directive.c: Add test.
* gcc.dg/cpp/trad/macroargs.c: Add test.
* gcc.dg/cpp/trad/recurse-3.c: Add tests.

From-SVN: r55196

gcc/ChangeLog
gcc/cpptrad.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/trad/directive.c
gcc/testsuite/gcc.dg/cpp/trad/macroargs.c
gcc/testsuite/gcc.dg/cpp/trad/recurse-3.c

index 5b75217644cc0a204492d6ffbab86fc982c8b4f0..8dae99bae5e18af0f6ba91159e7d06989dba0253 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-03  Neil Booth  <neil@daikokuya.co.uk>
+
+       * cpptrad.c: Update comment.
+
 2002-07-02  Neil Booth  <neil@daikokuya.co.uk>
        
        * doc/cpp.texi: Update for traditional preprocessing changes.
index 4ae1e9c7cb04d652f64bd874b26b6c6ae7407536..915dceb24f70c4246cc820360107d57fe50ea2e9 100644 (file)
@@ -491,7 +491,8 @@ scan_out_logical_line (pfile, macro)
          if ((lex_state == ls_fun_open || lex_state == ls_fun_close)
              && !pfile->state.in_directive)
            {
-             /* Newlines in arguments become a space.  */
+             /* Newlines in arguments become a space, but we don't
+                clear any in-progress quote.  */
              if (lex_state == ls_fun_close)
                out[-1] = ' ';
              continue;
index ed70f6105374d2b0277ce704b4ce3a3497719ad2..62ce01d600ed7966d73e8fd8c74a9b5d29ab4d54 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-03  Neil Booth  <neil@daikokuya.co.uk>
+
+       * gcc.dg/cpp/trad/directive.c: Add test.
+       * gcc.dg/cpp/trad/macroargs.c: Add test.
+       * gcc.dg/cpp/trad/recurse-3.c: Add tests.
+
 2002-07-02  Neil Booth  <neil@daikokuya.co.uk>
 
        * gcc.dg/cpp/cmdlne-M.c: New test.
index 5139c3322f9f40459498d18d2de626a24686a112..04203097b2433cbf49236eec2a173ecf12c2ce5a 100644 (file)
  #if 0 /* { dg-bogus "unterminated" } */
 
 #wrong /* { dg-error "invalid" } */
+
+#define foo 2
+#define bar + 3
+#define foobar 6
+
+#if foo/**/bar != 5
+# error Comments in directive is a separator /* { dg-bogus "error" } */
+#endif
index 12effa750040ec6078e4086e47035b1c195ed002..ce28cccf99501def7483bb27567b55f39440fb3a 100644 (file)
@@ -4,6 +4,7 @@
 /* { dg-do run } */
 
 #define f(x, y) "x y"
+#define g(x) x
 
 extern void abort (void);
 
@@ -20,5 +21,10 @@ foo
   if (strcmp (str1, str2))
     abort ();
 
+  /* Verify that quoted state is preserved over a newline.  */
+  if (strcmp (g /* { dg-bogus "unterminated 2" } */ ("1
+, 2"), "1 , 2"))       
+    abort ();
+
   return 0;
 }
index 8ff65cc801f5858516bbe02b6365fff57353627e..91485ae5f4500d7d7e98c92ba5f531bd681719b7 100644 (file)
@@ -14,3 +14,12 @@ f(f,f,f,f,f,f,f,f,f)        /* { dg-bogus "detected recursion" } */
    sources so let's try it too.  */
 #define foo(x,y) bar (x (y,0), y)
 foo (foo, baz);               /* { dg-bogus "detected recursion" } */
+
+#define mac mac/**/ro
+mac                   /* { dg-bogus "detected recursion" } */
+
+#define mac2 mac2
+"mac2"                        /* { dg-bogus "detected recursion" } */
+
+#define macro "macro
+macro mac2            /* { dg-bogus "detected recursion" } */