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).
115 lines
2.9 KiB
C
115 lines
2.9 KiB
C
// RUN: %clang_cc1 -triple armv7-eabi -emit-llvm %s -o - | \
|
|
// RUN: FileCheck %s --check-prefixes=CHECK,CHECK-SOFT
|
|
// RUN: %clang_cc1 -triple armv7-eabi -target-abi aapcs -mfloat-abi hard -emit-llvm %s -o - | \
|
|
// RUN: FileCheck %s --check-prefixes=CHECK,CHECK-HARD
|
|
// REQUIRES: arm-registered-target
|
|
|
|
// CHECK: %struct.S0 = type { [4 x float] }
|
|
// CHECK: %struct.S1 = type { [2 x float] }
|
|
// CHECK: %struct.S2 = type { [4 x float] }
|
|
// CHECK: %struct.D0 = type { [2 x double] }
|
|
// CHECK: %struct.D1 = type { [2 x double] }
|
|
// CHECK: %struct.D2 = type { [4 x double] }
|
|
|
|
typedef struct {
|
|
float v[4];
|
|
} S0;
|
|
|
|
float f0(S0 s) {
|
|
// CHECK-SOFT: define{{.*}} float @f0([4 x i32] %s.coerce)
|
|
// CHECK-HARD: define{{.*}} arm_aapcs_vfpcc float @f0(%struct.S0 %s.coerce)
|
|
return s.v[0];
|
|
}
|
|
|
|
float f0call() {
|
|
S0 s = {0.0f, };
|
|
return f0(s);
|
|
// CHECK-SOFT: call float @f0([4 x i32]
|
|
// CHECK-HARD: call arm_aapcs_vfpcc float @f0(%struct.S0
|
|
}
|
|
|
|
typedef struct {
|
|
__attribute__((aligned(8))) float v[2];
|
|
} S1;
|
|
|
|
float f1(S1 s) {
|
|
// CHECK-SOFT: define{{.*}} float @f1([1 x i64]
|
|
// CHECK-HARD: define{{.*}} arm_aapcs_vfpcc float @f1(%struct.S1 alignstack(8)
|
|
return s.v[0];
|
|
}
|
|
|
|
float f1call() {
|
|
S1 s = {0.0f, };
|
|
return f1(s);
|
|
// CHECK-SOFT: call float @f1([1 x i64
|
|
// CHECK-HARD: call arm_aapcs_vfpcc float @f1(%struct.S1 alignstack(8)
|
|
}
|
|
|
|
typedef struct {
|
|
__attribute__((aligned(16))) float v[4];
|
|
} S2;
|
|
|
|
float f2(S2 s) {
|
|
// CHECK-SOFT: define{{.*}} float @f2([2 x i64]
|
|
// CHECK-HARD: define{{.*}} arm_aapcs_vfpcc float @f2(%struct.S2 alignstack(8)
|
|
return s.v[0];
|
|
}
|
|
|
|
float f2call() {
|
|
S2 s = {0.0f, };
|
|
return f2(s);
|
|
// CHECK-SOFT: call float @f2([2 x i64]
|
|
// CHECK-HARD: call arm_aapcs_vfpcc float @f2(%struct.S2 alignstack(8)
|
|
}
|
|
|
|
typedef struct {
|
|
double v[2];
|
|
} D0;
|
|
|
|
double g0(D0 d) {
|
|
// CHECK-SOFT: define{{.*}} double @g0([2 x i64]
|
|
// CHECK-HARD: define{{.*}} arm_aapcs_vfpcc double @g0(%struct.D0 %d.coerce
|
|
return d.v[0];
|
|
}
|
|
|
|
double g0call() {
|
|
D0 d = {0.0, };
|
|
return g0(d);
|
|
// CHECK-SOFT: call double @g0([2 x i64]
|
|
// CHECK-HARD: call arm_aapcs_vfpcc double @g0(%struct.D0 %0
|
|
}
|
|
|
|
typedef struct {
|
|
__attribute__((aligned(16))) double v[2];
|
|
} D1;
|
|
|
|
double g1(D1 d) {
|
|
// CHECK-SOFT: define{{.*}} double @g1([2 x i64]
|
|
// CHECK-HARD: define{{.*}} arm_aapcs_vfpcc double @g1(%struct.D1 alignstack(8)
|
|
return d.v[0];
|
|
}
|
|
|
|
double g1call() {
|
|
D1 d = {0.0, };
|
|
return g1(d);
|
|
// CHECK-SOFT: call double @g1([2 x i64]
|
|
// CHECK-HARD: call arm_aapcs_vfpcc double @g1(%struct.D1 alignstack(8)
|
|
}
|
|
|
|
typedef struct {
|
|
__attribute__((aligned(32))) double v[4];
|
|
} D2;
|
|
|
|
double g2(D2 d) {
|
|
// CHECK-SOFT: define{{.*}} double @g2([4 x i64]
|
|
// CHECK-HARD: define{{.*}} arm_aapcs_vfpcc double @g2(%struct.D2 alignstack(8)
|
|
return d.v[0];
|
|
}
|
|
|
|
double g2call() {
|
|
D2 d = {0.0, };
|
|
return g2(d);
|
|
// CHECK-SOFT: call double @g2([4 x i64]
|
|
// CHECK-HARD: call arm_aapcs_vfpcc double @g2(%struct.D2 alignstack(8)
|
|
}
|