Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/Analysis/ObjCProperties.m
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

54 lines
1.2 KiB
Objective-C

// RUN: %clang_analyze_cc1 -w -Wno-int-conversion %s -verify \
// RUN: -analyzer-checker=core,alpha.core,debug.ExprInspection
#ifdef HEADER // A clever trick to avoid splitting up the test.
extern void clang_analyzer_eval(int);
@interface NSObject
@end
@interface HeaderClass : NSObject
@property NSObject *prop;
@end
#else
#define HEADER
#include "ObjCProperties.m"
@implementation HeaderClass
- (void)foo {
if ((self.prop)) {
}
// This test tests that no dynamic bifurcation is performed on the property.
// The TRUE/FALSE dilemma correctly arises from eagerly-assume behavior
// inside the if-statement. The dynamic bifurcation at (self.prop) inside
// the if-statement was causing an UNKNOWN to show up as well due to
// extra parentheses being caught inside PseudoObjectExpr.
// This should not be UNKNOWN.
clang_analyzer_eval(self.prop); // expected-warning{{TRUE}}
// expected-warning@-1{{FALSE}}
}
@end
// The point of this test cases is to exercise properties in the static
// analyzer
@interface MyClass {
@private
id _X;
}
- (id)initWithY:(id)Y;
@property(copy, readwrite) id X;
@end
@implementation MyClass
@synthesize X = _X;
- (id)initWithY:(id)Y {
self.X = Y;
return self;
}
@end
#endif