annotate gcc/testsuite/gcc.dg/c90-digraph-1.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test for recognition of digraphs: should be recognized in C94 and C99
kono
parents:
diff changeset
2 mode, but not in C90 mode. Also check correct stringizing.
kono
parents:
diff changeset
3 */
kono
parents:
diff changeset
4 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
kono
parents:
diff changeset
5 /* { dg-do run } */
kono
parents:
diff changeset
6 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 #define str(x) xstr(x)
kono
parents:
diff changeset
9 #define xstr(x) #x
kono
parents:
diff changeset
10 #define foo(p, q) str(p %:%: q)
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 extern void abort (void);
kono
parents:
diff changeset
13 extern int strcmp (const char *, const char *);
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 int
kono
parents:
diff changeset
16 main (void)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 const char *t = foo (1, 2);
kono
parents:
diff changeset
19 const char *u = str (<:);
kono
parents:
diff changeset
20 if (strcmp (t, "1 %:%: 2") || strcmp (u, "<:"))
kono
parents:
diff changeset
21 abort ();
kono
parents:
diff changeset
22 else
kono
parents:
diff changeset
23 return 0;
kono
parents:
diff changeset
24 }