aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c
new file mode 100644
index 0000000..9d5a7df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c
@@ -0,0 +1,17 @@
+/* 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 } } */