[ObjectYAML][NFC] Simplify ELFState<ELFT>::initProgramHeaders() (#123703)
[llvm-project.git] / flang / test / Semantics / namelist01.f90
blobb93d4b25550e3347ea50ff1dfb0f818aaf8888d0
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test for checking namelist constraints, C8103-C8105
4 module dup
5 integer dupName
6 integer uniqueName
7 end module dup
9 subroutine C8103a(x)
10 use dup, only: uniqueName, dupName
11 integer :: x
12 !ERROR: 'dupname' is already declared in this scoping unit
13 namelist /dupName/ x, x
14 namelist /nl/ uniquename ! ok
15 end subroutine C8103a
17 subroutine C8103b(y)
18 use dup, only: uniqueName
19 integer :: y
20 namelist /dupName/ y, y
21 end subroutine C8103b
23 subroutine C8104a(ivar, jvar)
24 integer :: ivar(10,8)
25 integer :: jvar(*)
26 NAMELIST /NLIST/ ivar
27 !ERROR: A namelist group object 'jvar' must not be assumed-size
28 NAMELIST /NLIST/ jvar
29 end subroutine C8104a
31 subroutine C8104b(ivar, jvar)
32 integer, dimension(*) :: jvar
33 !ERROR: A namelist group object 'jvar' must not be assumed-size
34 NAMELIST /NLIST/ ivar, jvar
35 end subroutine C8104b
37 subroutine C8104c(jvar)
38 integer :: jvar(10, 3:*)
39 !ERROR: A namelist group object 'jvar' must not be assumed-size
40 NAMELIST /NLIST/ jvar
41 end subroutine C8104c
43 module C8105
44 integer, private :: x
45 public :: NLIST
46 !ERROR: A PRIVATE namelist group object 'x' must not be in a PUBLIC namelist
47 NAMELIST /NLIST/ x
48 !ERROR: A PRIVATE namelist group object 'x' must not be in a PUBLIC namelist
49 NAMELIST /NLIST2/ x
50 public :: NLIST2
51 end module C8105