annotate gcc/testsuite/gcc.dg/c90-hexfloat-2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test for hex floating point constants: in C99 only. Preprocessor test. */
kono
parents:
diff changeset
2 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
kono
parents:
diff changeset
3 /* { dg-do run } */
kono
parents:
diff changeset
4 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #define f (
kono
parents:
diff changeset
7 #define l )
kono
parents:
diff changeset
8 #define str(x) #x
kono
parents:
diff changeset
9 #define xstr(x) str(x)
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 /* C90: "0x1p+( 0x1p+)"; C99: "0x1p+f 0x1p+l" */
kono
parents:
diff changeset
12 const char *s = xstr(0x1p+f 0x1p+l);
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 extern void abort (void);
kono
parents:
diff changeset
15 extern int strcmp (const char *, const char *);
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 int
kono
parents:
diff changeset
18 main (void)
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 if (strcmp (s, "0x1p+( 0x1p+)"))
kono
parents:
diff changeset
21 abort ();
kono
parents:
diff changeset
22 else
kono
parents:
diff changeset
23 return 0; /* Correct C90 behavior. */
kono
parents:
diff changeset
24 }