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
60 lines
2.5 KiB
Fortran
60 lines
2.5 KiB
Fortran
! RUN: %python %S/test_modfile.py %s %flang_fc1
|
|
! Test compile-time analysis of shapes.
|
|
|
|
module m1
|
|
integer(8), parameter :: a0s(*) = shape(3.14159)
|
|
real :: a1(5,5,5)
|
|
integer(8), parameter :: a1s(*) = shape(a1)
|
|
integer(8), parameter :: a1ss(*) = shape(a1s)
|
|
integer(8), parameter :: a1sss(*) = shape(a1ss)
|
|
integer(8), parameter :: a1rs(*) = [rank(a1),rank(a1s),rank(a1ss),rank(a1sss)]
|
|
integer(8), parameter :: a1n(*) = [size(a1),size(a1,1),size(a1,2)]
|
|
integer(8), parameter :: a1sn(*) = [size(a1s),size(a1ss),size(a1sss)]
|
|
integer(8), parameter :: ac1s(*) = shape([1])
|
|
integer(8), parameter :: ac2s(*) = shape([1,2,3])
|
|
integer(8), parameter :: ac3s(*) = shape([(1,j=1,4)])
|
|
integer(8), parameter :: ac3bs(*) = shape([(1,j=4,1,-1)])
|
|
integer(8), parameter :: ac4s(*) = shape([((j,k,j*k,k=1,3),j=1,4)])
|
|
integer(8), parameter :: ac5s(*) = shape([((0,k=5,1,-2),j=9,2,-3)])
|
|
integer(8), parameter :: rss(*) = shape(reshape([(0,j=1,90)], -[2,3]*(-[5_8,3_8])))
|
|
contains
|
|
subroutine subr(x,n1,n2)
|
|
real, intent(in) :: x(:,:)
|
|
integer, intent(in) :: n1(3), n2(:)
|
|
real, allocatable :: a(:,:,:)
|
|
! the following fail if we don't handle empty strings
|
|
Character(0) :: ch1(1,2,3) = Reshape([('',n=1,1*2*3)],[1,2,3])
|
|
Character(0) :: ch2(3) = reshape(['','',''], [3])
|
|
a = reshape(x,n1)
|
|
a = reshape(x,n2(10:30:9)) ! fails if we can't figure out triplet shape
|
|
end subroutine
|
|
end module m1
|
|
!Expect: m1.mod
|
|
! module m1
|
|
! integer(8),parameter::a0s(1_8:*)=[INTEGER(8)::]
|
|
! intrinsic::shape
|
|
! real(4)::a1(1_8:5_8,1_8:5_8,1_8:5_8)
|
|
! integer(8),parameter::a1s(1_8:*)=[INTEGER(8)::5_8,5_8,5_8]
|
|
! integer(8),parameter::a1ss(1_8:*)=[INTEGER(8)::3_8]
|
|
! integer(8),parameter::a1sss(1_8:*)=[INTEGER(8)::1_8]
|
|
! integer(8),parameter::a1rs(1_8:*)=[INTEGER(8)::3_8,1_8,1_8,1_8]
|
|
! intrinsic::rank
|
|
! integer(8),parameter::a1n(1_8:*)=[INTEGER(8)::125_8,5_8,5_8]
|
|
! intrinsic::size
|
|
! integer(8),parameter::a1sn(1_8:*)=[INTEGER(8)::3_8,1_8,1_8]
|
|
! integer(8),parameter::ac1s(1_8:*)=[INTEGER(8)::1_8]
|
|
! integer(8),parameter::ac2s(1_8:*)=[INTEGER(8)::3_8]
|
|
! integer(8),parameter::ac3s(1_8:*)=[INTEGER(8)::4_8]
|
|
! integer(8),parameter::ac3bs(1_8:*)=[INTEGER(8)::4_8]
|
|
! integer(8),parameter::ac4s(1_8:*)=[INTEGER(8)::36_8]
|
|
! integer(8),parameter::ac5s(1_8:*)=[INTEGER(8)::9_8]
|
|
! integer(8),parameter::rss(1_8:*)=[INTEGER(8)::10_8,9_8]
|
|
! intrinsic::reshape
|
|
! contains
|
|
! subroutine subr(x,n1,n2)
|
|
! real(4),intent(in)::x(:,:)
|
|
! integer(4),intent(in)::n1(1_8:3_8)
|
|
! integer(4),intent(in)::n2(:)
|
|
! end
|
|
! end
|