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).
49 lines
1.6 KiB
C
49 lines
1.6 KiB
C
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=LINUX
|
|
// RUN: %clang_cc1 -triple x86_64-apple-macos -emit-llvm %s -o - | FileCheck %s --check-prefix=LINUX
|
|
// RUN: %clang_cc1 -triple x86_64-windows-pc -emit-llvm %s -o - | FileCheck %s --check-prefix=WINDOWS
|
|
int __attribute__((target("sse4.2"))) foo(int i) { return 0; }
|
|
int __attribute__((target("arch=sandybridge"))) foo(int);
|
|
int __attribute__((target("arch=ivybridge"))) foo(int i) {return 1;}
|
|
int __attribute__((target("default"))) foo(int i) { return 2; }
|
|
|
|
typedef int (*FuncPtr)(int);
|
|
void func(FuncPtr);
|
|
|
|
int bar(void) {
|
|
func(foo);
|
|
FuncPtr Free = &foo;
|
|
FuncPtr Free2 = foo;
|
|
|
|
return 0;
|
|
return Free(1) + Free(2);
|
|
}
|
|
|
|
// LINUX: @foo.ifunc = weak_odr ifunc i32 (i32), ptr @foo.resolver
|
|
// LINUX: define{{.*}} i32 @foo.sse4.2(
|
|
// LINUX: ret i32 0
|
|
// LINUX: define{{.*}} i32 @foo.arch_ivybridge(
|
|
// LINUX: ret i32 1
|
|
// LINUX: define{{.*}} i32 @foo(
|
|
// LINUX: ret i32 2
|
|
|
|
// WINDOWS: define dso_local i32 @foo.sse4.2(
|
|
// WINDOWS: ret i32 0
|
|
// WINDOWS: define dso_local i32 @foo.arch_ivybridge(
|
|
// WINDOWS: ret i32 1
|
|
// WINDOWS: define dso_local i32 @foo(
|
|
// WINDOWS: ret i32 2
|
|
|
|
// LINUX: define{{.*}} i32 @bar()
|
|
// LINUX: call void @func(ptr noundef @foo.ifunc)
|
|
// LINUX: store ptr @foo.ifunc
|
|
// LINUX: store ptr @foo.ifunc
|
|
|
|
// WINDOWS: define dso_local i32 @bar()
|
|
// WINDOWS: call void @func(ptr noundef @foo.resolver)
|
|
// WINDOWS: store ptr @foo.resolver
|
|
// WINDOWS: store ptr @foo.resolver
|
|
|
|
// LINUX: declare i32 @foo.arch_sandybridge(
|
|
|
|
// WINDOWS: declare dso_local i32 @foo.arch_sandybridge(
|