lex.c (ffelex_hash_): Avoid eating one whole line after #line.
authorJakub Jelinek <jakub@redhat.com>
Mon, 2 Apr 2001 21:23:28 +0000 (23:23 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 2 Apr 2001 21:23:28 +0000 (23:23 +0200)
* lex.c (ffelex_hash_): Avoid eating one whole line after
#line.

* g77.f-torture/compile/20010321-1.f: New test.

From-SVN: r41015

gcc/ChangeLog
gcc/f/lex.c
gcc/testsuite/ChangeLog
gcc/testsuite/g77.f-torture/compile/20010321-1.f [new file with mode: 0644]

index 5453873b1da82d3a25ec97e4aa3609574b64ae31..ac5b432fbe4e3a48d01c6c1e4b21d3f59dd27743 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * lex.c (ffelex_hash_): Avoid eating one whole line after
+       #line.
+
 2001-04-02  Zack Weinberg  <zackw@stanford.edu>
 
        * genattr.c, gencheck.c, gencodes.c, genconfig.c, genflags.c,
index ea0ef059b76197593fa6b8d6ff135dc4d5ee3991..d5aaa1589ed62ebf77537bfa2de80665081c1c09 100644 (file)
@@ -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");
index 8a7dcb60bbfd17beb091ac1811d8078139819441..febf3273021bd83132d1f64fb9f1f4e6de2992e3 100644 (file)
@@ -1,3 +1,7 @@
+2001-04-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * g77.f-torture/compile/20010321-1.f: New test.
+
 2001-04-02  Jakub Jelinek  <jakub@redhat.com>
 
        * 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 (file)
index 0000000..3f3b560
--- /dev/null
@@ -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