[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / resolve82.f90
blob461bd3c9a0abd93a9808a855a02f02cdf5836523
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! C815 An entity shall not be explicitly given any attribute more than once in
4 ! a scoping unit.
6 ! R1512 procedure-declaration-stmt ->
7 ! PROCEDURE ( [proc-interface] ) [[, proc-attr-spec]... ::]
8 ! proc-decl-list
9 ! proc-attr-spec values are:
10 ! PUBLIC, PRIVATE, BIND(C), INTENT (intent-spec), OPTIONAL, POINTER,
11 ! PROTECTED, SAVE
12 module m
13 abstract interface
14 real function procFunc()
15 end function procFunc
16 end interface
18 !WARNING: Attribute 'PUBLIC' cannot be used more than once
19 procedure(procFunc), public, pointer, public :: proc1
20 !WARNING: Attribute 'PRIVATE' cannot be used more than once
21 procedure(procFunc), private, pointer, private :: proc2
22 !WARNING: Attribute 'BIND(C)' cannot be used more than once
23 procedure(procFunc), bind(c), pointer, bind(c) :: proc3
24 !WARNING: Attribute 'PROTECTED' cannot be used more than once
25 procedure(procFunc), protected, pointer, protected :: proc4
27 contains
29 subroutine testProcDecl(arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11)
30 !WARNING: Attribute 'INTENT(IN)' cannot be used more than once
31 procedure(procFunc), intent(in), pointer, intent(in) :: arg4
32 !WARNING: Attribute 'INTENT(OUT)' cannot be used more than once
33 procedure(procFunc), intent(out), pointer, intent(out) :: arg5
34 !WARNING: Attribute 'INTENT(INOUT)' cannot be used more than once
35 procedure(procFunc), intent(inout), pointer, intent(inout) :: arg6
36 !ERROR: Attributes 'INTENT(INOUT)' and 'INTENT(OUT)' conflict with each other
37 procedure(procFunc), intent(inout), pointer, intent(out) :: arg7
38 !ERROR: Attributes 'INTENT(INOUT)' and 'INTENT(OUT)' conflict with each other
39 procedure(procFunc), intent(out), pointer, intent(inout) :: arg8
40 !WARNING: Attribute 'OPTIONAL' cannot be used more than once
41 procedure(procFunc), optional, pointer, optional :: arg9
42 !WARNING: Attribute 'POINTER' cannot be used more than once
43 procedure(procFunc), pointer, optional, pointer :: arg10
44 !WARNING: Attribute 'SAVE' cannot be used more than once
45 procedure(procFunc), save, pointer, save :: localProc
46 end subroutine testProcDecl
48 end module m