URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Test that (what looks like) comments are not recognized in literals
|
/* Test that (what looks like) comments are not recognized in literals
|
and that quotes within quotes do not confused the preprocessor. */
|
and that quotes within quotes do not confused the preprocessor. */
|
|
|
/* { dg-do run } */
|
/* { dg-do run } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
int main ()
|
int main ()
|
{
|
{
|
const char *str1 = "/*";
|
const char *str1 = "/*";
|
const char *str2 = "'";
|
const char *str2 = "'";
|
|
|
if (str1[0] != '/' || str1[1] != '*' || str1[2] != '\0')
|
if (str1[0] != '/' || str1[1] != '*' || str1[2] != '\0')
|
abort ();
|
abort ();
|
|
|
if (str2[0] != '\'' || str2[1] != '\0')
|
if (str2[0] != '\'' || str2[1] != '\0')
|
abort ();
|
abort ();
|
|
|
#if '"' != '\"'
|
#if '"' != '\"'
|
# error /* { dg-bogus "error" "double quote in charconst" } */
|
# error /* { dg-bogus "error" "double quote in charconst" } */
|
#endif
|
#endif
|
|
|
#if !'\''
|
#if !'\''
|
# error quote /* { dg-bogus "quote" "quote in charconst" } */
|
# error quote /* { dg-bogus "quote" "quote in charconst" } */
|
#endif
|
#endif
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.