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).
36 lines
1.6 KiB
FortranFixed
36 lines
1.6 KiB
FortranFixed
program main
|
|
print *, __FILE__, __LINE__
|
|
end
|
|
|
|
! This test verifies that `flang`'s `-x` options behave like `gfortran`'s.
|
|
! Specifically:
|
|
! - `-x f95` should process the file based on its extension unless overridden.
|
|
! - `-x f95-cpp-input` should behave like `-x f95` but with preprocessing
|
|
! (`-cpp`) enabled unless overridden.
|
|
|
|
! ---
|
|
! Ensure the file is treated as fixed-form unless explicitly set otherwise
|
|
! ---
|
|
! RUN: not %flang -Werror -fsyntax-only -x f95 -cpp %s 2>&1 | FileCheck --check-prefix=SCAN-ERROR %s
|
|
! RUN: not %flang -Werror -fsyntax-only -x f95-cpp-input %s 2>&1 | FileCheck --check-prefix=SCAN-ERROR %s
|
|
|
|
! SCAN-ERROR: error: Could not scan
|
|
|
|
! RUN: %flang -Werror -fsyntax-only -x f95 -cpp -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SCAN-ERROR --allow-empty %s
|
|
! RUN: %flang -Werror -fsyntax-only -x f95-cpp-input -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SCAN-ERROR --allow-empty %s
|
|
|
|
! NO-SCAN-ERROR-NOT: error
|
|
|
|
! ---
|
|
! Ensure `-cpp` is not enabled by default unless explicitly requested
|
|
! ---
|
|
! RUN: not %flang -Werror -fsyntax-only -x f95 -ffree-form %s 2>&1 | FileCheck --check-prefix=SEMA-ERROR %s
|
|
! RUN: not %flang -Werror -fsyntax-only -x f95-cpp-input -nocpp -ffree-form %s 2>&1 | FileCheck --check-prefix=SEMA-ERROR %s
|
|
|
|
! SEMA-ERROR: error: Semantic errors
|
|
|
|
! RUN: %flang -Werror -fsyntax-only -x f95 -cpp -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SEMA-ERROR --allow-empty %s
|
|
! RUN: %flang -Werror -fsyntax-only -x f95-cpp-input -ffree-form %s 2>&1 | FileCheck --check-prefix=NO-SEMA-ERROR --allow-empty %s
|
|
|
|
! NO-SEMA-ERROR-NOT: error
|