view gcc/testsuite/gcc.dg/cpp/pr23827_c90.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
line wrap: on
line source

/* { dg-do run }  */
/* { dg-options "-std=c90 -pedantic-errors" }  */

#define f (
#define l )
#define str(x) #x
#define xstr(x) str(x)

/* C90 and C++98: "0x1p+( 0x1p+)"  */
/* C99 and C++11: "0x1p+f 0x1p+l"  */
const char *s = xstr(0x1p+f 0x1p+l);

void abort (void);
int strcmp (const char *, const char *);

int
main()
{
  if (strcmp (s, "0x1p+( 0x1p+)"))
    abort (); /* Correct C99 and C++11 behavior.  */
  else
    return 0; /* Correct C90 and C++ behavior.  */
}