Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/cpp/trad/literals-1.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* Test that (what looks like) comments are not recognized in literals and that quotes within quotes do not confused the preprocessor. */ /* { dg-do run } */ extern void abort (void); int main () { const char *str1 = "/*"; const char *str2 = "'"; if (str1[0] != '/' || str1[1] != '*' || str1[2] != '\0') abort (); if (str2[0] != '\'' || str2[1] != '\0') abort (); #if '"' != '\"' # error /* { dg-bogus "error" "double quote in charconst" } */ #endif #if !'\'' # error quote /* { dg-bogus "quote" "quote in charconst" } */ #endif return 0; }