2016-01-15 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / bind_c_18.f90
blob6360f01aaccadae4d075f2e2ef8bbe573ca1dbf9
1 ! { dg-do compile }
2 ! PR fortran/37201
4 ! Before character arrays were allowed as bind(C) return value.
6 implicit none
7 INTERFACE
8 FUNCTION my() BIND(C,name="my") RESULT(r) ! { dg-error "cannot be an array" }
9 USE iso_c_binding
10 CHARACTER(kind=C_CHAR) :: r(10)
11 END FUNCTION
12 END INTERFACE
13 INTERFACE
14 FUNCTION two() BIND(C,name="two") RESULT(r) ! { dg-error "cannot be a character string" }
15 USE iso_c_binding
16 CHARACTER(kind=C_CHAR,len=2) :: r
17 END FUNCTION
18 END INTERFACE
19 END