1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Interfaces are allowed to extend intrinsic procedures, with limitations
6 module procedure
:: charcpy
8 interface cos
! no INTRINSIC statement
9 module procedure
:: charcpy
13 module procedure
:: negate
15 interface move_alloc
! no INTRINSIC statement
16 module procedure
:: negate
18 interface tan
! not explicitly INTRINSIC
19 module procedure
:: negate
! a subroutine
22 module procedure
:: minus
! override
25 !ERROR: Generic interface 'atan' with explicit intrinsic function of the same name may not have specific procedure 'negate' that is a subroutine
27 module procedure
:: negate
! a subroutine
30 character function charcpy(x
)
31 character, intent(in
) :: x
35 real, intent(in out
) :: x
38 real elemental
function minus(x
)
43 integer, allocatable
:: j
, k
47 str
= sin(str
) ! charcpy
49 str
= cos(str
) ! charcpy
50 call mvbits(j
,0,1,k
,0)
51 call mvbits(x
) ! negate
53 call move_alloc(x
) ! negate
54 !ERROR: Cannot call subroutine 'tan' like a function
56 x
= acos(x
) ! user's interface overrides intrinsic