This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch,fortran] Allow namelist with internal file (PR 28224)


Hi François-Xavier,

François-Xavier Coudert wrote:
>> > +  write(str,nml=nam) ! { dg-error "Internal file at (1) is
>> incompatible with namelist"}
>> > +  read(str,nml=nam) ! { dg-error "Internal file at (1) is
>> incompatible with namelist"}
>
> I think the dg-error string is interpreted as a regexp, where the ()
> have special meaning. Try "Internal file .* is incompatible with
> namelist", I guess it should work.

Quick first question: I currently use "make -k check", is there a
possibilty to run (lib)gfortran checks only?

Actually, I already tried .* (and forgot to mention it in the email),
but it still does not work.
What puzzles me is that it works once and fails then for the
second/third test?

Is there the problem that I check for the same error message two or
three times?

Looking at typed_subroutine_1.f90, I find:
---------
 INTEGER :: S ! { dg-error "has a type, which is not consistent with the
CALL " }
 CALL S()     ! { dg-error "has a type, which is not consistent with the
CALL " }
---------
This gives a single error, spread over two lines:
---------
 In file typed_subroutine_1.f90:7
 INTEGER :: S ! { dg-error "has a type, which is not consistent with the
CALL "
            1
 In file typed_subroutine_1.f90:8
nt with the CALL " }
                   2
Error: 's' at (1) has a type, which is not consistent with the CALL at (2)
---------


Currently I get:
PASS: gfortran.dg/namelist_internal2.f90  -O   (test for errors, line 16)
FAIL: gfortran.dg/namelist_internal2.f90  -O   (test for errors, line 20)
PASS: gfortran.dg/namelist_internal2.f90  -O  (test for excess errors)

and

PASS: gfortran.dg/write_check2.f90  -O   (test for errors, line 5)
FAIL: gfortran.dg/write_check2.f90  -O   (test for errors, line 6)
FAIL: gfortran.dg/write_check2.f90  -O   (test for errors, line 7)
PASS: gfortran.dg/write_check2.f90  -O  (test for excess errors)

I have:
> cat -n namelist_internal2.f90 | grep 'dg-error'
    16    write(str,nml=nam) ! { dg-error "Internal file at .* is
incompatible with namelist" }
    20    read(str,nml=nam) ! { dg-error "Internal file at .* is
incompatible with namelist" }
> cat -n write_check2.f90 | grep 'dg-error'
     5    write(13,'(a)',advance='y')    'Hello:' ! { dg-error
"ADVANCE=specifier at .* must have value = YES or NO." }
     6    write(13,'(a)',advance='yet')  'Hello:' ! { dg-error
"ADVANCE=specifier at .* must have value = YES or NO." }
     7    write(13,'(a)',advance='yess') 'Hello:' ! { dg-error
"ADVANCE=specifier at .* must have value = YES or NO." }

And from gfortran.log:
output is:
 In file
/home/tob/projects/gcc/gcc/testsuite/gfortran.dg/namelist_internal2.f90:16

  write(str,nml=nam) ! { dg-error "Internal file at .* is incompatible
with nam
       1
Error: Internal file at (1) is incompatible with namelist
 In file
/home/tob/projects/gcc/gcc/testsuite/gfortran.dg/namelist_internal2.f90:20

  read(str,nml=nam) ! { dg-error "Internal file at .* is incompatible
with name
      1
Error: Internal file at (1) is incompatible with namelist


and for write_check2.f90:

output is:
 In file /home/tob/projects/gcc/gcc/testsuite/gfortran.dg/write_check2.f90:5

  write(13,'(a)',advance='y')    'Hello:' ! { dg-error
"ADVANCE=specifier at .*
                        1
Error: ADVANCE=specifier at (1) must have value = YES or NO.
 In file /home/tob/projects/gcc/gcc/testsuite/gfortran.dg/write_check2.f90:6

  write(13,'(a)',advance='yet')  'Hello:' ! { dg-error
"ADVANCE=specifier at .*
                        1
Error: ADVANCE=specifier at (1) must have value = YES or NO.
 In file /home/tob/projects/gcc/gcc/testsuite/gfortran.dg/write_check2.f90:7

  write(13,'(a)',advance='yess') 'Hello:' ! { dg-error
"ADVANCE=specifier at .*
                        1
Error: ADVANCE=specifier at (1) must have value = YES or NO.


Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]