Files
TheRock/compiler/amd-llvm/flang/test/Semantics/unused.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

34 lines
1.6 KiB
Fortran

!RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -Wunused-variable -Wused-undefined-variable
subroutine testUnusedWarnings(dummyArgument)
common inCommon ! ok
!WARNING: Value of local variable 'uninitializedunused' is never used [-Wunused-variable]
real uninitializedUnused
!WARNING: Value of uninitialized local variable 'undefined' is used but never defined [-Wused-undefined-variable]
real undefined
integer :: initialized = 1 ! ok
!WARNING: Value of local variable 'unusedinitialized' is never used [-Wunused-variable]
integer :: unusedInitialized = 2
!WARNING: Value of local variable 'craypointer1' is never used [-Wunused-variable]
!WARNING: Value of local variable 'craypointee1' is never used [-Wunused-variable]
pointer (crayPointer1, crayPointee1)
!WARNING: Value of uninitialized local variable 'craypointer2' is used but never defined [-Wused-undefined-variable]
!WARNING: Value of uninitialized local variable 'craypointee2' is used but never defined [-Wused-undefined-variable]
pointer (crayPointer2, crayPointee2)
integer, parameter :: namedConstant = 123 ! ok
real, target :: target ! ok
real, pointer :: pointer ! ok
equivalence (eq1, eq2) ! ok
!WARNING: Value of uninitialized local variable 'a1' is used but never defined [-Wused-undefined-variable]
real, allocatable :: a1, a2, a3, a4, a5
!WARNING: Value of local variable 'b2' is never used [-Wunused-variable]
real b1, b2
allocate(a2, source=a1)
allocate(a3, source=a2)
do j = 1, 10 ! ok
end do
pointer => target
call move_alloc(a4, a5)
read(*,*) b1
print *, undefined, initialized, crayPointee2, a3, b1
end