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
112 lines
4.4 KiB
Fortran
112 lines
4.4 KiB
Fortran
! Test automatic deallocation of allocatable components
|
|
! of local variables as described in Fortran 2018 standard
|
|
! 9.7.3.2 point 2. and 3.
|
|
! The allocatable components of local variables are local variables
|
|
! themselves due to 5.4.3.2.2 p. 2, note 1.
|
|
! RUN: bbc -emit-hlfir -o - -I nowhere %s | FileCheck %s
|
|
|
|
module types
|
|
type t1
|
|
real, allocatable :: x
|
|
end type t1
|
|
type t2
|
|
type(t1) :: x
|
|
end type t2
|
|
type, extends(t1) :: t3
|
|
end type t3
|
|
type, extends(t3) :: t4
|
|
end type t4
|
|
type, extends(t2) :: t5
|
|
end type t5
|
|
end module types
|
|
|
|
subroutine test1()
|
|
use types
|
|
type(t1) :: x1
|
|
end subroutine test1
|
|
! CHECK-LABEL: func.func @_QPtest1() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_9:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_9]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>>) -> !fir.box<none>
|
|
|
|
subroutine test1b()
|
|
use types
|
|
block
|
|
type(t1) :: x1
|
|
end block
|
|
end subroutine test1b
|
|
! CHECK-LABEL: func.func @_QPtest1b() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_10:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_10]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>>) -> !fir.box<none>
|
|
|
|
subroutine test2()
|
|
use types
|
|
type(t2) :: x2
|
|
end subroutine test2
|
|
! CHECK-LABEL: func.func @_QPtest2() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_9:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_9]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt2{x:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>>) -> !fir.box<none>
|
|
|
|
subroutine test2b()
|
|
use types
|
|
block
|
|
type(t2) :: x2
|
|
end block
|
|
end subroutine test2b
|
|
! CHECK-LABEL: func.func @_QPtest2b() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_10:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_10]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt2{x:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>>) -> !fir.box<none>
|
|
|
|
subroutine test3()
|
|
use types
|
|
type(t3) :: x3
|
|
end subroutine test3
|
|
! CHECK-LABEL: func.func @_QPtest3() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_9:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_9]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt3{t1:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>>) -> !fir.box<none>
|
|
|
|
subroutine test3b()
|
|
use types
|
|
block
|
|
type(t3) :: x3
|
|
end block
|
|
end subroutine test3b
|
|
! CHECK-LABEL: func.func @_QPtest3b() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_10:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_10]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt3{t1:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>>) -> !fir.box<none>
|
|
|
|
subroutine test4()
|
|
use types
|
|
type(t4) :: x4
|
|
end subroutine test4
|
|
! CHECK-LABEL: func.func @_QPtest4() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_9:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_9]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt4{t3:!fir.type<_QMtypesTt3{t1:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>}>>) -> !fir.box<none>
|
|
|
|
subroutine test4b()
|
|
use types
|
|
block
|
|
type(t4) :: x4
|
|
end block
|
|
end subroutine test4b
|
|
! CHECK-LABEL: func.func @_QPtest4b() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_10:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_10]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt4{t3:!fir.type<_QMtypesTt3{t1:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>}>>) -> !fir.box<none>
|
|
|
|
subroutine test5()
|
|
use types
|
|
type(t5) :: x5
|
|
end subroutine test5
|
|
! CHECK-LABEL: func.func @_QPtest5() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_9:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_9]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt5{t2:!fir.type<_QMtypesTt2{x:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>}>>) -> !fir.box<none>
|
|
|
|
subroutine test5b()
|
|
use types
|
|
block
|
|
type(t5) :: x5
|
|
end block
|
|
end subroutine test5b
|
|
! CHECK-LABEL: func.func @_QPtest5b() {
|
|
! CHECK-DAG: fir.call @_FortranADestroy(%[[VAL_10:.*]]) fastmath<contract> : (!fir.box<none>) -> ()
|
|
! CHECK-DAG: %[[VAL_10]] = fir.convert %{{.*}} : (!fir.box<!fir.type<_QMtypesTt5{t2:!fir.type<_QMtypesTt2{x:!fir.type<_QMtypesTt1{x:!fir.box<!fir.heap<f32>>}>}>}>>) -> !fir.box<none>
|