URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 338 |
/* Test for hex floating point constants: in C99 only. Preprocessor test. */
|
/* Test for hex floating point constants: in C99 only. Preprocessor test. */
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
|
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
|
|
|
#define f (
|
#define f (
|
#define l )
|
#define l )
|
#define str(x) #x
|
#define str(x) #x
|
#define xstr(x) str(x)
|
#define xstr(x) str(x)
|
|
|
/* C90: "0x1p+( 0x1p+)"; C99: "0x1p+f 0x1p+l" */
|
/* C90: "0x1p+( 0x1p+)"; C99: "0x1p+f 0x1p+l" */
|
const char *s = xstr(0x1p+f 0x1p+l);
|
const char *s = xstr(0x1p+f 0x1p+l);
|
|
|
extern void abort (void);
|
extern void abort (void);
|
extern int strcmp (const char *, const char *);
|
extern int strcmp (const char *, const char *);
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
if (strcmp (s, "0x1p+f 0x1p+l"))
|
if (strcmp (s, "0x1p+f 0x1p+l"))
|
abort ();
|
abort ();
|
else
|
else
|
return 0; /* Correct C99 behavior. */
|
return 0; /* Correct C99 behavior. */
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.