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

80 lines
2.1 KiB
Fortran

!RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
module m
type :: t1
integer :: n
contains
final :: t1f0, t1f1
end type
type :: t2
integer :: n
contains
final :: t2fe
end type
type :: t3
integer :: n
contains
final :: t3far
end type
type, extends(t1) :: t4
end type
type :: t5
!CHECK-NOT: 'scalar' of derived type 't1'
type(t1) :: scalar
!CHECK-NOT: 'vector' of derived type 't1'
type(t1) :: vector(2)
!CHECK: 'matrix' of derived type 't1' does not have a FINAL subroutine for its rank (2)
type(t1) :: matrix(2, 2)
end type
type :: t6
integer :: n
contains
final :: t6f3
end type
contains
subroutine t1f0(x)
type(t1) :: x
end subroutine
subroutine t1f1(x)
type(t1) :: x(:)
end subroutine
impure elemental subroutine t2fe(x)
type(t2), intent(in out) :: x
end subroutine
subroutine t3far(x)
type(t3) :: x(..)
end subroutine
subroutine t6f3(x)
type(t6) :: x(:,:,:)
end subroutine
end module
subroutine test(assumedRank) ! *not* a main program, since they don't finalize locals
use m
!CHECK-NOT: 'scalar1' of derived type 't1'
type(t1) :: scalar1
!CHECK-NOT: 'vector1' of derived type 't1'
type(t1) :: vector1(2)
!CHECK: 'matrix1' of derived type 't1' does not have a FINAL subroutine for its rank (2)
type(t1) :: matrix1(2,2)
!CHECK-NOT: 'scalar2' of derived type 't2'
type(t2) :: scalar2
!CHECK-NOT: 'vector2' of derived type 't2'
type(t2) :: vector2(2)
!CHECK-NOT: 'matrix2' of derived type 't2'
type(t2) :: matrix2(2,2)
!CHECK-NOT: 'scalar3' of derived type 't3'
type(t3) :: scalar3
!CHECK-NOT: 'vector3' of derived type 't3'
type(t3) :: vector3(2)
!CHECK-NOT: 'matrix3' of derived type 't2'
type(t3) :: matrix3(2,2)
!CHECK-NOT: 'scalar4' of derived type 't4'
type(t4) :: scalar4
!CHECK-NOT: 'vector4' of derived type 't4'
type(t4) :: vector4(2)
!CHECK: 'matrix4' of derived type 't4' extended from 't1' does not have a FINAL subroutine for its rank (2)
type(t4) :: matrix4(2,2)
!CHECK-NOT: 'assumedRank' of derived type 't6'
type(t6) :: assumedRank(..)
end