OSDN Git Service

libcpp
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Mar 2008 18:08:40 +0000 (18:08 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Mar 2008 18:08:40 +0000 (18:08 +0000)
2008-03-06  Markus Milleder  <markus.milleder@generali.at>
PR preprocessor/35458
* mkdeps.c (munge): Quote '#' with a '\'.
gcc/testsuite
2008-03-06  Markus Milleder  <markus.milleder@generali.at>
PR preprocessor/35458
* gcc.dg/cpp/cmdlne-M-2.c: New file.
* gcc.dg/cpp/cmdlne-M-2#.h: New file.
* gcc.dg/cpp/#cmdlne-M-2.h: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132982 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/#cmdlne-M-2.h [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/cmdlne-M-2#.h [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/cmdlne-M-2.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/mkdeps.c

index 396fa3e..38bf08d 100644 (file)
@@ -1,3 +1,10 @@
+2008-03-06  Markus Milleder  <markus.milleder@generali.at>
+
+       PR preprocessor/35458
+       * gcc.dg/cpp/cmdlne-M-2.c: New file.
+       * gcc.dg/cpp/cmdlne-M-2#.h: New file.
+       * gcc.dg/cpp/#cmdlne-M-2.h: New file.
+
 2008-03-06  Tom Tromey  <tromey@redhat.com>
 
        * lib/treelang-dg.exp, lib/treelang.exp: Delete.
diff --git a/gcc/testsuite/gcc.dg/cpp/#cmdlne-M-2.h b/gcc/testsuite/gcc.dg/cpp/#cmdlne-M-2.h
new file mode 100644 (file)
index 0000000..40a8c17
--- /dev/null
@@ -0,0 +1 @@
+/* empty */
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2#.h b/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2#.h
new file mode 100644 (file)
index 0000000..40a8c17
--- /dev/null
@@ -0,0 +1 @@
+/* empty */
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2.c
new file mode 100644 (file)
index 0000000..6479822
--- /dev/null
@@ -0,0 +1,14 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.  */
+
+/* { dg-do preprocess } */
+/* { dg-options "-M" } */
+
+/* Test that dependency output suppresses warnings by implying -w.  */
+
+#include "#cmdlne-M-2.h"
+#include "cmdlne-M-2#.h"
+
+/* { dg-final { scan-file cmdlne-M-2.i "(^|\\n)cmdlne-M-2.o:" } }
+   { dg-final { scan-file cmdlne-M-2.i "cmdlne-M-2.c" } }
+   { dg-final { scan-file cmdlne-M-2.i "\\\\#cmdlne-M-2.h" } }
+   { dg-final { scan-file cmdlne-M-2.i "cmdlne-M-2\\\\#.h" } } */
index 5b2258e..a6be847 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-06  Markus Milleder  <markus.milleder@generali.at>
+
+       PR preprocessor/35458
+       * mkdeps.c (munge): Quote '#' with a '\'.
+
 2008-02-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        PR preprocessor/35379
index 11488ce..23d9dc1 100644 (file)
@@ -79,6 +79,11 @@ munge (const char *filename)
          /* '$' is quoted by doubling it.  */
          len++;
          break;
+
+       case '#':
+         /* '#' is quoted with a backslash.  */
+         len++;
+         break;
        }
     }
 
@@ -100,6 +105,10 @@ munge (const char *filename)
          *dst++ = '$';
          break;
 
+       case '#':
+         *dst++ = '\\';
+         break;
+
        default:
          /* nothing */;
        }