diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-02-10 00:26:47 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-02-10 00:26:47 +0000 |
commit | 564ad5f49e3f4d9d55e972d8ed66ac12bd2c83dc (patch) | |
tree | b97b41fd2091f08d292e94d18de3493399ff1087 /gcc/testsuite | |
parent | 3a75e42e813997b8144619d6031b729690639922 (diff) | |
download | gcc-564ad5f49e3f4d9d55e972d8ed66ac12bd2c83dc.zip gcc-564ad5f49e3f4d9d55e972d8ed66ac12bd2c83dc.tar.gz gcc-564ad5f49e3f4d9d55e972d8ed66ac12bd2c83dc.tar.bz2 |
cpphash.c (macarg): Hoist all the flag diddling out of the function...
* cpphash.c (macarg): Hoist all the flag diddling out of the
function...
(macroexpand): ... and out of the loop that calls macarg.
Skip over the initial paren before macro arguments with
cpp_get_non_space_token; point may be some distance before
that paren. Abort if it's not there.
* cpplib.c (parse_clear_mark): Delete function.
(parse_set_mark, parse_goto_mark): Make static.
(ACTIVE_MARK_P): New macro.
(skip_block_comment, skip_line_comment): Do not bump the line
if ACTIVE_MARK_P is true.
(cpp_pop_buffer): The buffer to be popped may not have an
active mark.
(cpp_get_token): When looking for the initial paren before
macro arguments, only set a mark in a file buffer, Always
return to that mark before proceeding to call macroexpand or
return a NAME token.
* cpplib.h: Remove prototypes of parse_set_mark,
parse_clear_mark, parse_goto_mark.
(struct cpp_options): Rename 'put_out_comments' to
'discard_comments' and invert its sense.
* cppinit.c, cpphash.c, cpplib.c: All users of
put_out_comments changed to use discard_comments, with
opposite sense.
From-SVN: r31879
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gcc.dg/20000209-1.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/20000209-2.c | 17 |
2 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20000209-1.c b/gcc/testsuite/gcc.dg/20000209-1.c new file mode 100644 index 0000000..fe71058 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20000209-1.c @@ -0,0 +1,34 @@ +/* { dg-do preprocess } */ + +/* Tests for line numbering around function-like macro calls. + Bug found by Mark Mitchell. */ + +#define f(x) x +#define g f + +f (3); +#error here /* { dg-error "here" "case 0" } */ + +f + (3); +#error here /* { dg-error "here" "case 1" } */ + +(f + )(3); +#error here /* { dg-error "here" "case 2" } */ + +g + (3); +#error here /* { dg-error "here" "case 3" } */ + +(g + )(3); +#error here /* { dg-error "here" "case 4" } */ + +f /* some + text */ (3); +#error here /* { dg-error "here" "case 5" } */ + +(g /* some + text */ )(3); +#error here /* { dg-error "here" "case 6" } */ diff --git a/gcc/testsuite/gcc.dg/20000209-2.c b/gcc/testsuite/gcc.dg/20000209-2.c new file mode 100644 index 0000000..621a00b --- /dev/null +++ b/gcc/testsuite/gcc.dg/20000209-2.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* Distilled from glibc sources. Tests preprocessor corner cases. */ + +#define NO_PAREN(rest...) rest +#define DEFINE_CATEGORY(category, items) \ +const int _nl_value_type_##category[] = { NO_PAREN items } + +DEFINE_CATEGORY +( + LC_COLLATE, + ( + 1, + 2, + 3, + )); + +DEFINE_CATEGORY(LC_CTYPE, (1, 2, 3)); |