comparison gcc/testsuite/gcc.dg/c99-hexfloat-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Test for hex floating point constants: in C99 only. Preprocessor test. */
2 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
3 /* { dg-do run } */
4 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
5
6 #define f (
7 #define l )
8 #define str(x) #x
9 #define xstr(x) str(x)
10
11 /* C90: "0x1p+( 0x1p+)"; C99: "0x1p+f 0x1p+l" */
12 const char *s = xstr(0x1p+f 0x1p+l);
13
14 extern void abort (void);
15 extern int strcmp (const char *, const char *);
16
17 int
18 main (void)
19 {
20 if (strcmp (s, "0x1p+f 0x1p+l"))
21 abort ();
22 else
23 return 0; /* Correct C99 behavior. */
24 }