Files
RedBear-OS/local/recipes/dev/libclc/source/llvm/test/TableGen/directive3.td
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

43 lines
1.2 KiB
TableGen

// RUN: not llvm-tblgen -gen-directive-decl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s
// RUN: not llvm-tblgen -gen-directive-impl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s
include "llvm/Frontend/Directive/DirectiveBase.td"
def TestDirectiveLanguage : DirectiveLanguage {
let name = "TdlError";
}
def TDLC_ClauseA : Clause<[Spelling<"clausea">]> {
let isDefault = 1;
}
def TDLC_ClauseB : Clause<[Spelling<"clauseb">]> {
}
def TDLC_ClauseC : Clause<[Spelling<"clausec">]> {
}
def TDLC_ClauseD : Clause<[Spelling<"claused">]> {
}
def TDL_DirA : Directive<[Spelling<"dira">]> {
let allowedClauses = [
VersionedClause<TDLC_ClauseA>,
VersionedClause<TDLC_ClauseB>,
VersionedClause<TDLC_ClauseD>
];
let allowedOnceClauses = [
VersionedClause<TDLC_ClauseA>,
VersionedClause<TDLC_ClauseC>
];
let requiredClauses = [
VersionedClause<TDLC_ClauseC>,
VersionedClause<TDLC_ClauseD>
];
let isDefault = 1;
}
// CHECK: error: Clause TDLC_ClauseA already defined on directive TDL_DirA
// CHECK: error: Clause TDLC_ClauseD already defined on directive TDL_DirA
// CHECK: error: One or more clauses are defined multiple times on directive TDL_DirA