aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-12-01 22:03:57 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-12-01 22:03:57 +0000
commit92e092fe12129926b31d00afa6bb42cc5cb7100b (patch)
treea7a80266d5563ef09b817b50077173cf2de6cf9d /gcc
parent8d9e9a083d629324aec2cab9aacfd37b47fa9b48 (diff)
downloadgcc-92e092fe12129926b31d00afa6bb42cc5cb7100b.zip
gcc-92e092fe12129926b31d00afa6bb42cc5cb7100b.tar.gz
gcc-92e092fe12129926b31d00afa6bb42cc5cb7100b.tar.bz2
20000720-1.S: Remove duplicate testcase.
* gcc.dg/cpp/20000720-1.S: Remove duplicate testcase. * gcc.dg/cpp/poison.c: Update. * gcc.dg/cpp/spacing1.c: New testcase for all spacing issues. From-SVN: r37928
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/20000720-1.S14
-rw-r--r--gcc/testsuite/gcc.dg/cpp/poison.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/spacing1.c41
4 files changed, 49 insertions, 16 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 59f9fa18..53cbfc0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2000-12-01 Neil Booth <neilb@earthling.net>
+
+ * gcc.dg/cpp/20000720-1.S: Remove duplicate testcase.
+ * gcc.dg/cpp/poison.c: Update.
+ * gcc.dg/cpp/spacing1.c: New testcase for all spacing issues.
+
2000-12-01 Toon Moene <toon@moene.indiv.nluug.nl>
* g77.f-torture/execute/20001201.f: New test.
diff --git a/gcc/testsuite/gcc.dg/cpp/20000720-1.S b/gcc/testsuite/gcc.dg/cpp/20000720-1.S
deleted file mode 100644
index 82e9a84..0000000
--- a/gcc/testsuite/gcc.dg/cpp/20000720-1.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do preprocess } */
-
-#define nop() foobar
- nop
- call b
-
-/*
- { dg-final { if ![file exists 20000720-1.i] { return } } }
- { dg-final { if \{ [grep 20000720-1.i "nop.*call"] != "" \} \{ } }
- { dg-final { fail "20000720-1.S: new-line preservation" } }
- { dg-final { \} else \{ } }
- { dg-final { pass "20000720-1.S: new-line preservation" } }
- { dg-final { \} } }
-*/
diff --git a/gcc/testsuite/gcc.dg/cpp/poison.c b/gcc/testsuite/gcc.dg/cpp/poison.c
index 79a910f..3670a76 100644
--- a/gcc/testsuite/gcc.dg/cpp/poison.c
+++ b/gcc/testsuite/gcc.dg/cpp/poison.c
@@ -15,10 +15,10 @@ foo5 /* { dg-error "foo5" "use of foo5" } */
#define foo6 345 /* { dg-error "foo6" "def of foo6" } */
#define foo6 456 /* { dg-error "foo6" "redef of foo6" } */
#ifdef foo6 /* { dg-error "foo6" "#ifdef foo6" } */
-#error hey! foo6 poisoned!
+#error hey! foo6 poisoned! /* { dg-error "foo6" "poisoned identifiers" } */
#endif
#if defined(foo6) /* { dg-error "foo6" "#if defined foo6" } */
-#error no, foo6 still poisoned!
+#error foo6 still poisoned! /* { dg-error "foo6" "poisoned identifiers" } */
#else
foo6 /* { dg-error "foo6" "use of foo6" } */
#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/spacing1.c b/gcc/testsuite/gcc.dg/cpp/spacing1.c
new file mode 100644
index 0000000..55a8f96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/spacing1.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* This tests correct spacing of macro expansion output, as well as
+ the line it falls on. This is quite subtle; it involves newlines
+ within macro arguments becoming spaces, but not if it turns out to
+ not be a macro invocation. Also, multiple macro invocations spread
+ across many lines.
+
+ Neil Booth, 1 Dec 2000. */
+
+#define str(x) #x
+#define f(x) x
+
+/* The correct output is shown here. Note the spaces, and the way
+ everything after the invocation of f appears on the same line.
+
+f
+bar
+g "1 2" bam baz
+
+*/
+
+f
+bar
+f (g) str
+(
+1
+2
+) f
+(bam) baz
+
+/*
+ { dg-final { if ![file exists spacing1.i] { return } } }
+ { dg-final { if \{ [grep spacing1.i "f.*bar"] == "" \} \{ } }
+ { dg-final { if \{ [grep spacing1.i "^bar"] != "" \} \{ } }
+ { dg-final { if \{ [grep spacing1.i "g \"1 2\" bam baz"] != "" \} \{ } }
+ { dg-final { return \} \} \} } }
+ { dg-final { fail "spacing1.c: spacing and new-line preservation" } }
+*/