xref: /llvm-project/flang/test/Semantics/resolve113.f90 (revision f3d8335383672df3b3b950a082c2b11a80cbdb9d)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2
3module m
4interface
5  module subroutine dump()
6  end subroutine
7end interface
8  integer, bind(c, name="a") :: x1
9  integer, bind(c) :: x2
10end
11
12subroutine sub()
13  !ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
14  integer, bind(c, name="b") :: x3
15  !ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
16  integer, bind(c) :: x4
17end
18
19program main
20  !ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
21  integer, bind(c, name="c") :: x5
22  !ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
23  integer, bind(c) :: x6
24end
25
26submodule(m) m2
27  !ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
28  integer, bind(c, name="d") :: x7
29  !ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
30  integer, bind(c) :: x8
31contains
32  module procedure dump
33  end procedure
34end
35