2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / interface_13.f90
blob42c794a3e513dd3c1c178e18ccecbd5637ab6639
1 ! { dg-do compile }
2 ! PR32612 gfortran - incorrectly flags error on interface module
3 ! Test case is that of the reporters
4 module files_module
5 implicit none
6 integer, parameter :: REAL8 = SELECTED_REAL_KIND(12)
7 save
8 private
9 interface my_sio_file_read_common
10 module procedure my_sio_file_read_common ! This was rejected before
11 end interface
12 contains
13 subroutine my_sio_file_read_all_i4(serial, data, data_lengths, error)
14 logical, intent(in) :: serial
15 integer, intent(out) :: data(*)
16 integer, intent(in) :: data_lengths(0:*)
17 integer, intent(out) :: error
18 call my_sio_file_read_common(data_lengths, error, data_i4 = data)
19 end subroutine my_sio_file_read_all_i4
20 subroutine my_sio_file_read_common(data_lengths, error, &
21 data_i4, &
22 data_r8)
23 integer, intent(in) :: data_lengths(0:*)
24 integer, intent(out) :: error
25 integer, intent(out), optional :: data_i4(*)
26 real(REAL8), intent(out), optional :: data_r8(*)
27 error=0
28 data_i4(1)=0
29 data_r8(1)=0
30 end subroutine my_sio_file_read_common
31 end module files_module
33 ! { dg-final { cleanup-modules "files_module" } }