Files
TheRock/compiler/amd-llvm/clang/test/SemaObjC/category-direct-properties.m
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

274 lines
11 KiB
Objective-C

// RUN: %clang_cc1 -fsyntax-only -verify -Wselector-type-mismatch %s
__attribute__((objc_root_class))
@interface Inteface_Implementation
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal;
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct;
@end
@implementation Inteface_Implementation
- (int)normal_normal {
return 42;
}
- (int)direct_normal {
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method implementation was previously declared not direct}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) {
return 42;
}
@end
__attribute__((objc_root_class))
@interface Inteface_Extension
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal;
@property(nonatomic, readonly) int normal_direct;
@property(nonatomic, readonly, direct) int direct_direct;
@end
@interface Inteface_Extension ()
@property(nonatomic, readwrite) int normal_normal;
@property(nonatomic, readwrite) int direct_normal;
@property(nonatomic, readwrite, direct) int normal_direct;
@property(nonatomic, readwrite, direct) int direct_direct;
@end
@implementation Inteface_Extension
@end
__attribute__((objc_root_class))
@interface Extension_Implementation
@end
@interface Extension_Implementation ()
@property(nonatomic, readwrite) int normal_normal;
@property(nonatomic, readwrite, direct) int direct_normal;
@property(nonatomic, readwrite) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readwrite, direct) int direct_direct;
@end
@implementation Extension_Implementation
- (int)normal_normal {
return 42;
}
- (int)direct_normal {
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method implementation was previously declared not direct}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) {
return 42;
}
@end
__attribute__((objc_root_class))
@interface Inteface_Category
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Inteface_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly) int direct_normal; // expected-error {{property declaration conflicts with previous direct declaration of property 'direct_normal'}}
@property(nonatomic, readonly, direct) int normal_direct; // expected-error {{direct property declaration conflicts with previous declaration of property 'normal_direct'}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-error {{direct property declaration conflicts with previous direct declaration of property 'direct_direct'}}
@end
@implementation Inteface_Category
@end
__attribute__((objc_root_class))
@interface Extension_Category
@end
@interface Extension_Category ()
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Extension_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly) int direct_normal; // expected-error {{property declaration conflicts with previous direct declaration of property 'direct_normal'}}
@property(nonatomic, readonly, direct) int normal_direct; // expected-error {{direct property declaration conflicts with previous declaration of property 'normal_direct'}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-error {{direct property declaration conflicts with previous direct declaration of property 'direct_direct'}}
@end
@implementation Extension_Category
@end
__attribute__((objc_root_class))
@interface Implementation_Category
@end
@interface Implementation_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@implementation Implementation_Category
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
return 42;
}
@end
__attribute__((objc_root_class))
@interface Category_Category
@end
@interface Category_Category (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Category_Category (SomeOtherCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly) int direct_normal; // expected-error {{property declaration conflicts with previous direct declaration of property 'direct_normal'}}
@property(nonatomic, readonly, direct) int normal_direct; // expected-error {{direct property declaration conflicts with previous declaration of property 'normal_direct'}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-error {{direct property declaration conflicts with previous direct declaration of property 'direct_direct'}}
@end
@implementation Category_Category
@end
__attribute__((objc_root_class))
@interface Category_CategoryImplementation
@end
@interface Category_CategoryImplementation (SomeCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal;
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct;
@end
@implementation Category_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal {
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method implementation was previously declared not direct}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) {
return 42;
}
@end
@implementation Category_CategoryImplementation
@end
__attribute__((objc_root_class))
@interface Interface_CategoryImplementation
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Interface_CategoryImplementation (SomeCategory)
@end
@implementation Interface_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
return 42;
}
@end
@implementation Interface_CategoryImplementation
@end
__attribute__((objc_root_class))
@interface Extension_CategoryImplementation
@end
@interface Extension_CategoryImplementation ()
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@interface Extension_CategoryImplementation (SomeCategory)
@end
@implementation Extension_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
return 42;
}
@end
__attribute__((objc_root_class))
@interface OtherCategory_CategoryImplementation
@end
@interface OtherCategory_CategoryImplementation (SomeCategory)
@end
@interface OtherCategory_CategoryImplementation (SomeOtherCategory)
@property(nonatomic, readonly) int normal_normal;
@property(nonatomic, readonly, direct) int direct_normal; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly) int normal_direct; // expected-note {{previous declaration is here}}
@property(nonatomic, readonly, direct) int direct_direct; // expected-note {{previous declaration is here}}
@end
@implementation OtherCategory_CategoryImplementation (SomeCategory)
- (int)normal_normal {
return 42;
}
- (int)direct_normal { // expected-error {{direct method was declared in a category but is implemented in a different category}}
return 42;
}
- (int)normal_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in a different category}}
return 42;
}
- (int)direct_direct __attribute__((objc_direct)) { // expected-error {{direct method was declared in a category but is implemented in a different category}}
return 42;
}
@end
@implementation OtherCategory_CategoryImplementation
@end