OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [trad/] [literals-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Test that (what looks like) comments are not recognized in literals
2
   and that quotes within quotes do not confused the preprocessor.  */
3
 
4
/* { dg-do run } */
5
 
6
extern void abort (void);
7
 
8
int main ()
9
{
10
  const char *str1 = "/*";
11
  const char *str2 = "'";
12
 
13
  if (str1[0] != '/' || str1[1] != '*' || str1[2] != '\0')
14
    abort ();
15
 
16
  if (str2[0] != '\'' || str2[1] != '\0')
17
    abort ();
18
 
19
#if '"' != '\"'
20
#  error /* { dg-bogus "error" "double quote in charconst" } */
21
#endif
22
 
23
#if !'\''
24
#  error quote /* { dg-bogus "quote" "quote in charconst" } */
25
#endif
26
 
27
  return 0;
28
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.