brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 86a925f Raw
45 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Check for C15203! If proc-language-binding-spec (bind(c)) with NAME= is specified, then4! proc-decl-list shall contain exactly one proc-decl, which shall neither have5! the POINTER attribute nor be a dummy procedure.6 7subroutine sub(x, y)8 9  interface10    subroutine proc() bind(c)11    end12  end interface13 14  abstract interface15    !ERROR: An ABSTRACT interface may not have a BIND attribute with a name16    subroutine aproc1() bind(c,name="foo")17    end18    subroutine aproc2() bind(c) ! ok19    end20  end interface21 22  !ERROR: A procedure declaration statement with a binding name may not declare multiple procedures23  procedure(proc), bind(c, name="aaa") :: pc1, pc224 25  !ERROR: A procedure pointer may not have a BIND attribute with a name26  procedure(proc), bind(c, name="bbb"), pointer :: pc327 28  !ERROR: An internal or dummy procedure may not have a BIND(C,NAME=) binding label29  procedure(proc), bind(c, name="ccc") :: x30 31  procedure(proc), bind(c) :: pc4, pc532 33  !ERROR: A procedure pointer may not have a BIND attribute with a name34  procedure(proc), bind(c, name="pc6"), pointer :: pc635 36  procedure(proc), bind(c), pointer :: pc737 38  procedure(proc), bind(c) :: y39 40  !WARNING: Attribute 'BIND(C)' cannot be used more than once [-Wredundant-attribute]41  !ERROR: A procedure pointer may not have a BIND attribute with a name42  procedure(proc), bind(c, name="pc8"), bind(c), pointer :: pc843 44end45