URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [assumed_charlen_function_1.f90] - Rev 700
Go to most recent revision | Compare with Previous | Blame | View Log
! { dg-do compile }! { dg-options "-std=legacy" }! Tests the patch for PRs 25084, 20852, 25085 and 25086, all of! which involve assumed character length functions.! Compiled from original PR testcases, which were all contributed! by Joost VandeVondele <jv244@cam.ac.uk>!! PR25084 - the error is not here but in any use of .IN.! It is OK to define an assumed character length function! in an interface but it cannot be invoked (5.1.1.5).MODULE M1TYPE SETINTEGER CARDEND TYPE SETEND MODULE M1MODULE INTEGER_SETSINTERFACE OPERATOR (.IN.)FUNCTION ELEMENT(X,A) ! { dg-error "cannot be assumed character length" }USE M1CHARACTER(LEN=*) :: ELEMENTINTEGER, INTENT(IN) :: XTYPE(SET), INTENT(IN) :: AEND FUNCTION ELEMENTEND INTERFACEEND MODULE! 5.1.1.5 of the Standard: A function name declared with an asterisk! char-len-param shall not be array-valued, pointer-valued, recursive! or pure!! PR20852RECURSIVE FUNCTION TEST() ! { dg-error "cannot be recursive" }CHARACTER(LEN=*) :: TESTTEST = ""END FUNCTION!PR25085FUNCTION F1() ! { dg-error "cannot be array-valued" }CHARACTER(LEN=*), DIMENSION(10) :: F1F1 = ""END FUNCTION F1!PR25086FUNCTION F2() result(f4) ! { dg-error "cannot be pointer-valued" }CHARACTER(LEN=*), POINTER :: f4f4 = ""END FUNCTION F2!PR?????pure FUNCTION F3() ! { dg-error "cannot be pure" }CHARACTER(LEN=*) :: F3F3 = ""END FUNCTION F3function not_OK (ch)character(*) not_OK, ch ! OK in an external functionnot_OK = chend function not_OKuse m1character(4) :: answercharacter(*), external :: not_OKinteger :: itype (set) :: zinterfacefunction ext (i)character(*) :: extinteger :: iend function extend interfaceanswer = not_OK ("unOK") ! { dg-error "since it is not a dummy" }END! { dg-final { cleanup-modules "m1" } }
Go to most recent revision | Compare with Previous | Blame | View Log
