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).
45 lines
985 B
C
45 lines
985 B
C
/* Check that the result of a bitfield assignment is properly
|
|
truncated and does not generate a redundant load. */
|
|
|
|
/* Check that we get one load for each simple assign and two for the
|
|
compound assign (load the old value before the add then load again
|
|
to store back). Also check that our g0 pattern is good. */
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o %t %s
|
|
// RUN: grep 'load ' %t | count 5
|
|
// RUN: grep "@g0" %t | count 4
|
|
|
|
// Check that we got the right value.
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm -o %t %s
|
|
// RUN: not grep 'load ' %t
|
|
// RUN: not grep "@g0" %t
|
|
|
|
struct s0 {
|
|
int f0 : 2;
|
|
_Bool f1 : 1;
|
|
unsigned f2 : 2;
|
|
};
|
|
|
|
int g0(void);
|
|
|
|
void f0(void) {
|
|
struct s0 s;
|
|
if ((s.f0 = 3) != -1) g0();
|
|
}
|
|
|
|
void f1(void) {
|
|
struct s0 s;
|
|
if ((s.f1 = 3) != 1) g0();
|
|
}
|
|
|
|
void f2(void) {
|
|
struct s0 s;
|
|
if ((s.f2 = 3) != 3) g0();
|
|
}
|
|
|
|
void f3(void) {
|
|
struct s0 s;
|
|
// Just check this one for load counts.
|
|
s.f0 += 3;
|
|
}
|
|
|