diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-14 07:15:00 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-14 07:15:00 +0000 |
commit | f9eef6699aae8596611d814f6d8695432137b68c (patch) | |
tree | 13c40bee0e01dc6be30a1e076b1de7319d0344fd | |
parent | c838d5ba14010cd1cd10bf5be6dce94618c8d455 (diff) | |
download | ppe42-gcc-f9eef6699aae8596611d814f6d8695432137b68c.tar.gz ppe42-gcc-f9eef6699aae8596611d814f6d8695432137b68c.zip |
PR fortran/22417
* scanner.c (preprocessor_line): Don't treat flag 3 as the start of a new
file. Fix file left but not entered warning.
* gfortran.dg/g77/cpp5.F: New test.
* gfortran.dg/g77/cpp5.h: New file.
* gfortran.dg/g77/cpp5inc.h: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102010 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/scanner.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/cpp5.F | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/cpp5.h | 3 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/cpp5inc.h | 1 |
6 files changed, 25 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a4897da6434..5f17e5edc6b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2005-07-14 Jakub Jelinek <jakub@redhat.com> + + PR fortran/22417 + * scanner.c (preprocessor_line): Don't treat flag 3 as the start of a new + file. Fix file left but not entered warning. + 2005-07-14 Feng Wang <fengwang@nudt.edu.cn> Steven G. Kargl <kargls@comcast.net> diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index fe28820a62a..eee3a684fc3 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -899,7 +899,7 @@ preprocessor_line (char *c) /* Interpret flags. */ - if (flag[1] || flag[3]) /* Starting new file. */ + if (flag[1]) /* Starting new file. */ { f = get_file (filename, LC_RENAME); f->up = current_file; @@ -908,15 +908,15 @@ preprocessor_line (char *c) if (flag[2]) /* Ending current file. */ { - if (strcmp (current_file->filename, filename) != 0) + if (!current_file->up + || strcmp (current_file->up->filename, filename) != 0) { gfc_warning_now ("%s:%d: file %s left but not entered", current_file->filename, current_file->line, filename); return; } - if (current_file->up) - current_file = current_file->up; + current_file = current_file->up; } /* The name of the file can be a temporary file produced by diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b3585c7d75b..d0c2c653efa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2005-07-14 Jakub Jelinek <jakub@redhat.com> + + PR fortran/22417 + * gfortran.dg/g77/cpp5.F: New test. + * gfortran.dg/g77/cpp5.h: New file. + * gfortran.dg/g77/cpp5inc.h: New file. + 2005-07-12 Paul Thomas <pault@gcc.gnu.org> PR libfortran/16435 diff --git a/gcc/testsuite/gfortran.dg/g77/cpp5.F b/gcc/testsuite/gfortran.dg/g77/cpp5.F new file mode 100644 index 00000000000..8e35d78ea38 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/g77/cpp5.F @@ -0,0 +1,4 @@ + ! { dg-do run } +#include "cpp5.h" + IF (FOO().NE.1) CALL ABORT () + END diff --git a/gcc/testsuite/gfortran.dg/g77/cpp5.h b/gcc/testsuite/gfortran.dg/g77/cpp5.h new file mode 100644 index 00000000000..2e77f6a692f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/g77/cpp5.h @@ -0,0 +1,3 @@ + FUNCTION FOO() +#include "cpp5inc.h" + END FUNCTION diff --git a/gcc/testsuite/gfortran.dg/g77/cpp5inc.h b/gcc/testsuite/gfortran.dg/g77/cpp5inc.h new file mode 100644 index 00000000000..3cc86cd0d18 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/g77/cpp5inc.h @@ -0,0 +1 @@ + FOO = 1 |