1 /* Copyright (C) 2000 Free Software Foundation, Inc. */
4 /* { dg-options "-std=c99" } */
6 /* Fully test the 6 digraphs under c99 assumptions. Four are pasted,
7 to check that digraph pasting works. */
9 extern int strcmp (const char *, const char *);
10 extern void abort (void);
11 extern int puts (const char *);
12 #define err(str) do { puts(str); abort(); } while (0)
14 %:define
glue(x
, y
) x
%:%: y
/* #define glue(x, y) x ## y. */
16 #error glue not defined!
18 %:define
str(x
) %:x
/* #define str(x) #x */
20 int main (int argc
, char *argv
<::>) /* argv[] */
23 const char di_str
glue(<, :)glue(:, >) = str(%:%:<::><%%>%:);
25 /* Check the glue macro actually pastes, and that the spelling of
26 all digraphs is preserved. */
27 if (glue(str
, cmp
) (di_str
, "%:%:<::><%%>%:"))
28 err ("Digraph spelling not preserved!");