Blame cpp-test/test-t/n_3.c

Packit Service 8bf002
/* n_3.c:   Handling of comment.    */
Packit Service 8bf002
Packit Service 8bf002
/* 3.1: A comment is converted to one space.    */
Packit Service 8bf002
/*  abc de  */
Packit Service 8bf002
    abc/* comment */de
Packit Service 8bf002
Packit Service 8bf002
/* 3.2: // is not a comment of C.   */
Packit Service 8bf002
#if 0   /* This feature is obsolete now.  */
Packit Service 8bf002
/*  // is not a comment of C    */
Packit Service 8bf002
    // is not a comment of C
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/* 3.3: Comment is parsed prior to the parsing of preprocessing directive.  */
Packit Service 8bf002
/*  abcd    */
Packit Service 8bf002
#if     0
Packit Service 8bf002
    "nonsence"; /*
Packit Service 8bf002
#else
Packit Service 8bf002
    still in
Packit Service 8bf002
    comment     */
Packit Service 8bf002
#else
Packit Service 8bf002
#define MACRO_abcd  /*
Packit Service 8bf002
    in comment
Packit Service 8bf002
    */  abcd
Packit Service 8bf002
#endif
Packit Service 8bf002
    MACRO_abcd
Packit Service 8bf002
Packit Service 8bf002
/* { dg-do preprocess }
Packit Service 8bf002
   { dg-options "-ansi -w" }
Packit Service 8bf002
   { dg-final { if ![file exist n_3.i] { return }                       } }
Packit Service 8bf002
   { dg-final { if \{ [grep n_3.i "abc de"] != ""               \} \{   } }
Packit Service 8bf002
   { dg-final { if \{ [grep n_3.i "abcd"] != ""                 \} \{   } }
Packit Service 8bf002
   { dg-final { return \} \}                                            } }
Packit Service 8bf002
   { dg-final { fail "n_3.c: handling of comments"                      } }
Packit Service 8bf002
 */