mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 06:50:27 +08:00
re PR libfortran/26136 (List directed input with underfilled (logicals) array read incorrectly)
2006-02-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/26136 * gfortran.dg/namelist_23.f90: New test. From-SVN: r111598
This commit is contained in:
parent
c9f15d9c0e
commit
c1fa1ae9be
@ -1,3 +1,8 @@
|
||||
2006-02-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/26136
|
||||
* gfortran.dg/namelist_23.f90: New test.
|
||||
|
||||
2006-02-28 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
PR middle-end/14752
|
||||
|
53
gcc/testsuite/gfortran.dg/namelist_23.f90
Normal file
53
gcc/testsuite/gfortran.dg/namelist_23.f90
Normal file
@ -0,0 +1,53 @@
|
||||
!{ dg-do run }
|
||||
! PR26136 Filling logical variables from namelist read when object list is not
|
||||
! complete. Test case derived from PR.
|
||||
! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
program read_logical
|
||||
implicit none
|
||||
logical, dimension(4) :: truely
|
||||
integer, dimension(4) :: truely_a_very_long_variable_name
|
||||
namelist /mynml/ truely
|
||||
namelist /mynml/ truely_a_very_long_variable_name
|
||||
|
||||
truely = .false.
|
||||
truely_a_very_long_variable_name = 0
|
||||
|
||||
open(10, status="scratch")
|
||||
write(10,*) "&mynml"
|
||||
write(10,*) "truely = trouble, traffic .true"
|
||||
write(10,*) "truely_a_very_long_variable_name = 4, 4, 4"
|
||||
write(10,*) "/"
|
||||
rewind(10)
|
||||
read (10, nml=mynml, err = 1000)
|
||||
if (.not.all(truely(1:3))) call abort()
|
||||
if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) call abort()
|
||||
|
||||
truely = .false.
|
||||
truely_a_very_long_variable_name = 0
|
||||
|
||||
rewind(10)
|
||||
write(10,*) "&mynml"
|
||||
write(10,*) "truely = .true., .true.,"
|
||||
write(10,*) "truely_a_very_long_variable_name = 4, 4, 4"
|
||||
write(10,*) "/"
|
||||
rewind(10)
|
||||
read (10, nml=mynml, err = 1000)
|
||||
if (.not.all(truely(1:2))) call abort()
|
||||
if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) call abort()
|
||||
|
||||
truely = .true.
|
||||
truely_a_very_long_variable_name = 0
|
||||
|
||||
rewind(10)
|
||||
write(10,*) "&mynml"
|
||||
write(10,*) "truely = .false., .false.,"
|
||||
write(10,*) "truely_a_very_long_variable_name = 4, 4, 4"
|
||||
write(10,*) "/"
|
||||
rewind(10)
|
||||
read (10, nml=mynml, err = 1000)
|
||||
if (all(truely(1:2))) call abort()
|
||||
if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) call abort()
|
||||
close(10)
|
||||
stop
|
||||
1000 call abort()
|
||||
end program read_logical
|
Loading…
x
Reference in New Issue
Block a user