brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · db45c94 Raw
76 lines · plain
1! RUN: %python %S/test_modfile.py %s %flang_fc12! Test declarations with coarray-spec3 4! Different ways of declaring the same coarray.5module m16  real :: a(1:5)[1:10,1:*]7  real, dimension(5) :: b[1:10,1:*]8  real, codimension[1:10,1:*] :: c(5)9  real, codimension[1:10,1:*], dimension(5) :: d10  codimension :: e[1:10,1:*]11  dimension :: e(5)12  real :: e13end14!Expect: m1.mod15!module m116! real(4)::a(1_8:5_8)[1_8:10_8,1_8:*]17! real(4)::b(1_8:5_8)[1_8:10_8,1_8:*]18! real(4)::c(1_8:5_8)[1_8:10_8,1_8:*]19! real(4)::d(1_8:5_8)[1_8:10_8,1_8:*]20! real(4)::e(1_8:5_8)[1_8:10_8,1_8:*]21!end22 23! coarray-spec in codimension and target statements.24module m225  codimension :: a[10,*], b[*]26  target :: c[10,*], d[*]27end28!Expect: m2.mod29!module m230! real(4)::a[1_8:10_8,1_8:*]31! real(4)::b[1_8:*]32! real(4),target::c[1_8:10_8,1_8:*]33! real(4),target::d[1_8:*]34!end35 36! coarray-spec in components and with non-constants bounds37module m338  type t39    real, allocatable :: c[:,:]40    complex, allocatable, codimension[:,:] :: d41  end type42  real, allocatable :: e[:,:,:]43contains44  subroutine s(a, b, n)45    integer(8) :: n46    real :: a[1:n,2:*]47    real, codimension[1:n,2:*] :: b48  end49end50!Expect: m3.mod51!module m352! type::t53!  real(4),allocatable::c[:,:]54!  complex(4),allocatable::d[:,:]55! end type56! real(4),allocatable::e[:,:,:]57!contains58! subroutine s(a,b,n)59!  integer(8)::n60!  real(4)::a[1_8:n,2_8:*]61!  real(4)::b[1_8:n,2_8:*]62! end63!end64 65! coarray-spec in both attributes and entity-decl66module m467  real, codimension[2:*], dimension(2:5) :: a, b(4,4), c[10,*], d(4,4)[10,*]68end69!Expect: m4.mod70!module m471! real(4)::a(2_8:5_8)[2_8:*]72! real(4)::b(1_8:4_8,1_8:4_8)[2_8:*]73! real(4)::c(2_8:5_8)[1_8:10_8,1_8:*]74! real(4)::d(1_8:4_8,1_8:4_8)[1_8:10_8,1_8:*]75!end76