AMDGPU: Allow f16/bf16 for DS_READ_TR16_B64 gfx950 builtins (#118297)
[llvm-project.git] / flang / test / Semantics / declarations03.f90
blob8e6f0a4aaf6bd6e545b42b7354b5dd9a28c2c8d4
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! test bind(c) name conflict
4 module m
6 integer :: x, y, z, w, i, j, k
8 !ERROR: Two entities have the same global name 'aa'
9 common /blk1/ x, /blk2/ y
10 bind(c, name="aa") :: /blk1/, /blk2/
12 integer :: t
13 !ERROR: Two entities have the same global name 'bb'
14 common /blk3/ z
15 bind(c, name="bb") :: /blk3/, t
17 integer :: t2
18 !ERROR: Two entities have the same global name 'cc'
19 common /blk4/ w
20 bind(c, name="cc") :: t2, /blk4/
22 !ERROR: The entity 'blk5' has multiple BIND names ('dd' and 'ee')
23 common /blk5/ i
24 bind(c, name="dd") :: /blk5/
25 bind(c, name="ee") :: /blk5/
27 !ERROR: Two entities have the same global name 'ff'
28 common /blk6/ j, /blk7/ k
29 bind(c, name="ff") :: /blk6/
30 bind(c, name="ff") :: /blk7/
32 !ERROR: The entity 's1' has multiple BIND names ('gg' and 'hh')
33 integer :: s1
34 bind(c, name="gg") :: s1
35 !ERROR: BIND_C attribute was already specified on 's1'
36 bind(c, name="hh") :: s1
38 !ERROR: Two entities have the same global name 'ii'
39 integer :: s2, s3
40 bind(c, name="ii") :: s2
41 bind(c, name="ii") :: s3
43 !ERROR: The entity 's4' has multiple BIND names ('ss1' and 'jj')
44 integer, bind(c, name="ss1") :: s4
45 !ERROR: BIND_C attribute was already specified on 's4'
46 bind(c, name="jj") :: s4
48 !ERROR: The entity 's5' has multiple BIND names ('kk' and 'ss2')
49 bind(c, name="kk") :: s5
50 !ERROR: BIND_C attribute was already specified on 's5'
51 integer, bind(c, name="ss2") :: s5
53 integer, bind(c, name="s6explicit") :: s6
54 dimension s6(10) ! caused spurious error
56 end
58 subroutine common1()
59 real :: x
60 common /com/ x
61 bind(c, name='xcom') /com/ ! no error
62 end subroutine
64 subroutine common2()
65 real :: x
66 common /com/ x
67 bind(c, name='xcom') /com/ ! no error
68 end subroutine
70 module a
71 integer, bind(c, name="int") :: i
72 end module
74 module b
75 !ERROR: Two entities have the same global name 'int'
76 integer, bind(c, name="int") :: i
77 end module
79 module c
80 bind(c, name = "AAA") a
81 integer aaa ! ensure no bogus error about multiple binding names
82 end module