* gcc.dg/cpp/cmdlne-dM-M.c: New test.
* gcc.dg/cpp/cmdlne-dD-M.c: New test.
* gcc.dg/cpp/cmdlne-dN-M.c: New test.
* gcc.dg/cpp/cmdlne-dI-M.c: New test.
* gcc.dg/cpp/cmdlne-dI-M.h: New aux file.
* gcc.dg/cpp/cmdlne-dD-dM.c: New test.
* gcc.dg/cpp/cmdlne-dM-dD.c: New test.
From-SVN: r53121
+2002-05-03 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/cpp/cmdlne-dM-M.c: New test.
+ * gcc.dg/cpp/cmdlne-dD-M.c: New test.
+ * gcc.dg/cpp/cmdlne-dN-M.c: New test.
+ * gcc.dg/cpp/cmdlne-dI-M.c: New test.
+ * gcc.dg/cpp/cmdlne-dI-M.h: New aux file.
+ * gcc.dg/cpp/cmdlne-dD-dM.c: New test.
+ * gcc.dg/cpp/cmdlne-dM-dD.c: New test.
+
2002-05-03 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/format/xopen-2.c: New test.
--- /dev/null
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dD -M" } */
+
+/* Test -dD -M does not fail. It should print just
+ the Makefile rule with dependencies. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { if ![file exists cmdlne-dD-M.i] { return } } }
+ { dg-final { if { [grep cmdlne-dD-M.i "^#define foo bar$"] != "" } { fail "cmdlne-dD-M.c: #define line printed" } } }
+ { dg-final { if { [grep cmdlne-dD-M.i "variable"] != "" } { fail "cmdlne-dD-M.c: non-#define line printed" } } }
+ { dg-final { if { [grep cmdlne-dD-M.i "^cmdlne-dD-M.*:.*cmdlne-dD-M.c"] == "" } { xfail "cmdlne-dD-M.c: dependency rule not printed" } } }
+ { dg-final { return } } */
--- /dev/null
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dD -dM" } */
+
+/* Test -dD -dM does not fail. It should give the same output
+ as plain -dM. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { if ![file exists cmdlne-dD-dM.i] { return } } }
+ { dg-final { if { [grep cmdlne-dD-dM.i "^#define foo bar$"] == "" } { fail "cmdlne-dD-dM.c: #define line not printed" } } }
+ { dg-final { if { [grep cmdlne-dD-dM.i "variable"] != "" } { fail "cmdlne-dD-dM.c: non-#define line printed" } } }
+ { dg-final { return } } */
--- /dev/null
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dI -M" } */
+
+/* Test -dI -M does not fail. It should print just
+ the Makefile rule with dependencies. */
+
+#define foo bar
+#include "cmdlne-dI-M.h"
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { if ![file exists cmdlne-dI-M.i] { return } } }
+ { dg-final { if { [grep cmdlne-dI-M.i "^#define foo bar$"] != "" } { fail "cmdlne-dI-M.c: #define line printed" } } }
+ { dg-final { if { [grep cmdlne-dI-M.i "variable"] != "" } { fail "cmdlne-dI-M.c: non-#define line printed" } } }
+ { dg-final { if { [grep cmdlne-dI-M.i "^cmdlne-dI-M.*:.*cmdlne-dI-M.c"] == "" } { xfail "cmdlne-dI-M.c: dependency rule not printed" } } }
+ { dg-final { return } } */
--- /dev/null
+#define baz baz
+int othervar;
--- /dev/null
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dM -M" } */
+
+/* Test -dM -M does not fail. It should print both the
+ #define lines and a Makefile rule with dependencies. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { if ![file exists cmdlne-dM-M.i] { return } } }
+ { dg-final { if { [grep cmdlne-dM-M.i "^#define foo bar$"] == "" } { fail "cmdlne-dM-M.c: #define line not printed" } } }
+ { dg-final { if { [grep cmdlne-dM-M.i "variable"] != "" } { fail "cmdlne-dM-M.c: non-#define line printed" } } }
+ { dg-final { if { [grep cmdlne-dM-M.i "^cmdlne-dM-M.*:.*cmdlne-dM-M.c"] == "" } { xfail "cmdlne-dM-M.c: dependency rule not printed" } } }
+ { dg-final { return } } */
--- /dev/null
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dM -dD" } */
+
+/* Test -dM -dD does not fail. It should give the same output
+ as plain -dD. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { if ![file exists cmdlne-dM-dD.i] { return } } }
+ { dg-final { if { [grep cmdlne-dM-dD.i "^#define foo bar$"] == "" } { fail "cmdlne-dM-dD.c: #define line not printed" } } }
+ { dg-final { if { [grep cmdlne-dM-dD.i "variable"] == "" } { fail "cmdlne-dM-dD.c: non-#define line not printed" } } }
+ { dg-final { return } } */
--- /dev/null
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dN -M" } */
+
+/* Test -dN -M does not fail. It should print just
+ the Makefile rule with dependencies. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { if ![file exists cmdlne-dN-M.i] { return } } }
+ { dg-final { if { [grep cmdlne-dN-M.i "^#define foo"] != "" } { fail "cmdlne-dN-M.c: #define line printed" } } }
+ { dg-final { if { [grep cmdlne-dN-M.i "variable"] != "" } { fail "cmdlne-dN-M.c: non-#define line printed" } } }
+ { dg-final { if { [grep cmdlne-dN-M.i "^cmdlne-dN-M.*:.*cmdlne-dN-M.c"] == "" } { xfail "cmdlne-dN-M.c: dependency rule not printed" } } }
+ { dg-final { return } } */