Files
RedBear-OS/local/recipes/dev/libclc/source/flang/test/Semantics/resolve88.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
3.0 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! C746, C747, and C748
module m
use ISO_FORTRAN_ENV
use ISO_C_BINDING
! C746 If a coarray-spec appears, it shall be a deferred-coshape-spec-list and
! the component shall have the ALLOCATABLE attribute.
type testCoArrayType
real, allocatable, codimension[:] :: allocatableField
!ERROR: Component 'deferredfield' is a coarray and must have the ALLOCATABLE attribute
real, codimension[:] :: deferredField
!ERROR: Component 'pointerfield' is a coarray and must have the ALLOCATABLE attribute
!ERROR: 'pointerfield' may not have the POINTER attribute because it is a coarray
real, pointer, codimension[:] :: pointerField
!ERROR: Component 'realfield' is a coarray and must have the ALLOCATABLE attribute and have a deferred coshape
real, codimension[*] :: realField
!ERROR: 'realfield2' is an ALLOCATABLE coarray and must have a deferred coshape
real, allocatable, codimension[*] :: realField2
end type testCoArrayType
! C747 If a coarray-spec appears, the component shall not be of type C_PTR or
! C_FUNPTR from the intrinsic module ISO_C_BINDING (18.2), or of type
! TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV (16.10.2).
type goodCoarrayType
real, allocatable, codimension[:] :: field
end type goodCoarrayType
type goodTeam_typeCoarrayType
type(team_type), allocatable :: field
end type goodTeam_typeCoarrayType
type goodC_ptrCoarrayType
type(c_ptr), allocatable :: field
end type goodC_ptrCoarrayType
type goodC_funptrCoarrayType
type(c_funptr), allocatable :: field
end type goodC_funptrCoarrayType
type team_typeCoarrayType
!ERROR: Coarray 'field' may not have type TEAM_TYPE, C_PTR, or C_FUNPTR
type(team_type), allocatable, codimension[:] :: field
end type team_typeCoarrayType
type c_ptrCoarrayType
!ERROR: Coarray 'field' may not have type TEAM_TYPE, C_PTR, or C_FUNPTR
type(c_ptr), allocatable, codimension[:] :: field
end type c_ptrCoarrayType
type c_funptrCoarrayType
!ERROR: Coarray 'field' may not have type TEAM_TYPE, C_PTR, or C_FUNPTR
type(c_funptr), allocatable, codimension[:] :: field
end type c_funptrCoarrayType
! C748 A data component whose type has a coarray ultimate component shall be a
! nonpointer nonallocatable scalar and shall not be a coarray.
type coarrayType
real, allocatable, codimension[:] :: goodCoarrayField
end type coarrayType
type testType
type(coarrayType) :: goodField
!ERROR: Pointer 'pointerfield' may not have a coarray potential component '%goodcoarrayfield'
type(coarrayType), pointer :: pointerField
!ERROR: Allocatable or array component 'allocatablefield' may not have a coarray ultimate component '%goodcoarrayfield'
type(coarrayType), allocatable :: allocatableField
!ERROR: Allocatable or array component 'arrayfield' may not have a coarray ultimate component '%goodcoarrayfield'
type(coarrayType), dimension(3) :: arrayField
end type testType
end module m