1 ! RUN: %python %S/test_errors.py %s %flang_fc1
9 block
data block_data_before_1
12 block
data block_data_before_2
15 subroutine explicit_before_1(a
)
19 subroutine explicit_before_2(a
)
23 subroutine implicit_before_1(a
)
27 subroutine implicit_before_2(a
)
31 function explicit_func_before_1(a
)
35 function explicit_func_before_2(a
)
39 function implicit_func_before_1(a
)
43 function implicit_func_before_2(a
)
48 external justfine
! OK to name a BLOCK DATA if not called
49 !ERROR: The global entity 'module_before_1' corresponding to the local procedure 'module_before_1' is not a callable subprogram
50 external module_before_1
51 !ERROR: The global entity 'block_data_before_1' corresponding to the local procedure 'block_data_before_1' is not a callable subprogram
52 external block_data_before_1
53 !ERROR: The global subprogram 'explicit_before_1' may not be referenced via the implicit interface 'explicit_before_1'
54 external explicit_before_1
55 external implicit_before_1
56 !ERROR: The global subprogram 'explicit_func_before_1' may not be referenced via the implicit interface 'explicit_func_before_1'
57 external explicit_func_before_1
58 external implicit_func_before_1
59 !ERROR: The global entity 'module_after_1' corresponding to the local procedure 'module_after_1' is not a callable subprogram
60 external module_after_1
61 !ERROR: The global entity 'block_data_after_1' corresponding to the local procedure 'block_data_after_1' is not a callable subprogram
62 external block_data_after_1
63 !ERROR: The global subprogram 'explicit_after_1' may not be referenced via the implicit interface 'explicit_after_1'
64 external explicit_after_1
65 external implicit_after_1
66 !ERROR: The global subprogram 'explicit_func_after_1' may not be referenced via the implicit interface 'explicit_func_after_1'
67 external explicit_func_after_1
68 external implicit_func_after_1
70 !ERROR: 'module_before_2' is not a callable procedure
72 call block_data_before_1
73 !ERROR: 'block_data_before_2' is not a callable procedure
74 call block_data_before_2
75 call explicit_before_1(1.)
76 !ERROR: References to the procedure 'explicit_before_2' require an explicit interface
77 call explicit_before_2(1.)
78 !WARNING: If the procedure's interface were explicit, this reference would be in error
79 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
80 call implicit_before_1
81 !WARNING: If the procedure's interface were explicit, this reference would be in error
82 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
83 call implicit_before_2
84 print *, explicit_func_before_1(1.)
85 !ERROR: References to the procedure 'explicit_func_before_2' require an explicit interface
86 print *, explicit_func_before_2(1.)
87 !WARNING: If the procedure's interface were explicit, this reference would be in error
88 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
89 print *, implicit_func_before_1()
90 !WARNING: If the procedure's interface were explicit, this reference would be in error
91 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
92 print *, implicit_func_before_2()
95 call block_data_after_1
96 call block_data_after_2
97 call explicit_after_1(1.)
98 !ERROR: References to the procedure 'explicit_after_2' require an explicit interface
99 call explicit_after_2(1.)
100 !WARNING: If the procedure's interface were explicit, this reference would be in error
101 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
102 call implicit_after_1
103 !WARNING: If the procedure's interface were explicit, this reference would be in error
104 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
105 call implicit_after_2
106 print *, explicit_func_after_1(1.)
107 !ERROR: References to the procedure 'explicit_func_after_2' require an explicit interface
108 print *, explicit_func_after_2(1.)
109 !WARNING: If the procedure's interface were explicit, this reference would be in error
110 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
111 print *, implicit_func_after_1()
112 !WARNING: If the procedure's interface were explicit, this reference would be in error
113 !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference
114 print *, implicit_func_after_2()
120 module module_after_1
123 !ERROR: 'module_after_2' is already declared in this scoping unit
124 module module_after_2
127 block
data block_data_after_1
130 !ERROR: BLOCK DATA 'block_data_after_2' has been called
131 block
data block_data_after_2
134 subroutine explicit_after_1(a
)
138 subroutine explicit_after_2(a
)
142 subroutine implicit_after_1(a
)
146 subroutine implicit_after_2(a
)
150 function explicit_func_after_1(a
)
154 function explicit_func_after_2(a
)
158 function implicit_func_after_1(a
)
162 function implicit_func_after_2(a
)