Multi-line token test
Neil Booth
neil@daikokuya.demon.co.uk
Sun Dec 17 06:32:00 GMT 2000
I realised it's not too hard to devise a test for this.
Neil.
* gcc.dg/cpp/multiline.c: New test.
Index: gcc.dg/cpp/multiline.c
===================================================================
RCS file: multiline.c
diff -N multiline.c
--- /dev/null Tue May 5 13:32:27 1998
+++ multiline.c Sun Dec 17 06:31:28 2000
@@ -0,0 +1,24 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+/* { dg-do preprocess } */
+/* { dg-options "-C" } */
+/* Test that multi-line tokens are recognised by cpp0 as being
+ multiline . Source: Neil Booth, 17 Dec 2000. */
+/* Line 1
+ Line 2
+ Line 3
+ Line 4
+*/
+"line 1
+ line 2
+ line 3
+ line 4"
+L"line 1
+ line 2
+ line 3
+ line 4"
+/* Nowhere in the output of this file should there be a blank line.
+ We check for that in the .i file.
+ { dg-final { if ![file exists multiline.i] { return } } }
+ { dg-final { if \{ [grep multiline.i "^$"] == "" \} \{ } }
+ { dg-final { return \} } }
+ { dg-final { fail "multiline.c: multi-line tokens" } } */
More information about the Gcc-patches
mailing list