Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/CodeGenObjCXX/mangle-blocks.mm
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
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).
2026-08-01 05:13:02 +03:00

89 lines
2.0 KiB
Plaintext

// RUN: %clang_cc1 -emit-llvm -fblocks -o - -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s | FileCheck %s
// CHECK-DAG: @_ZZZN26externally_visible_statics1S3fooEiEd_Ub_E1k = linkonce_odr global i32 0
// CHECK-DAG: @_ZZZN26externally_visible_statics10inlinefuncEvEUb_E1i = linkonce_odr global i32 0
// CHECK-DAG: @_ZZZN26externally_visible_statics10inlinefuncEvEUb0_E1j = linkonce_odr global i32 0
// CHECK-DAG: @_ZZ26externally_visible_statics1S1xMUb_E1j = linkonce_odr global i32 0
int f();
void foo() {
// CHECK-LABEL: define internal noundef i32 @___Z3foov_block_invoke
// CHECK: call i32 @__cxa_guard_acquire(ptr @_ZGVZZ3foovEUb_E5value
(void)^(int x) {
static int value = f();
return x + value;
};
}
// CHECK-LABEL: define internal noundef i32 @i_block_invoke
int i = ^(int x) { return x;}(i);
@interface A
- (void)method;
@end
@implementation A
- (void)method {
// CHECK: define internal noundef signext i8 @"__11-[A method]_block_invoke"
(void)^(int x) {
// CHECK: @"_ZZZ11-[A method]EUb1_E4name"
static const char *name = "hello";
return name[x];
};
}
@end
void foo(int) {
(void)^(int x) {
static const char *name = "hello";
return name[x];
};
}
namespace N {
// CHECK-LABEL: define internal noundef signext i8 @___Z3fooi_block_invoke
void bar() {
(void)^(int x) {
// CHECK: @_ZZZN1N3barEvEUb3_E4name
static const char *name = "hello";
return name[x];
};
}
}
class C {
C();
};
C::C() {
(void)^(int x) {
// CHECK: @_ZZZN1CC1EvEUb4_E5nameb
static const char *nameb = "hello";
return nameb[x];
};
}
int f();
namespace externally_visible_statics {
inline void inlinefunc() {
^{
static int i = f();
}();
^{
static int j = f();
}();
}
struct S {
int x = ^{
static int j = f();
return j;
}();
void foo(int y = ^{ static int k = f(); return k; }()) {}
};
void g() {
inlinefunc();
S s;
s.foo();
}
}