brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.6 KiB · 21a3009 Raw
169 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2 3module module_before_14end5 6module module_before_27end8 9block data block_data_before_110end11 12block data block_data_before_213end14 15subroutine explicit_before_1(a)16  real, optional :: a17end18 19subroutine explicit_before_2(a)20  real, optional :: a21end22 23subroutine implicit_before_1(a)24  real :: a25end26 27subroutine implicit_before_2(a)28  real :: a29end30 31function explicit_func_before_1(a)32  real, optional :: a33end34 35function explicit_func_before_2(a)36  real, optional :: a37end38 39function implicit_func_before_1(a)40  real :: a41end42 43function implicit_func_before_2(a)44  real :: a45end46 47program test48  external justfine ! OK to name a BLOCK DATA if not called49  !WARNING: The global entity 'module_before_1' corresponding to the local procedure 'module_before_1' is not a callable subprogram [-Wexternal-name-conflict]50  external module_before_151  !WARNING: The global entity 'block_data_before_1' corresponding to the local procedure 'block_data_before_1' is not a callable subprogram [-Wexternal-name-conflict]52  external block_data_before_153  !WARNING: The global subprogram 'explicit_before_1' should not be referenced via the implicit interface 'explicit_before_1' [-Wexternal-interface-mismatch]54  external explicit_before_155  external implicit_before_156  !WARNING: The global subprogram 'explicit_func_before_1' should not be referenced via the implicit interface 'explicit_func_before_1' [-Wexternal-interface-mismatch]57  external explicit_func_before_158  external implicit_func_before_159  !WARNING: The global entity 'module_after_1' corresponding to the local procedure 'module_after_1' is not a callable subprogram [-Wexternal-name-conflict]60  external module_after_161  !WARNING: The global entity 'block_data_after_1' corresponding to the local procedure 'block_data_after_1' is not a callable subprogram [-Wexternal-name-conflict]62  external block_data_after_163  !WARNING: The global subprogram 'explicit_after_1' should not be referenced via the implicit interface 'explicit_after_1' [-Wexternal-interface-mismatch]64  external explicit_after_165  external implicit_after_166  !WARNING: The global subprogram 'explicit_func_after_1' should not be referenced via the implicit interface 'explicit_func_after_1' [-Wexternal-interface-mismatch]67  external explicit_func_after_168  external implicit_func_after_169  call module_before_170  !ERROR: 'module_before_2' is not a callable procedure71  call module_before_272  call block_data_before_173  !ERROR: 'block_data_before_2' is not a callable procedure74  call block_data_before_275  call explicit_before_1(1.)76  !ERROR: References to the procedure 'explicit_before_2' require an explicit interface77  !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute78  call explicit_before_2(1.)79  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]80  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference81  call implicit_before_182  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]83  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference84  call implicit_before_285  print *, explicit_func_before_1(1.)86  !ERROR: References to the procedure 'explicit_func_before_2' require an explicit interface87  !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute88  print *, explicit_func_before_2(1.)89  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]90  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference91  print *, implicit_func_before_1()92  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]93  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference94  print *, implicit_func_before_2()95  call module_after_196  call module_after_297  call block_data_after_198  call block_data_after_299  call explicit_after_1(1.)100  !ERROR: References to the procedure 'explicit_after_2' require an explicit interface101  !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute102  call explicit_after_2(1.)103  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]104  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference105  call implicit_after_1106  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]107  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference108  call implicit_after_2109  print *, explicit_func_after_1(1.)110  !ERROR: References to the procedure 'explicit_func_after_2' require an explicit interface111  !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute112  print *, explicit_func_after_2(1.)113  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]114  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference115  print *, implicit_func_after_1()116  !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]117  !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference118  print *, implicit_func_after_2()119end program120 121block data justfine122end123 124module module_after_1125end126 127!ERROR: 'module_after_2' is already declared in this scoping unit128module module_after_2129end130 131block data block_data_after_1132end133 134!ERROR: BLOCK DATA 'block_data_after_2' has been called135block data block_data_after_2136end137 138subroutine explicit_after_1(a)139  real, optional :: a140end141 142subroutine explicit_after_2(a)143  real, optional :: a144end145 146subroutine implicit_after_1(a)147  real :: a148end149 150subroutine implicit_after_2(a)151  real :: a152end153 154function explicit_func_after_1(a)155  real, optional :: a156end157 158function explicit_func_after_2(a)159  real, optional :: a160end161 162function implicit_func_after_1(a)163  real :: a164end165 166function implicit_func_after_2(a)167  real :: a168end169