Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / bind-c02.f90
blob9ff6cf54bfa033d1828408d492e949efc69ea27e
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for 8.6.4(1)
3 ! The BIND statement specifies the BIND attribute for a list of variables and
4 ! common blocks.
6 module m
8 interface
9 subroutine proc()
10 end
11 end interface
12 procedure(proc) :: pc1
13 !ERROR: Only variable and named common block can be in BIND statement
14 bind(c) :: proc
15 !ERROR: Only variable and named common block can be in BIND statement
16 bind(c) :: pc1
18 !ERROR: Only variable and named common block can be in BIND statement
19 bind(c) :: sub
21 !PORTABILITY: Global name 'm' conflicts with a module
22 !PORTABILITY: Name 'm' declared in a module should not have the same name as the module
23 bind(c) :: m ! no error for implicit type variable
25 type my_type
26 integer :: i
27 end type
28 !ERROR: Only variable and named common block can be in BIND statement
29 bind(c) :: my_type
31 enum, bind(c) ! no error
32 enumerator :: SUNDAY, MONDAY
33 end enum
35 integer :: x, y, z = 1
36 common /blk/ y
37 bind(c) :: x, /blk/, z ! no error for variable and common block
39 bind(c) :: implicit_i ! no error for implicit type variable
41 !ERROR: 'implicit_blk' appears as a COMMON block in a BIND statement but not in a COMMON statement
42 bind(c) :: /implicit_blk/
44 contains
46 subroutine sub() bind(c)
47 end
49 end