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).
53 lines
1.6 KiB
C++
53 lines
1.6 KiB
C++
// RUN: %clang_cc1 -triple i386-unknown-unknown -fblocks -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// CHECK: %[[STRUCT_A:.*]] = type { i8 }
|
|
|
|
struct A
|
|
{
|
|
~A();
|
|
};
|
|
int foo(A);
|
|
|
|
void bar(A &a)
|
|
{
|
|
// CHECK: call void asm
|
|
asm("" : : "r"(foo(a)) );
|
|
// CHECK: call void @_ZN1AD1Ev
|
|
}
|
|
|
|
namespace TestTemplate {
|
|
// Check that the temporary is destructed after the first asm statement.
|
|
|
|
// CHECK: define {{.*}}void @_ZN12TestTemplate4foo0IvEEvR1A(
|
|
// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_A]],
|
|
// CHECK: %[[CALL:.*]] = call noundef i32 @_Z3foo1A({{.*}}%[[AGG_TMP]])
|
|
// CHECK: call void asm sideeffect "", "r,~{dirflag},~{fpsr},~{flags}"(i32 %[[CALL]])
|
|
// CHECK: call void @_ZN1AD1Ev({{.*}}%[[AGG_TMP]])
|
|
// CHECK: call void asm sideeffect "",
|
|
|
|
template <class T>
|
|
void foo0(A &a) {
|
|
asm("" : : "r"(foo(a)) );
|
|
asm("");
|
|
}
|
|
|
|
void test0(A &a) { foo0<void>(a); }
|
|
|
|
// Check that the block capture is destructed at the end of the enclosing scope.
|
|
|
|
// CHECK: define {{.*}}void @_ZN12TestTemplate4foo1IvEEv1A(
|
|
// CHECK: %[[BLOCK:.*]] = alloca <{ ptr, i32, i32, ptr, ptr, %[[STRUCT_A]] }>, align 4
|
|
// CHECK: %[[BLOCK_CAPTURED:.*]] = getelementptr inbounds nuw <{ ptr, i32, i32, ptr, ptr, %[[STRUCT_A]] }>, ptr %[[BLOCK]], i32 0, i32 5
|
|
// CHECK: call void asm sideeffect "", "r,~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}})
|
|
// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
|
|
// CHECK: call void @_ZN1AD1Ev({{.*}} %[[BLOCK_CAPTURED]])
|
|
|
|
template <class T>
|
|
void foo1(A a) {
|
|
asm("" : : "r"(^{ (void)a; return 0; }()));
|
|
asm("");
|
|
}
|
|
|
|
void test1(A &a) { foo1<void>(a); }
|
|
} // namespace TestTemplate
|