1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
3 !WARNING: Function result is never defined
7 function defdByIntentOut()
8 call intentout(defdByIntentOut
)
10 subroutine intentout(x
)
11 real, intent(out
) :: x
15 function defdByIntentInOut()
16 call intentinout(defdByIntentInOut
)
18 subroutine intentInout(x
)
19 real, intent(out
) :: x
23 function defdByIntentInPtr()
24 real, target
:: defdByIntentInPtr
25 call intentInPtr(defdByIntentInPtr
)
27 subroutine intentInPtr(p
)
28 real, intent(in
), pointer :: p
32 !WARNING: Function result is never defined
33 function notDefdByCall()
34 call intentin(notDefdByCall
)
36 subroutine intentin(n
)
37 integer, intent(in
) :: n
41 !WARNING: Function result is never defined
43 real, allocatable
:: basicAlloc
48 real, pointer :: allocPtr
49 allocate(allocPtr
) ! good enough for pointer
52 function sourcedAlloc()
53 real, allocatable
:: sourcedAlloc
54 allocate(sourcedAlloc
, source
=0.)
57 function defdByEntry()
62 function defdByEntry2()
63 entry entry2() result(entryResult
)
67 function usedAsTarget()
68 real, target
:: usedAsTarget
73 function entryUsedAsTarget()
74 real, target
:: entryResult
76 entry entry5() result(entryResult
)
81 call implicitInterface(defdByCall
)
84 function defdInInternal()
91 function defdByEntryInInternal()
92 entry entry3() result(entryResult
)
99 type(defaultInitialized
) function defdByDefault()
100 type defaultInitialized
105 integer function defdByDo()
110 function defdByRead()
114 function defdByNamelist()
115 namelist /nml
/ defdByNamelist
119 character(4) function defdByWrite()
120 write(defdByWrite
,*) 'abcd'
123 integer function defdBySize()
125 read(*,size
=defdBySize
) arr
128 character(40) function defdByIomsg()
129 !WARNING: IOMSG= is useless without either ERR= or IOSTAT=
130 write(123,*,iomsg
=defdByIomsg
)
133 character(20) function defdByInquire()
134 inquire(6,status
=defdByInquire
)
137 !WARNING: Function result is never defined
138 character(20) function notDefdByInquire()
139 inquire(file
=notDefdByInquire
)
142 integer function defdByNewunit()
143 open(newunit
=defdByNewunit
, file
="foo.txt")
146 function defdByAssociate()
147 associate(s
=> defdByAssociate
)
152 function defdByElementArgToImplicit() result(r
)