[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / Analysis / bugfix-124477.m
blob80820f4c934443db21125a90eac3c7baa20fb893
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,apiModeling,nullability.NullableDereferenced,nullability.NullabilityBase -x objective-c %s
2 /*
3   This test is reduced from a static analyzer crash. The bug causing
4   the crash is explained in #124477.  It can only be triggered in some
5   rare cases so please do not modify this reproducer.
6 */
8 #pragma clang assume_nonnull begin
9 # 15 "some-sys-header.h" 1 3
10 @class NSArray, NSObject;
12 @interface Base
13 @property (readonly, copy) NSArray *array;
14 @end
16 #pragma clang assume_nonnull end
17 # 8 "this-file.m" 2
20 @interface Test : Base
22 @property (readwrite, copy, nullable) NSObject *label;
23 @property (readwrite, strong, nullable) Test * field;
25 - (void)f;
27 @end
29 @implementation Test
30 - (void)f
32   NSObject * X;
34   for (NSObject *ele in self.field.array) {}
35   self.label = X;  
37 @end