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).
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s
|
|
|
|
extern void foo_alias (void) __asm ("foo");
|
|
inline void foo (void) {
|
|
return foo_alias ();
|
|
}
|
|
extern int abs_alias (int) __asm ("abs");
|
|
inline __attribute__ ((__always_inline__)) int abs (int x) {
|
|
return abs_alias(x);
|
|
}
|
|
extern char *strrchr_foo (const char *__s, int __c) __asm ("strrchr");
|
|
extern inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr_foo (const char *__s, int __c) {
|
|
return __builtin_strrchr (__s, __c);
|
|
}
|
|
|
|
extern inline void __attribute__((always_inline, __gnu_inline__))
|
|
prefetch(void) {
|
|
__builtin_prefetch(0, 0, 1);
|
|
}
|
|
|
|
extern inline __attribute__((__always_inline__, __gnu_inline__)) void *memchr(void *__s, int __c, __SIZE_TYPE__ __n) {
|
|
return __builtin_memchr(__s, __c, __n);
|
|
}
|
|
|
|
void f(void) {
|
|
foo();
|
|
abs(0);
|
|
strrchr_foo("", '.');
|
|
prefetch();
|
|
memchr("", '.', 0);
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} void @f()
|
|
// CHECK: call void @foo()
|
|
// CHECK: call i32 @abs(i32 noundef %0)
|
|
// CHECK: call ptr @strrchr(
|
|
// CHECK: call void @llvm.prefetch.p0(
|
|
// CHECK: call ptr @memchr(
|
|
// CHECK: ret void
|
|
|
|
// CHECK: declare void @foo()
|
|
// CHECK: declare i32 @abs(i32
|
|
// CHECK: declare ptr @strrchr(ptr noundef, i32 noundef)
|
|
// CHECK: declare ptr @memchr(
|
|
// CHECK: declare void @llvm.prefetch.p0(
|