* cppexp.c: Update all code for new lexer interface. (op_t, operator codes, struct token, tokentab2, op_to_str): Remove. (struct suffix, vsuf_1, vsuf_2, vsuf_3, op_to_prio): New. * cpplex.c (token_names): Trim leading CPP_ from names; make the strings unsigned. (_cpp_spell_operator): New. (is_macro_disabled): Disable all macros if rescanning preprocessed text. (_cpp_get_directive_token): Remove. * cppinit.c: Don't set no_macro_expand. * cpplib.c (read_line_number, do_line): Check only for EOF, not VSPACE. * cpphash.h: Update prototypes. * cpplib.h (CPP_VSPACE): Remove. (struct cpp_reader): Remove no_macro_expand. testsuite: * gcc.dg/cpp/19951227-1.c, gcc.dg/cpp/assert2.c, gcc.dg/cpp/if-1.c, gcc.dg/cpp/if-4.c: Tweak error regexps. From-SVN: r34920
25 lines
728 B
C
25 lines
728 B
C
/* Malformed assertion tests. */
|
|
/* { dg-do preprocess } */
|
|
/* { dg-options "-fno-show-column" } */
|
|
|
|
#assert /* { dg-error "without predicate" "assert w/o predicate" } */
|
|
#assert % /* { dg-error "an identifier" "assert punctuation" } */
|
|
#assert 12 /* { dg-error "an identifier" "assert number" } */
|
|
#assert abc /* { dg-error "missing" "assert w/o answer" } */
|
|
|
|
#if # /* { dg-error "without predicate" "test w/o predicate" } */
|
|
#endif
|
|
|
|
#if #% /* { dg-error "an identifier" "test punctuation" } */
|
|
#endif
|
|
|
|
#if #12 /* { dg-error "an identifier" "test number" } */
|
|
#endif
|
|
|
|
#if #abc
|
|
#error /* { dg-bogus "error" "test w/o answer" } */
|
|
#endif
|
|
|
|
#if #abc[def] /* { dg-error "is not valid" "test with malformed answer" } */
|
|
#endif
|