cb424d7448
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).
67 lines
2.0 KiB
Fortran
67 lines
2.0 KiB
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Test 8.5.10 & 8.5.18 constraints on dummy argument declarations
|
|
|
|
module m
|
|
|
|
type :: hasCoarray
|
|
real, allocatable :: a(:)[:]
|
|
end type
|
|
type, extends(hasCoarray) :: extendsHasCoarray
|
|
end type
|
|
type :: hasCoarray2
|
|
type(hasCoarray) :: x
|
|
end type
|
|
type, extends(hasCoarray2) :: extendsHasCoarray2
|
|
end type
|
|
|
|
real, allocatable :: coarray(:)[:]
|
|
|
|
contains
|
|
|
|
subroutine s01a(x)
|
|
real, allocatable, intent(out) :: x(:)
|
|
end subroutine
|
|
subroutine s01c(x)
|
|
real, intent(out) :: x(:)
|
|
end subroutine
|
|
subroutine s01b ! C846 - can only be caught at a call via explicit interface
|
|
!ERROR: ALLOCATABLE coarray 'coarray' may not be associated with INTENT(OUT) dummy argument 'x='
|
|
!ERROR: ALLOCATABLE dummy argument 'x=' is not a coarray but actual argument has corank 1
|
|
call s01a(coarray)
|
|
call s01c(coarray) ! ok, dummy is not allocatable
|
|
end subroutine
|
|
|
|
subroutine s02(x) ! C846
|
|
!ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
|
|
type(hasCoarray), intent(out) :: x
|
|
end subroutine
|
|
|
|
subroutine s03(x) ! C846
|
|
!ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
|
|
type(extendsHasCoarray), intent(out) :: x
|
|
end subroutine
|
|
|
|
subroutine s04(x) ! C846
|
|
!ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
|
|
type(hasCoarray2), intent(out) :: x
|
|
end subroutine
|
|
|
|
subroutine s05(x) ! C846
|
|
!ERROR: An INTENT(OUT) dummy argument may not be, or contain, an ALLOCATABLE coarray
|
|
type(extendsHasCoarray2), intent(out) :: x
|
|
end subroutine
|
|
|
|
end module
|
|
|
|
subroutine s06(x) ! C847
|
|
use ISO_FORTRAN_ENV, only: lock_type
|
|
!ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE
|
|
type(lock_type), intent(out) :: x[*]
|
|
end subroutine
|
|
|
|
subroutine s07(x) ! C847
|
|
use ISO_FORTRAN_ENV, only: event_type
|
|
!ERROR: An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE
|
|
type(event_type), intent(out) :: x[*]
|
|
end subroutine
|