Debian Codegraph @

gcc/testsuite/gfortran.dg/namelist_95.f90

raw
1 ! { dg-do run }
2 ! PR83191 Writing a namelist with repeated complex
3
4 program test
5
6 implicit none
7
8 integer, parameter :: UNIT = 1
9 character(len=8), parameter :: FILE = "namelist"
10
11 complex, dimension(3) :: a = (/ (0.0, 0.0), (0.0, 0.0), (3.0, 4.0) /)
12
13 namelist /complex_namelist/ a
14
15 open(UNIT, file=FILE)
16 write(UNIT, nml=complex_namelist)
17 close(UNIT)
18
19 open(UNIT, file=FILE)
20 read(UNIT, nml=complex_namelist)
21 close(UNIT, status="delete")
22 if (any(a.ne.(/ (0.0, 0.0), (0.0, 0.0), (3.0, 4.0) /))) STOP 1
23 end program test