Files
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

74 lines
1.7 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Tests attempts at forward references to local names in a FUNCTION prefix
! This case is not an error, but will elicit bogus errors if the
! result type of the function is badly resolved.
module m1
type t1
sequence
integer not_m
end type
contains
type(t1) function foo(n)
integer, intent(in) :: n
type t1
sequence
integer m
end type
foo%m = n
end function
end module
subroutine s1
use :: m1, only: foo
type t1
sequence
integer m
end type
type(t1) x
x = foo(234)
print *, x
end subroutine
module m2
integer, parameter :: k = kind(1.e0)
contains
real(kind=k) function foo(n)
integer, parameter :: k = kind(1.d0)
integer, intent(in) :: n
foo = n
end function
end module
subroutine s2
use :: m2, only: foo
!If we got the type of foo right, this declaration will fail
!due to an attempted division by zero.
!WARNING: INTEGER(4) division by zero [-Wfolding-exception]
!ERROR: Must be a constant value
integer, parameter :: test = 1 / (kind(foo(1)) - kind(1.d0))
end subroutine
module m3
real(kind=kind(1.0e0)) :: x
contains
real(kind=kind(x)) function foo(x)
real(kind=kind(1.0d0)) x
!WARNING: INTEGER(4) division by zero [-Wfolding-exception]
!ERROR: Must be a constant value
integer, parameter :: test = 1 / (kind(foo) - kind(1.d0))
foo = n
end function
end module
module m4
contains
real(n) function foo(x)
!ERROR: 'foo' is not an object that can appear in an expression
integer, parameter :: n = kind(foo)
real(n), intent(in) :: x
!ERROR: 'x' is not an object that can appear in an expression
foo = x
end function
end module