2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp / pr23827_cxx98.C
blobcd4ee22e504297ca30d8db83afa51b94cf0b3612
1 // { dg-do run { target c++98_only } }
2 // { dg-options "-ansi -pedantic-errors" }
4 #define f (
5 #define l )
6 #define str(x) #x
7 #define xstr(x) str(x)
9 // C90 and C++98: "0x1p+( 0x1p+)"
10 // C99 and C++11: "0x1p+f 0x1p+l"
11 const char *s = xstr(0x1p+f 0x1p+l);
13 extern "C" void abort (void);
14 extern "C" int strcmp (const char *, const char *);
16 int
17 main()
19   if (strcmp (s, "0x1p+( 0x1p+)"))
20     abort (); // Correct C99 and C++11 behavior.
21   else
22     return 0; // Correct C90 and C++ behavior.