Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/Frontend/verify2.c
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

40 lines
1.5 KiB
C

#if 0
// RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck %s
// Please note that all comments are inside "#if 0" blocks so that
// VerifyDiagnosticConsumer sees no comments while processing this
// test-case (and hence no expected-* directives).
#endif
#include "verify2.h"
#error source
#if 0
// expected-error {{should be ignored}}
// CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
// CHECK-NEXT: error: 'expected-error' diagnostics seen but not expected:
// CHECK-NEXT: Line 5: header
// CHECK-NEXT: Line 10: source
// CHECK-NEXT: 3 errors generated.
#endif
#ifdef CHECK2
// RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
// The following checks that -verify can match "any line" in an included file.
// The location of the diagnostic need therefore only match in the file, not to
// a specific line number. This is useful where -verify is used as a testing
// tool for 3rd-party libraries where headers may change and the specific line
// number of a diagnostic in a header is not important.
// expected-error@verify2.h:* {{header}}
// expected-error@verify2.h:* {{unknown}}
// CHECK2: error: 'expected-error' diagnostics expected but not seen:
// CHECK2-NEXT: File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:32): unknown
// CHECK2-NEXT: error: 'expected-error' diagnostics seen but not expected:
// CHECK2-NEXT: File {{.*}}verify2.c Line 10: source
// CHECK2-NEXT: 2 errors generated.
#endif