xref: /aosp_15_r20/external/clang/test/Analysis/ObjCProperties.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -Wno-objc-root-class %s -verify
2*67e74705SXin Li// expected-no-diagnostics
3*67e74705SXin Li
4*67e74705SXin Li// The point of this test cases is to exercise properties in the static
5*67e74705SXin Li// analyzer
6*67e74705SXin Li
7*67e74705SXin Li@interface MyClass {
8*67e74705SXin Li@private
9*67e74705SXin Li    id _X;
10*67e74705SXin Li}
11*67e74705SXin Li- (id)initWithY:(id)Y;
12*67e74705SXin Li@property(copy, readwrite) id X;
13*67e74705SXin Li@end
14*67e74705SXin Li
15*67e74705SXin Li@implementation MyClass
16*67e74705SXin Li@synthesize X = _X;
17*67e74705SXin Li- (id)initWithY:(id)Y {
18*67e74705SXin Li  self.X = Y;
19*67e74705SXin Li  return self;
20*67e74705SXin Li}
21*67e74705SXin Li@end
22