67 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! C801 The same attr-spec shall not appear more than once in a given3! type-declaration-stmt.4!5! R801 type-declaration-stmt ->6! declaration-type-spec [[, attr-spec]... ::] entity-decl-list7! attr-spec values are:8! PUBLIC, PRIVATE, ALLOCATABLE, ASYNCHRONOUS, CODIMENSION, CONTIGUOUS,9! DIMENSION (array-spec), EXTERNAL, INTENT (intent-spec), INTRINSIC,10! BIND(C), OPTIONAL, PARAMETER, POINTER, PROTECTED, SAVE, TARGET, VALUE,11! VOLATILE12module m13 14 !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute]15 real, public, allocatable, public :: publicVar16 !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute]17 real, private, allocatable, private :: privateVar18 !WARNING: Attribute 'ALLOCATABLE' cannot be used more than once [-Wredundant-attribute]19 real, allocatable, allocatable :: allocVar20 !WARNING: Attribute 'ASYNCHRONOUS' cannot be used more than once [-Wredundant-attribute]21 real, asynchronous, public, asynchronous :: asynchVar22 !ERROR: Attribute 'CODIMENSION' cannot be used more than once23 real, codimension[*], codimension[*] :: codimensionVar24 !WARNING: Attribute 'CONTIGUOUS' cannot be used more than once [-Wredundant-attribute]25 real, contiguous, pointer, contiguous :: contigVar(:)26 !ERROR: Attribute 'DIMENSION' cannot be used more than once27 real, dimension(5), dimension(5) :: arrayVar28 !WARNING: Attribute 'EXTERNAL' cannot be used more than once [-Wredundant-attribute]29 real, external, external :: externFunc30 !WARNING: Attribute 'INTRINSIC' cannot be used more than once [-Wredundant-attribute]31 !ERROR: 'cos' may not have both the BIND(C) and INTRINSIC attributes32 !ERROR: An interface name with the BIND attribute must appear if the BIND attribute appears in a procedure declaration33 real, intrinsic, bind(c), intrinsic :: cos34 !WARNING: Attribute 'BIND(C)' cannot be used more than once [-Wredundant-attribute]35 integer, bind(c), volatile, bind(c) :: bindVar36 !WARNING: Attribute 'PARAMETER' cannot be used more than once [-Wredundant-attribute]37 real, parameter, parameter :: realConst = 4.338 !WARNING: Attribute 'POINTER' cannot be used more than once [-Wredundant-attribute]39 real, pointer, pointer :: realPtr40 !WARNING: Attribute 'PROTECTED' cannot be used more than once [-Wredundant-attribute]41 real, protected, protected :: realProt42 !WARNING: Attribute 'SAVE' cannot be used more than once [-Wredundant-attribute]43 real, save, save :: saveVar44 !WARNING: Attribute 'TARGET' cannot be used more than once [-Wredundant-attribute]45 real, target, target :: targetVar46 !WARNING: Attribute 'VOLATILE' cannot be used more than once [-Wredundant-attribute]47 real, volatile, volatile :: volatileVar48 49contains50 subroutine testTypeDecl(arg1, arg2, arg3, arg4, arg5, arg6)51 !WARNING: Attribute 'INTENT(IN)' cannot be used more than once [-Wredundant-attribute]52 real, intent(in), intent(in) :: arg153 !WARNING: Attribute 'INTENT(OUT)' cannot be used more than once [-Wredundant-attribute]54 real, intent(out), intent(out) :: arg255 !WARNING: Attribute 'INTENT(INOUT)' cannot be used more than once [-Wredundant-attribute]56 real, intent(inout), intent(inout) :: arg357 !WARNING: Attribute 'OPTIONAL' cannot be used more than once [-Wredundant-attribute]58 integer, optional, intent(in), optional :: arg459 !WARNING: Attribute 'VALUE' cannot be used more than once [-Wredundant-attribute]60 integer, value, intent(in), value :: arg561 !ERROR: Attributes 'INTENT(IN)' and 'INTENT(INOUT)' conflict with each other62 integer, intent(in), pointer, intent(inout) :: arg663 64 arg2 =3.565 end subroutine testTypeDecl66end module m67