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).
34 lines
874 B
C++
34 lines
874 B
C++
include "llvm/Target/Target.td"
|
|
|
|
def TestTarget : Target;
|
|
|
|
class Encoding : Instruction {
|
|
field bits<8> Inst;
|
|
}
|
|
|
|
class TestReg<string name, bits<1> enc> : Register<name, []> {
|
|
let HWEncoding{15-1} = 0;
|
|
let HWEncoding{0} = enc;
|
|
}
|
|
|
|
def R0 : TestReg<"R0", 0>;
|
|
def R1 : TestReg<"R1", 1>;
|
|
def Reg : RegisterClass<"TestTarget", [i32], 32, (sequence "R%d", 0, 1)>;
|
|
|
|
class TestInstructionWithConstraints<string cstr> : Encoding {
|
|
dag OutOperandList = (outs Reg:$dest1, Reg:$dest2);
|
|
dag InOperandList = (ins Reg:$src1, Reg:$src2);
|
|
string AsmString = "mnemonic $dest1, $dest2, $src1, $src2";
|
|
string AsmVariantName = "";
|
|
let Constraints = cstr;
|
|
field bits<1> dest1;
|
|
field bits<1> dest2;
|
|
field bits<1> src1;
|
|
field bits<1> src2;
|
|
let Inst{7-4} = 0b1010;
|
|
let Inst{3} = dest1{0};
|
|
let Inst{2} = dest2{0};
|
|
let Inst{1} = src1{0};
|
|
let Inst{0} = src2{0};
|
|
}
|