1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for C1553 and 18.3.4(1)
4 function func1() result(res
) bind(c
)
5 ! ERROR: BIND(C) function result cannot have ALLOCATABLE or POINTER attribute
6 integer, pointer :: res
9 function func2() result(res
) bind(c
)
10 ! ERROR: BIND(C) function result cannot have ALLOCATABLE or POINTER attribute
11 integer, allocatable
:: res
14 function func3() result(res
) bind(c
)
15 ! ERROR: BIND(C) function result must be scalar
19 function func4() result(res
) bind(c
)
20 ! ERROR: BIND(C) character function result must have length one
24 function func5(n
) result(res
) bind(c
)
26 ! ERROR: BIND(C) character function result must have length one
30 function func6() result(res
) bind(c
)
31 ! ERROR: BIND(C) character function result must have length one
35 function func7() result(res
) bind(c
)
36 integer, parameter :: n
= 1
37 character(n
) :: res
! OK
40 function func8() result(res
) bind(c
)
41 ! ERROR: BIND(C) function result cannot have ALLOCATABLE or POINTER attribute
42 ! ERROR: BIND(C) character function result must have length one
43 character(:), pointer :: res
46 function func9() result(res
) bind(c
)
47 ! ERROR: BIND(C) function result cannot be a coarray