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).
66 lines
3.3 KiB
C
66 lines
3.3 KiB
C
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// Validate that volatile _Complex loads and stores are generated
|
|
// properly, including their alignment (even when overaligned).
|
|
//
|
|
// This test assumes that floats are 32-bit aligned and doubles are
|
|
// 64-bit aligned, and uses x86-64 as a target that should have this
|
|
// property.
|
|
|
|
volatile _Complex float cf;
|
|
volatile _Complex double cd;
|
|
volatile _Complex float cf32 __attribute__((aligned(32)));
|
|
volatile _Complex double cd32 __attribute__((aligned(32)));
|
|
|
|
// CHECK-LABEL: define{{.*}} void @test_cf()
|
|
void test_cf(void) {
|
|
// CHECK: load volatile float, ptr @cf, align 4
|
|
// CHECK-NEXT: load volatile float, ptr getelementptr inbounds nuw ({ float, float }, ptr @cf, i32 0, i32 1), align 4
|
|
(void)(cf);
|
|
// CHECK-NEXT: [[R:%.*]] = load volatile float, ptr @cf, align 4
|
|
// CHECK-NEXT: [[I:%.*]] = load volatile float, ptr getelementptr inbounds nuw ({ float, float }, ptr @cf, i32 0, i32 1), align 4
|
|
// CHECK-NEXT: store volatile float [[R]], ptr @cf, align 4
|
|
// CHECK-NEXT: store volatile float [[I]], ptr getelementptr inbounds nuw ({ float, float }, ptr @cf, i32 0, i32 1), align 4
|
|
(void)(cf=cf);
|
|
// CHECK-NEXT: ret void
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} void @test_cd()
|
|
void test_cd(void) {
|
|
// CHECK: load volatile double, ptr @cd, align 8
|
|
// CHECK-NEXT: load volatile double, ptr getelementptr inbounds nuw ({ double, double }, ptr @cd, i32 0, i32 1), align 8
|
|
(void)(cd);
|
|
// CHECK-NEXT: [[R:%.*]] = load volatile double, ptr @cd, align 8
|
|
// CHECK-NEXT: [[I:%.*]] = load volatile double, ptr getelementptr inbounds nuw ({ double, double }, ptr @cd, i32 0, i32 1), align 8
|
|
// CHECK-NEXT: store volatile double [[R]], ptr @cd, align 8
|
|
// CHECK-NEXT: store volatile double [[I]], ptr getelementptr inbounds nuw ({ double, double }, ptr @cd, i32 0, i32 1), align 8
|
|
(void)(cd=cd);
|
|
// CHECK-NEXT: ret void
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} void @test_cf32()
|
|
void test_cf32(void) {
|
|
// CHECK: load volatile float, ptr @cf32, align 32
|
|
// CHECK-NEXT: load volatile float, ptr getelementptr inbounds nuw ({ float, float }, ptr @cf32, i32 0, i32 1), align 4
|
|
(void)(cf32);
|
|
// CHECK-NEXT: [[R:%.*]] = load volatile float, ptr @cf32, align 32
|
|
// CHECK-NEXT: [[I:%.*]] = load volatile float, ptr getelementptr inbounds nuw ({ float, float }, ptr @cf32, i32 0, i32 1), align 4
|
|
// CHECK-NEXT: store volatile float [[R]], ptr @cf32, align 32
|
|
// CHECK-NEXT: store volatile float [[I]], ptr getelementptr inbounds nuw ({ float, float }, ptr @cf32, i32 0, i32 1), align 4
|
|
(void)(cf32=cf32);
|
|
// CHECK-NEXT: ret void
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} void @test_cd32()
|
|
void test_cd32(void) {
|
|
// CHECK: load volatile double, ptr @cd32, align 32
|
|
// CHECK-NEXT: load volatile double, ptr getelementptr inbounds nuw ({ double, double }, ptr @cd32, i32 0, i32 1), align 8
|
|
(void)(cd32);
|
|
// CHECK-NEXT: [[R:%.*]] = load volatile double, ptr @cd32, align 32
|
|
// CHECK-NEXT: [[I:%.*]] = load volatile double, ptr getelementptr inbounds nuw ({ double, double }, ptr @cd32, i32 0, i32 1), align 8
|
|
// CHECK-NEXT: store volatile double [[R]], ptr @cd32, align 32
|
|
// CHECK-NEXT: store volatile double [[I]], ptr getelementptr inbounds nuw ({ double, double }, ptr @cd32, i32 0, i32 1), align 8
|
|
(void)(cd32=cd32);
|
|
// CHECK-NEXT: ret void
|
|
}
|