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

37 lines
1.0 KiB
TableGen

// RUN: llvm-tblgen %s | FileCheck %s
// RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
// RUN: not llvm-tblgen -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s
// RUN: not llvm-tblgen -DERROR3 %s 2>&1 | FileCheck --check-prefix=ERROR3 %s
// RUN: not llvm-tblgen -DERROR4 %s 2>&1 | FileCheck --check-prefix=ERROR4 %s
// XFAIL: vg_leak
def test {
bit test0 = !match("123 abc ABC", "[0-9 a-z A-Z]+");
bit test1 = !match("abc", "[0-9]+");
}
// CHECK-LABEL: def test {
// CHECK-NEXT: bit test0 = 1;
// CHECK-NEXT: bit test1 = 0;
// CHECK-NEXT: }
#ifdef ERROR1
defvar error1 = !match(123, ".*");
// ERROR1: error: expected value of type 'string', got 'int'
#endif
#ifdef ERROR2
defvar error2 = !match("abc", 123);
// ERROR2: error: expected value of type 'string', got 'int'
#endif
#ifdef ERROR3
defvar error3 = !match("abc", "abc", "abc");
// ERROR3: error: expected two operands to operator
#endif
#ifdef ERROR4
defvar error4 = !match("abc", "([)]");
// ERROR4: error: invalid regex '([)]'
#endif