Files
RedBear-OS/local/recipes/dev/libclc/source/flang/test/Semantics/modfile24.f90
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

76 lines
1.7 KiB
Fortran

! RUN: %python %S/test_modfile.py %s %flang_fc1
! Test declarations with coarray-spec
! Different ways of declaring the same coarray.
module m1
real :: a(1:5)[1:10,1:*]
real, dimension(5) :: b[1:10,1:*]
real, codimension[1:10,1:*] :: c(5)
real, codimension[1:10,1:*], dimension(5) :: d
codimension :: e[1:10,1:*]
dimension :: e(5)
real :: e
end
!Expect: m1.mod
!module m1
! real(4)::a(1_8:5_8)[1_8:10_8,1_8:*]
! real(4)::b(1_8:5_8)[1_8:10_8,1_8:*]
! real(4)::c(1_8:5_8)[1_8:10_8,1_8:*]
! real(4)::d(1_8:5_8)[1_8:10_8,1_8:*]
! real(4)::e(1_8:5_8)[1_8:10_8,1_8:*]
!end
! coarray-spec in codimension and target statements.
module m2
codimension :: a[10,*], b[*]
target :: c[10,*], d[*]
end
!Expect: m2.mod
!module m2
! real(4)::a[1_8:10_8,1_8:*]
! real(4)::b[1_8:*]
! real(4),target::c[1_8:10_8,1_8:*]
! real(4),target::d[1_8:*]
!end
! coarray-spec in components and with non-constants bounds
module m3
type t
real, allocatable :: c[:,:]
complex, allocatable, codimension[:,:] :: d
end type
real, allocatable :: e[:,:,:]
contains
subroutine s(a, b, n)
integer(8) :: n
real :: a[1:n,2:*]
real, codimension[1:n,2:*] :: b
end
end
!Expect: m3.mod
!module m3
! type::t
! real(4),allocatable::c[:,:]
! complex(4),allocatable::d[:,:]
! end type
! real(4),allocatable::e[:,:,:]
!contains
! subroutine s(a,b,n)
! integer(8)::n
! real(4)::a[1_8:n,2_8:*]
! real(4)::b[1_8:n,2_8:*]
! end
!end
! coarray-spec in both attributes and entity-decl
module m4
real, codimension[2:*], dimension(2:5) :: a, b(4,4), c[10,*], d(4,4)[10,*]
end
!Expect: m4.mod
!module m4
! real(4)::a(2_8:5_8)[2_8:*]
! real(4)::b(1_8:4_8,1_8:4_8)[2_8:*]
! real(4)::c(2_8:5_8)[1_8:10_8,1_8:*]
! real(4)::d(1_8:4_8,1_8:4_8)[1_8:10_8,1_8:*]
!end