[ORC] Merge ostream operators for SymbolStringPtrs into SymbolStringPool.h. NFC.
[llvm-project.git] / flang / test / Semantics / bind-c02.f90
blob416d071542fe6415184832f81130ed339887c17d
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
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: BIND_C attribute was already specified on 'sub'
19 !ERROR: Only variable and named common block can be in BIND statement
20 bind(c) :: sub
22 !PORTABILITY: Global name 'm' conflicts with a module
23 !PORTABILITY: Name 'm' declared in a module should not have the same name as the module
24 bind(c) :: m ! no error for implicit type variable
26 type my_type
27 integer :: i
28 end type
29 !ERROR: Only variable and named common block can be in BIND statement
30 bind(c) :: my_type
32 enum, bind(c) ! no error
33 enumerator :: SUNDAY, MONDAY
34 end enum
36 integer :: x, y, z = 1
37 common /blk/ y
38 bind(c) :: x, /blk/, z ! no error for variable and common block
40 bind(c) :: implicit_i ! no error for implicit type variable
42 !ERROR: 'implicit_blk' appears as a COMMON block in a BIND statement but not in a COMMON statement
43 bind(c) :: /implicit_blk/
45 contains
47 subroutine sub() bind(c)
48 end
50 end