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).
43 lines
1.7 KiB
C
43 lines
1.7 KiB
C
// RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// CHECK: define{{.*}} float @fabsf(float noundef %a)
|
|
// CHECK: %{{.*}} = call float asm sideeffect "fabss $1, $0;", "=e,f"(float %{{.*}})
|
|
float fabsf(float a) {
|
|
float res;
|
|
__asm __volatile__("fabss %1, %0;"
|
|
: /* reg out*/ "=e"(res)
|
|
: /* reg in */ "f"(a));
|
|
return res;
|
|
}
|
|
|
|
void test_gcc_registers(void) {
|
|
register unsigned int regO6 asm("o6") = 0;
|
|
register unsigned int regSP asm("sp") = 1;
|
|
register unsigned int reg14 asm("r14") = 2;
|
|
register unsigned int regI6 asm("i6") = 3;
|
|
register unsigned int regFP asm("fp") = 4;
|
|
register unsigned int reg30 asm("r30") = 5;
|
|
|
|
register float fF20 asm("f20") = 8.0;
|
|
register double dF20 asm("f20") = 11.0;
|
|
register long double qF20 asm("f20") = 14.0;
|
|
|
|
// Test remapping register names in register ... asm("rN") statments.
|
|
|
|
// CHECK: call void asm sideeffect "add $0,$1,$2", "{r14},{r14},{r14}"
|
|
asm volatile("add %0,%1,%2" : : "r" (regO6), "r" (regSP), "r" (reg14));
|
|
|
|
// CHECK: call void asm sideeffect "add $0,$1,$2", "{r30},{r30},{r30}"
|
|
asm volatile("add %0,%1,%2" : : "r" (regI6), "r" (regFP), "r" (reg30));
|
|
|
|
// CHECK: call void asm sideeffect "fadds $0,$1,$2", "{f20},{f20},{f20}"
|
|
asm volatile("fadds %0,%1,%2" : : "f" (fF20), "f" (fF20), "f"(fF20));
|
|
|
|
// CHECK: call void asm sideeffect "faddd $0,$1,$2", "{f20},{f20},{f20}"
|
|
asm volatile("faddd %0,%1,%2" : : "f" (dF20), "f" (dF20), "f"(dF20));
|
|
|
|
// CHECK: call void asm sideeffect "faddq $0,$1,$2", "{f20},{f20},{f20}"
|
|
asm volatile("faddq %0,%1,%2" : : "f" (qF20), "f" (qF20), "f"(qF20));
|
|
|
|
}
|