1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests based on examples in C.10.6
32 subroutine S3A(W
, X
, Y
, Z
)
36 subroutine S3B(X
, W
, Z
, Y
)
44 subroutine S3B(X
, W
, Z
, Y
)
48 subroutine S3A(W
, X
, Y
, Z
)
56 ! BAD4(1.0,2,Y=3.0,Z=4) could apply to either procedure
58 !ERROR: Generic 'bad4' may not have specific procedures 's4a' and 's4b' as their interfaces are not distinguishable
60 subroutine S4A(W
, X
, Y
, Z
)
64 subroutine S4B(X
, W
, Z
, Y
)
71 !ERROR: Generic 'bad4' may not have specific procedures 's4b' and 's4a' as their interfaces are not distinguishable
73 subroutine S4B(X
, W
, Z
, Y
)
77 subroutine S4A(W
, X
, Y
, Z
)
99 type, extends(FRUIT
) :: APPLE
101 type, extends(FRUIT
) :: PEAR
103 type, extends(PEAR
) :: BOSC
108 ! type(PEAR) :: A_PEAR
109 ! type(BOSC) :: A_BOSC
110 ! BAD6(A_PEAR,A_BOSC) ! could be s6a or s6b
112 !ERROR: Generic 'bad6' may not have specific procedures 's6a' and 's6b' as their interfaces are not distinguishable
126 !ERROR: Generic 'bad6' may not have specific procedures 's6b' and 's6a' as their interfaces are not distinguishable
143 subroutine S7A(X
, Y
, Z
)
145 class(PEAR
) :: X
, Y
, Z
147 subroutine S7B(X
, Z
, W
)
151 class(APPLE
), optional
:: W
157 subroutine S7B(X
, Z
, W
)
161 class(APPLE
), optional
:: W
163 subroutine S7A(X
, Y
, Z
)
165 class(PEAR
) :: X
, Y
, Z
171 ! Invalid generic (according to the rules), despite the fact that it is unambiguous
173 !ERROR: Generic 'bad8' may not have specific procedures 's8a' and 's8b' as their interfaces are not distinguishable
175 subroutine S8A(X
, Y
, Z
)
180 subroutine S8B(X
, Z
, Y
)
181 integer, optional
:: X