Home | History | Annotate | Line # | Download | only in lint1
lex_string.c revision 1.2
      1 /*	$NetBSD: lex_string.c,v 1.2 2021/06/19 08:37:18 rillig Exp $	*/
      2 # 3 "lex_string.c"
      3 
      4 /*
      5  * Test lexical analysis of string constants.
      6  *
      7  * C99 6.4.5 "String literals"
      8  */
      9 
     10 void sink(const char *);
     11 
     12 void
     13 test(void)
     14 {
     15 	sink("");
     16 
     17 	sink("hello, world\n");
     18 
     19 	sink("\0");
     20 
     21 	sink("\0\0\0\0");
     22 
     23 	/* expect+1: no hex digits follow \x [74] */
     24 	sink("\x");		/* unfinished */
     25 
     26 	/* expect+1: dubious escape \y [79] */
     27 	sink("\y");		/* unknown escape sequence */
     28 }
     29