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

71 lines
1.7 KiB
Fortran

!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
! Size and alignment of derived types
! Array of derived type with 64-bit alignment
subroutine s1
type t1
real(8) :: a
real(4) :: b
end type
type t2
type(t1) c
real(4) d
end type
!CHECK: x1 size=16 offset=0:
!CHECK: y1 size=16 offset=16:
type(t1) :: x1, y1
!CHECK: z1 size=160 offset=32:
type(t1) :: z1(10)
!CHECK: z2 size=24 offset=192
type(t2) z2
end
! Like t1 but t2 does not need to be aligned on 64-bit boundary
subroutine s2
type t2
real(4) :: a
real(4) :: b
real(4) :: c
end type
!CHECK: x2 size=12 offset=0:
!CHECK: y2 size=12 offset=12:
type(t2) :: x2, y2
!CHECK: z2 size=120 offset=24:
type(t2) :: z2(10)
end
! Parameterized derived types
subroutine s3
type :: t(k, l)
integer, kind :: k
integer, len :: l
real(k) :: a3
integer(kind=k) :: b3
character(kind=k, len=8) :: c3
character(kind=k, len=l) :: d3
end type
!CHECK: DerivedType scope: size=48 alignment=8 instantiation of t(k=2_4,l=10_4)
!CHECK: a3 size=2 offset=0:
!CHECK: b3 size=2 offset=2:
!CHECK: c3 size=16 offset=4:
!CHECK: d3 size=24 offset=24:
type(t(2, 10)) :: x3
!CHECK: DerivedType scope: size=64 alignment=8 instantiation of t(k=4_4,l=20_4)
!CHECK: a3 size=4 offset=0:
!CHECK: b3 size=4 offset=4:
!CHECK: c3 size=32 offset=8:
!CHECK: d3 size=24 offset=40:
type(t(4, 20)) :: x4
end
subroutine s4
type t(k)
integer, kind :: k
character(len=k) :: c
end type
type(t(7)) :: x4
!CHECK: DerivedType scope: size=7 alignment=1 instantiation of t(k=7_4)
!CHECK: c size=7 offset=0: ObjectEntity type: CHARACTER(7_4,1)
end subroutine