From: Jakub Jelinek Date: Mon, 2 Apr 2001 21:23:28 +0000 (+0200) Subject: lex.c (ffelex_hash_): Avoid eating one whole line after #line. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=caf4d6e06910095bd455d53f72a6094fff41c66c;p=gcc.git lex.c (ffelex_hash_): Avoid eating one whole line after #line. * lex.c (ffelex_hash_): Avoid eating one whole line after #line. * g77.f-torture/compile/20010321-1.f: New test. From-SVN: r41015 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5453873b1da..ac5b432fbe4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-04-02 Jakub Jelinek + + * lex.c (ffelex_hash_): Avoid eating one whole line after + #line. + 2001-04-02 Zack Weinberg * genattr.c, gencheck.c, gencodes.c, genconfig.c, genflags.c, diff --git a/gcc/f/lex.c b/gcc/f/lex.c index ea0ef059b76..d5aaa1589ed 100644 --- a/gcc/f/lex.c +++ b/gcc/f/lex.c @@ -1412,6 +1412,12 @@ ffelex_hash_ (FILE *finput) input_filename = old_input_filename; error ("Use `#line ...' instead of `# ...' in first line"); } + if (c == '\n' || c == EOF) + { + if (token != NULL && !ffelex_kludge_flag_) + ffelex_token_kill (token); + return c; + } } else error ("invalid #-line"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8a7dcb60bbf..febf3273021 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-04-02 Jakub Jelinek + + * g77.f-torture/compile/20010321-1.f: New test. + 2001-04-02 Jakub Jelinek * gcc.c-torture/compile/20010329-1.c: New test. diff --git a/gcc/testsuite/g77.f-torture/compile/20010321-1.f b/gcc/testsuite/g77.f-torture/compile/20010321-1.f new file mode 100644 index 00000000000..3f3b5602737 --- /dev/null +++ b/gcc/testsuite/g77.f-torture/compile/20010321-1.f @@ -0,0 +1,8 @@ +# 1 "20010321-1.f" + SUBROUTINE TWOEXP +# 1 "include/implicit.h" 1 3 + IMPLICIT DOUBLE PRECISION (A-H) +# 3 "20010321-1.f" 2 3 + LOGICAL ANTI + ANTI = .FALSE. + END