summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/strify4.c
blob: b8b2f11e9d112546225c4d055ea45f0785356b59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do run } */
/* Tests we stringify without changing unprintable characts.  

   Andrew Pinski */

extern int strcmp (const char *, const char *);
extern int puts (const char *);
extern void abort (void);
#define err(str) do { puts(str); abort(); } while (0)


#define S(X) S2(X)
#define S2(X) #X
#define TAB "	" /* Note there is a tab character here. */

int main (int argc, char *argv[])
{
  /* The space before "bar" here is vital.  */
  char a[] = S(S(TAB));

  if (strcmp (a, "\"\\\"	\\\"\""))
    err ("stringification caused octal");

  return 0;
}