summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c20
-rw-r--r--gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c20
2 files changed, 39 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c b/gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c
new file mode 100644
index 00000000000..d1e822660bc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c
@@ -0,0 +1,20 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -Wtrigraphs -fno-show-column" } */
+
+/* Test we don't double warn for trigraphs immediately after preceding
+ text. Source Neil Booth. 4 May 2003. */
+
+/* { dg-bogus "ignored" } Test ??< ??= a few ??/ random things in
+ { dg-warning "converted" } some ??/
+ { dg-bogus "ignored" } ??< comments. */
+
+// { dg-bogus "ignored" } More ??/ comment ??> tests.
+
+// { dg-warning "converted" } Another ??/
+ Test
+
+// { dg-warning "converted" } And another with space after ??/
+ the escape
+
+// { dg-bogus "ignored" } A tricky one ??/\
+
diff --git a/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c b/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c
index 2dee1e53792..5ed6c98ad49 100644
--- a/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c
+++ b/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c
@@ -1,5 +1,5 @@
/* { dg-do preprocess } */
-/* { dg-options "-Wtrigraphs -fno-show-column" } */
+/* { dg-options "-std=gnu99 -Wtrigraphs -fno-show-column" } */
/* Test we don't double warn for trigraphs immediately after preceding
text. Source Neil Booth. 22 Nov 2000. */
@@ -7,3 +7,21 @@
abcdef??< /* { dg-warning "ignored" } */
123456??> /* { dg-warning "ignored" } */
+??= /* { dg-warning "ignored" } */
+
+/* Test we warn of escaped newlines only in comments. Source Neil
+ Booth. 4 May 2003. */
+
+/* { dg-bogus "ignored" } Test ??< ??= a few ??/ random things in
+ { dg-warning "ignored" } some ??/
+ { dg-bogus "ignored" } ??< comments. */
+
+// { dg-bogus "ignored" } More ??/ comment ??> tests.
+
+// { dg-warning "ignored" } Another ??/
+ Test
+
+// { dg-warning "ignored" } And another with space after ??/
+ the escape
+
+// { dg-bogus "ignored" } A tricky one ??/\
+