Files
TheRock/compiler/amd-llvm/flang/test/Semantics/undef-result01.f90
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

156 lines
2.9 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
!WARNING: Function result is never defined [-Wundefined-function-result]
function basic()
end
function defdByIntentOut()
call intentout(defdByIntentOut)
contains
subroutine intentout(x)
real, intent(out) :: x
end
end
function defdByIntentInOut()
call intentinout(defdByIntentInOut)
contains
subroutine intentInout(x)
real, intent(out) :: x
end
end
function defdByIntentInPtr()
real, target :: defdByIntentInPtr
call intentInPtr(defdByIntentInPtr)
contains
subroutine intentInPtr(p)
real, intent(in), pointer :: p
end
end
!WARNING: Function result is never defined [-Wundefined-function-result]
function notDefdByCall()
call intentin(notDefdByCall)
contains
subroutine intentin(n)
integer, intent(in) :: n
end
end
!WARNING: Function result is never defined [-Wundefined-function-result]
function basicAlloc()
real, allocatable :: basicAlloc
allocate(basicAlloc)
end
function allocPtr()
real, pointer :: allocPtr
allocate(allocPtr) ! good enough for pointer
end
function sourcedAlloc()
real, allocatable :: sourcedAlloc
allocate(sourcedAlloc, source=0.)
end
function defdByEntry()
entry entry1
entry1 = 0.
end
function defdByEntry2()
entry entry2() result(entryResult)
entryResult = 0.
end
function usedAsTarget()
real, target :: usedAsTarget
real, pointer :: p
p => usedAsTarget
end
function entryUsedAsTarget()
real, target :: entryResult
real, pointer :: p
entry entry5() result(entryResult)
p => entryResult
end
function defdByCall()
call implicitInterface(defdByCall)
end
function defdInInternal()
contains
subroutine internal
defdInInternal = 0.
end
end
function defdByEntryInInternal()
entry entry3() result(entryResult)
contains
subroutine internal
entryResult = 0.
end
end
type(defaultInitialized) function defdByDefault()
type defaultInitialized
integer :: n = 123
end type
end
integer function defdByDo()
do defdByDo = 1, 10
end do
end
function defdByRead()
read(*,*) defdByRead
end function
function defdByNamelist()
namelist /nml/ defdByNamelist
read(*,nml=nml)
end
character(4) function defdByWrite()
write(defdByWrite,*) 'abcd'
end
integer function defdBySize()
real arr(10)
read(*,size=defdBySize) arr
end
character(40) function defdByIomsg()
!WARNING: IOMSG= is useless without either ERR= or IOSTAT=
write(123,*,iomsg=defdByIomsg)
end
character(20) function defdByInquire()
inquire(6,status=defdByInquire)
end
!WARNING: Function result is never defined [-Wundefined-function-result]
character(20) function notDefdByInquire()
inquire(file=notDefdByInquire)
end
integer function defdByNewunit()
open(newunit=defdByNewunit, file="foo.txt")
end
function defdByAssociate()
associate(s => defdByAssociate)
s = 1.
end associate
end
function defdByElementArgToImplicit() result(r)
real r(1)
call define(r(1))
end