1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C1030 - assignment of pointers to intrinsic procedures
3 ! C1515 - interface definition for procedure pointers
4 ! C1519 - initialization of pointers to intrinsic procedures
6 intrinsic :: cos
! a specific & generic intrinsic name
7 intrinsic :: alog10
! a specific intrinsic name, not generic
8 intrinsic :: null
! a weird special case
9 intrinsic :: bessel_j0
! generic intrinsic, not specific
13 !ERROR: 'haltandcatchfire' is not a known intrinsic procedure
14 intrinsic :: haltandcatchfire
17 logical function chrcmp(a
,b
)
18 character(*), intent(in
) :: a
19 character(*), intent(in
) :: b
23 procedure(sin
), pointer :: p
=> cos
24 !ERROR: Intrinsic procedure 'amin0' is not an unrestricted specific intrinsic permitted for use as the definition of the interface to procedure pointer 'q'
25 procedure(amin0
), pointer :: q
26 !ERROR: Intrinsic procedure 'bessel_j0' is not an unrestricted specific intrinsic permitted for use as the definition of the interface to procedure pointer 'r'
27 procedure(bessel_j0
), pointer :: r
28 !ERROR: Intrinsic procedure 'llt' is not an unrestricted specific intrinsic permitted for use as the initializer for procedure pointer 's'
29 procedure(chrcmp
), pointer :: s
=> llt
30 !ERROR: Intrinsic procedure 'bessel_j0' is not an unrestricted specific intrinsic permitted for use as the initializer for procedure pointer 't'
31 procedure(cos
), pointer :: t
=> bessel_j0
32 procedure(chrcmp
), pointer :: u
33 p
=> alog
! valid use of an unrestricted specific intrinsic
34 p
=> alog10
! ditto, but already declared intrinsic
35 p
=> cos
! ditto, but also generic
36 p
=> tan
! a generic & an unrestricted specific, not already declared
37 !ERROR: Function pointer 'p' associated with incompatible function designator 'mod': function results have distinct types: REAL(4) vs INTEGER(4)
39 !ERROR: Function pointer 'p' associated with incompatible function designator 'index': function results have distinct types: REAL(4) vs INTEGER(4)
41 !ERROR: 'bessel_j0' is not an unrestricted specific intrinsic procedure
43 !ERROR: 'llt' is not an unrestricted specific intrinsic procedure