llvm/flang/test/semantics/modfile19.f90
Tim Keith da46e49a01 [flang] Resolve namelist group and object names
Namelist groups are represents by symbols with `NamelistDetails`.
Those contain a list of symbols representing the objects in the group.
References to namelist groups in io-control-spec are resolved.

In `.mod` files, namelist groups are written out at the end of the
module specification section. This is so that the declarations of the
objects in the namelist group appear before they are referenced.

Original-commit: flang-compiler/f18@8b70dbcac7
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false
2019-02-05 14:43:00 -08:00

33 lines
894 B
Fortran

! Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
module m
implicit complex(8)(z)
real :: x
namelist /nl1/ x, y
namelist /nl2/ y, x
namelist /nl1/ i, z
complex(8) :: z
real :: y
end
!Expect: m.mod
!module m
! real(4)::x
! real(4)::y
! integer(4)::i
! complex(8)::z
! namelist/nl1/x,y,i,z
! namelist/nl2/y,x
!end