[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / SemaObjC / class-property-inheritance.m
blob9d8a4fe440530afa96974f5348d29aedcd83027d
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @class MyObject;
6 @interface TopClassWithClassProperty0
7 @property(nullable, readonly, strong, class) MyObject *foo;
8 @end
10 @interface SubClassWithClassProperty0 : TopClassWithClassProperty0
11 @property(nonnull, readonly, copy, class) MyObject *foo; // expected-warning {{'copy' attribute on property 'foo' does not match the property inherited from 'TopClassWithClassProperty0'}}
12 @end
16 @interface TopClassWithInstanceProperty1
17 @property(nullable, readonly, strong) MyObject *foo;
18 @end
20 @interface ClassWithClassProperty1 : TopClassWithInstanceProperty1
21 @property(nonnull, readonly, copy, class) MyObject *foo; // no-warning
22 @end
24 @interface SubClassWithInstanceProperty1 : ClassWithClassProperty1
25 @property(nullable, readonly, copy) MyObject *foo; // expected-warning {{'copy' attribute on property 'foo' does not match the property inherited from 'TopClassWithInstanceProperty1'}}
26 @end
29 @interface TopClassWithClassProperty2
30 @property(nullable, readonly, strong, class) MyObject *foo;
31 @end
33 @interface ClassWithInstanceProperty2 : TopClassWithClassProperty2
34 @property(nonnull, readonly, copy) MyObject *foo; // no-warning
35 @end
37 @interface SubClassWithClassProperty2 : ClassWithInstanceProperty2
38 @property(nonnull, readonly, copy, class) MyObject *foo; // expected-warning {{'copy' attribute on property 'foo' does not match the property inherited from 'TopClassWithClassProperty2'}}
39 @end