60 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Test error message priorities for DATA problems3module m4 integer useAlloc5 allocatable useAlloc6 integer, pointer :: usePtr(:)7 contains8 subroutine useProc9 end10end11function f(hostDummy, hostProc) result(hostResult)12 integer hostDummy, hostResult13 external hostProc14 integer hostAuto(hostDummy)15 integer, allocatable :: hostAlloc16 integer :: hostInit = 117 integer, pointer :: hostPtr(:)18 contains19 subroutine test(innerDummy, innerProc)20 use m21 external innerProc22 integer innerAuto(innerDummy)23 integer, allocatable :: innerAlloc24 integer :: innerInit = 125 integer, pointer :: innerPtr(:)26 !ERROR: Procedure 'useproc' must not be initialized in a DATA statement27 data useProc/0/28 !ERROR: Procedure 'hostproc' must not be initialized in a DATA statement29 data hostProc/0/30 !ERROR: Procedure 'innerproc' must not be initialized in a DATA statement31 data innerProc/0/32 !ERROR: Host-associated object 'hostdummy' must not be initialized in a DATA statement33 data hostDummy/1/34 !ERROR: Host-associated object 'hostresult' must not be initialized in a DATA statement35 data hostResult/1/36 !ERROR: Host-associated object 'hostauto' must not be initialized in a DATA statement37 data hostAuto/1/38 !ERROR: Host-associated object 'hostalloc' must not be initialized in a DATA statement39 data hostAlloc/1/40 !ERROR: Host-associated object 'hostinit' must not be initialized in a DATA statement41 data hostInit/1/42 !ERROR: Host-associated object 'hostptr' must not be initialized in a DATA statement43 data hostPtr(1)/1/44 !ERROR: USE-associated object 'usealloc' must not be initialized in a DATA statement45 data useAlloc/1/46 !ERROR: USE-associated object 'useptr' must not be initialized in a DATA statement47 data usePtr(1)/1/48 !ERROR: Dummy argument 'innerdummy' must not be initialized in a DATA statement49 data innerDummy/1/50 !ERROR: Automatic variable 'innerauto' must not be initialized in a DATA statement51 data innerAuto/1/52 !ERROR: Allocatable 'inneralloc' must not be initialized in a DATA statement53 data innerAlloc/1/54 !ERROR: Default-initialized 'innerinit' must not be initialized in a DATA statement55 data innerInit/1/56 !ERROR: Target of pointer 'innerptr' must not be initialized in a DATA statement57 data innerptr(1)/1/58 end59end60