summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-03 20:28:09 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-03 20:28:09 +0000
commit4f1591c2055c1acbec3e5e75f8927838fde8c382 (patch)
tree37d40b5dd4cc3d6e3e402bbce4d66927e61da068 /gcc/testsuite/gcc.dg/cpp
parent136d950fac4f99b4756e567b2369e593923ba010 (diff)
downloadgcc-4f1591c2055c1acbec3e5e75f8927838fde8c382.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53121 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c17
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c16
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c18
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c17
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c16
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c17
7 files changed, 103 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c
new file mode 100644
index 00000000000..1a0adc025c2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c
@@ -0,0 +1,17 @@
+/* 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 } } */
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c
new file mode 100644
index 00000000000..8a3fb346588
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c
@@ -0,0 +1,16 @@
+/* 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 } } */
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c
new file mode 100644
index 00000000000..afa54f7bf77
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c
@@ -0,0 +1,18 @@
+/* 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 } } */
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h b/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h
new file mode 100644
index 00000000000..cbaf810a5b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h
@@ -0,0 +1,2 @@
+#define baz baz
+int othervar;
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 00000000000..9d5a7df3710
--- /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 } } */
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c
new file mode 100644
index 00000000000..0d3bb9ca059
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c
@@ -0,0 +1,16 @@
+/* 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 } } */
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c
new file mode 100644
index 00000000000..c4549fc8495
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c
@@ -0,0 +1,17 @@
+/* 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 } } */