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).
106 lines
3.0 KiB
TableGen
106 lines
3.0 KiB
TableGen
// RUN: llvm-tblgen %s -o - 2>&1 >/dev/null | FileCheck %s -DFILE=%s
|
|
|
|
// CHECK: [[FILE]]:[[@LINE+1]]:1: note: Debug message
|
|
dump "Debug message";
|
|
|
|
def op;
|
|
class A {
|
|
string A = "some text";
|
|
dag X =(op op);
|
|
}
|
|
def a : A;
|
|
// CHECK: [[FILE]]:[[@LINE+5]]:1: note: The Value of A is:
|
|
// CHECK-NEXT: a { // A
|
|
// CHECK-NEXT: string A = "some text";
|
|
// CHECK-NEXT: dag X = (op op);
|
|
// CHECK-NEXT: }
|
|
dump "The Value of A is: \n" # !repr(a);
|
|
|
|
def b : A;
|
|
// CHECK: [[FILE]]:[[@LINE+4]]:1: note: b { // A
|
|
// CHECK-NEXT: string A = "some text";
|
|
// CHECK-NEXT: dag X = (op op);
|
|
// CHECK-NEXT: }
|
|
dump b;
|
|
|
|
defvar value_A = "some other text";
|
|
// CHECK: [[FILE]]:[[@LINE+1]]:1: note: some other text
|
|
dump value_A;
|
|
|
|
defvar value_B = 12;
|
|
def X;
|
|
// CHECK: [[FILE]]:[[@LINE+3]]:1: note: got a pair of values ["some other text" : 12], and an empty record:
|
|
// CHECK-NEXT: X {
|
|
// CHECK-NEXT: }
|
|
dump "got a pair of values [" # !repr(value_A) # " : " # !repr(value_B) # "], " # "and an empty record:\n" # !repr(X);
|
|
|
|
multiclass MC<dag s> {
|
|
// CHECK: [[FILE]]:[[@LINE+1]]:3: note: s = (op a)
|
|
dump "s = " # !repr(s);
|
|
// CHECK: [[FILE]]:[[@LINE+4]]:3: note: args[0] = a { // A
|
|
// CHECK-NEXT: string A = "some text";
|
|
// CHECK-NEXT: dag X = (op op);
|
|
// CHECK-NEXT: }
|
|
dump "args[0] = " # !repr(!getdagarg<A>(s,0));
|
|
def A;
|
|
}
|
|
defm X : MC<(op a)>;
|
|
|
|
multiclass MMC<dag s> {
|
|
// CHECK: [[FILE]]:[[@LINE+1]]:3: note: the operand of s is op
|
|
dump "the operand of s is " # !getdagop(s);
|
|
// CHECK: [[FILE]]:[[@LINE-13]]:3: note: s = (op a, a)
|
|
// CHECK: [[FILE]]:[[@LINE-9]]:3: note: args[0] = a { // A
|
|
// CHECK-NEXT: string A = "some text";
|
|
// CHECK-NEXT: dag X = (op op);
|
|
// CHECK-NEXT: }
|
|
defm : MC<s>;
|
|
}
|
|
|
|
defm XX : MMC<(op a, a)>;
|
|
|
|
|
|
foreach i = [-1, 2] in {
|
|
// CHECK: [[FILE]]:[[@LINE+4]]:3: note: i = -1 (negative)
|
|
// CHECK: [[FILE]]:[[@LINE+8]]:5: note: i + 1 <= 0
|
|
// CHECK: [[FILE]]:[[@LINE+2]]:3: note: i = 2 (positive)
|
|
// CHECK: [[FILE]]:[[@LINE+4]]:5: note: i + 1 > 0 (i + 1 = 3)
|
|
dump "i = " # !repr(i) # !if(!ge(i,0), " (positive)", " (negative)");
|
|
defvar ip1 = !add(i, 1);
|
|
if !gt(ip1,0) then {
|
|
dump "i + 1 > 0 (i + 1 = " # !repr(ip1) # ")";
|
|
} else {
|
|
dump "i + 1 <= 0" ;
|
|
}
|
|
}
|
|
|
|
class Code<code val> {
|
|
dump "val = " # !repr(val);
|
|
code Val = val;
|
|
int number = 0;
|
|
}
|
|
// CHECK: [[FILE]]:[[@LINE-4]]:3: note: val = [{a = a +1;}]
|
|
def IncrementA : Code<[{a = a +1;}]>;
|
|
class InheritFromCode : Code<[{f(x);}]>{
|
|
let number = 33;
|
|
dump "number = " # !repr(number);
|
|
}
|
|
// CHECK: [[FILE]]:[[@LINE-10]]:3: note: val = [{f(x);}]
|
|
// CHECK: [[FILE]]:[[@LINE-3]]:3: note: number = 33
|
|
def ModeCode : InheritFromCode;
|
|
|
|
|
|
class BaseClassForSet;
|
|
multiclass DefineSubSet {
|
|
def _One : BaseClassForSet;
|
|
def _Two : BaseClassForSet;
|
|
}
|
|
defset list<BaseClassForSet> TheSet = {
|
|
defm Subset: DefineSubSet;
|
|
def Three : BaseClassForSet;
|
|
}
|
|
// CHECK: [[FILE]]:[[@LINE+1]]:1: note: TheSet = [Subset_One, Subset_Two, Three]
|
|
dump "TheSet = " # !repr(TheSet);
|
|
|
|
// CHECK: [[FILE]]:[[@LINE+1]]:1: note: 0
|
|
dump !repr(!exists<BaseClassForSet>("non-existent-record")); |