summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/cpp/19990703-1.c
blob: c3ac2330055bc736e5f3b502a2e07b177fb58190 (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
/* { dg-do run } */

/* Test of obscure case in token pasting in the preprocessor.
   I can't think of any way to make this problem provoke a syntax error.
   Based on a bug report by Manfred Hollstein.  */

#include <string.h>

#define SP1(x, y) SP2(x, y)
#define SP2(x, y) SP3(x##y)
#define SP3(x) #x
#define MZ -0

int
main(void)
{
    char *x = SP1(0,MZ);  /* { dg-warning "valid preprocessing token" "" } */
    char *y = "0-0";  /* should be the expansion of SP1(0,MZ) */

    if(strcmp(x, y))
	return 1;
    else
	return 0;
}
OpenPOWER on IntegriCloud