RISC-V: Regenerate opt urls.
[official-gcc.git] / gcc / testsuite / gfortran.dg / private_type_3.f90
blob84bacd5956d7ef23e59074f66b8904be6c03e874
1 ! { dg-do compile }
2 ! { dg-options "-O0" }
3 ! { dg-require-visibility "" }
4 ! Tests the fix for PR24207 and the problems associated
5 ! with the fix for PR21986. In two cases, use associated
6 ! public symbols were taking on the default private access
7 ! attribute of the local namespace. In the third, a private
8 ! symbol was not available to a namelist in contained
9 ! procedure in the same module.
11 ! Based on the example in PR24207.
13 module a
14 implicit none
15 real b
16 type :: mytype
17 integer :: c
18 end type mytype
19 end module a
20 module c
21 use a
22 implicit none
23 public d
24 private
25 real x
26 contains
27 subroutine d (arg_t) ! This would cause an error
28 type (mytype) :: arg_t
29 namelist /e/ b, x ! .... as would this.
30 read(5,e)
31 arg_t%c = 42
32 end subroutine d
33 end module c