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.2 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
! Catch discrepancies between implicit result types and a global definition,
! allowing for derived types and type equivalence.
module m
type t1
integer n
end type
type t2
real a
end type
type t3
sequence
integer n
end type
end
function xfunc1()
use m
type(t1) xfunc1
xfunc1%n = 123
end
function yfunc1()
use m
type(t1) yfunc1
yfunc1%n = 123
end
function zfunc1()
type t3
sequence
integer n
end type
type(t3) zfunc1
zfunc1%n = 123
end
program main
use m
implicit type(t1) (x)
implicit type(t2) (y)
implicit type(t3) (z)
print *, xfunc1() ! ok
print *, xfunc2() ! ok
!ERROR: Implicit declaration of function 'yfunc1' has a different result type than in previous declaration
print *, yfunc1()
print *, yfunc2()
print *, zfunc1() ! ok
print *, zfunc2() ! ok
end
function xfunc2()
use m
type(t1) xfunc2
xfunc2%n = 123
end
function yfunc2()
use m
!ERROR: Function 'yfunc2' has a result type that differs from the implicit type it obtained in a previous reference
type(t1) yfunc2
yfunc2%n = 123
end
function zfunc2()
type t3
sequence
integer n
end type
type(t3) zfunc2
zfunc2%n = 123
end