* gcc.dg/c90-digraph-1.c, gcc.dg/c94-digraph.c,
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jul 2000 08:34:27 +0000 (08:34 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jul 2000 08:34:27 +0000 (08:34 +0000)
gcc.dg/c99-digraph.c: New tests.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35078 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/c90-digraph-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c94-digraph-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c99-digraph-1.c [new file with mode: 0644]

index 4ca32ad..5fd67e3 100644 (file)
@@ -1,15 +1,18 @@
 2000-07-17  Joseph S. Myers  <jsm28@cam.ac.uk>
 
+       * gcc.dg/c90-digraph-1.c, gcc.dg/c94-digraph.c,
+       * gcc.dg/c99-digraph.c: New tests.
+
        * gcc.dg/c90-hexfloat-1.c, gcc.dg/c90-hexfloat-2.c,
-       gcc.dg/c99-hexfloat-1.c, gcc.dg/c99-hexfloat-2.c: New tests.
+       gcc.dg/c99-hexfloat-1.c, gcc.dg/c99-hexfloat-2.c: New tests.
 
        * gcc.dg/c90-enum-comma-1.c, gcc.dg/c90-idem-qual-1.c,
-       gcc.dg/c90-impl-decl-1.c, gcc.dg/c90-impl-int-1.c,
-       gcc.dg/c90-longlong.c, gcc.dg/c90-restrict-1.c,
-       gcc.dg/c90-return-1.c, gcc.dg/c99-enum-comma-1.c,
-       gcc.dg/c99-idem-qual-1.c, gcc.dg/c99-impl-decl-1.c,
-       gcc.dg/c99-impl-int-1.c, gcc.dg/c99-longlong-1.c,
-       gcc.dg/c99-restrict-1.c, gcc.dg/c99-return-1.c: New tests.
+       gcc.dg/c90-impl-decl-1.c, gcc.dg/c90-impl-int-1.c,
+       gcc.dg/c90-longlong.c, gcc.dg/c90-restrict-1.c,
+       gcc.dg/c90-return-1.c, gcc.dg/c99-enum-comma-1.c,
+       gcc.dg/c99-idem-qual-1.c, gcc.dg/c99-impl-decl-1.c,
+       gcc.dg/c99-impl-int-1.c, gcc.dg/c99-longlong-1.c,
+       gcc.dg/c99-restrict-1.c, gcc.dg/c99-return-1.c: New tests.
 
 Mon Jul 17 00:41:57 2000   Greg McGary <greg@mcgary.org>
 
diff --git a/gcc/testsuite/gcc.dg/c90-digraph-1.c b/gcc/testsuite/gcc.dg/c90-digraph-1.c
new file mode 100644 (file)
index 0000000..463ebc2
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test for recognition of digraphs: should be recognised in C94 and C99
+   mode, but not in C90 mode.  Also check correct stringizing.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+#define foo(p, q) str(p %:%: q)
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+  const char *t = foo (1, 2);
+  const char *u = str (<:);
+  if (strcmp (t, "1 %:%: 2") || strcmp (u, "<:"))
+    abort ();
+  else
+    return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/c94-digraph-1.c b/gcc/testsuite/gcc.dg/c94-digraph-1.c
new file mode 100644 (file)
index 0000000..26cc1be
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test for recognition of digraphs: should be recognised in C94 and C99
+   mode, but not in C90 mode.  Also check correct stringizing.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:199409 -pedantic-errors" } */
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+#define foo(p, q) str(p %:%: q)
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+  const char *t = foo (1, 2);
+  const char *u = str (<:);
+  if (strcmp (t, "12") || strcmp (u, "<:"))
+    abort ();
+  else
+    return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/c99-digraph-1.c b/gcc/testsuite/gcc.dg/c99-digraph-1.c
new file mode 100644 (file)
index 0000000..08f0af9
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test for recognition of digraphs: should be recognised in C94 and C99
+   mode, but not in C90 mode.  Also check correct stringizing.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+#define foo(p, q) str(p %:%: q)
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+  const char *t = foo (1, 2);
+  const char *u = str (<:);
+  if (strcmp (t, "12") || strcmp (u, "<:"))
+    abort ();
+  else
+    return 0;
+}