1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Check for C1520
3! If proc-language-binding-spec (bind(c)) with NAME= is specified, then
4! proc-decl-list shall contain exactly one proc-decl, which shall neither have
5! the POINTER attribute nor be a dummy procedure.
6
7subroutine sub(x, y)
8
9  interface
10    subroutine proc() bind(c)
11    end
12  end interface
13
14  !Acceptable (as an extension)
15  procedure(proc), bind(c, name="aaa") :: pc1, pc2
16
17  !ERROR: BIND(C) procedure with NAME= specified can neither have POINTER attribute nor be a dummy procedure
18  procedure(proc), bind(c, name="bbb"), pointer :: pc3
19
20  !ERROR: BIND(C) procedure with NAME= specified can neither have POINTER attribute nor be a dummy procedure
21  procedure(proc), bind(c, name="ccc") :: x
22
23  procedure(proc), bind(c) :: pc4, pc5
24
25  !ERROR: BIND(C) procedure with NAME= specified can neither have POINTER attribute nor be a dummy procedure
26  procedure(proc), bind(c, name="pc6"), pointer :: pc6
27
28  procedure(proc), bind(c), pointer :: pc7
29
30  procedure(proc), bind(c) :: y
31
32  !WARNING: Attribute 'BIND(C)' cannot be used more than once
33  !ERROR: BIND(C) procedure with NAME= specified can neither have POINTER attribute nor be a dummy procedure
34  procedure(proc), bind(c, name="pc8"), bind(c), pointer :: pc8
35
36end
37