new file mode 100644
@@ -0,0 +1,5 @@
+/* Test trigraphs supported in C11. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include "trigraphs.c"
new file mode 100644
@@ -0,0 +1,10 @@
+/* Test trigraphs not supported in C2x. */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -pedantic-errors" } */
+
+const char a[] = "??=??(??/??/??)??'??<??!??>??-";
+const char b[] = "?""?=?""?(?""?/?""?/?""?)?""?'?""?<?""?!?""?>?""?-";
+
+_Static_assert (sizeof a == sizeof b, "checking trigraph conversions");
+
+/* { dg-prune-output "\\\[-Wtrigraphs" } */
new file mode 100644
@@ -0,0 +1,5 @@
+/* Test trigraphs supported in C2x with -trigraphs used. */
+/* { dg-do run } */
+/* { dg-options "-std=c2x -pedantic-errors -trigraphs" } */
+
+#include "trigraphs.c"
@@ -112,7 +112,7 @@ static const struct lang_flags lang_defaults[] =
/* STDC99 */ { 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
/* STDC11 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
/* STDC17 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
- /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0 },
+ /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0 },
/* GNUCXX */ { 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
/* CXX98 */ { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 },
/* GNUCXX11 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },