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
61 lines
2.4 KiB
Objective-C
61 lines
2.4 KiB
Objective-C
// RUN: not %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -Wno-objc-root-class %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
|
|
// RUN: not %clang_cc1 -fsyntax-only -fblocks -Wno-objc-root-class %s 2>&1 | FileCheck %s
|
|
|
|
extern void doSomething(void);
|
|
|
|
@interface Test
|
|
{
|
|
@public
|
|
void (^aBlock)(void);
|
|
}
|
|
@property (retain) void (^aBlock)(void);
|
|
@property (weak, retain) void (^aBlockW)(void);
|
|
@property (strong, retain) void (^aBlockS)(void); // OK
|
|
@property (readonly, retain) void (^aBlockR)(void); // OK
|
|
@property (copy, retain) void (^aBlockC)(void);
|
|
@property (assign, retain) void (^aBlockA)(void);
|
|
@end
|
|
|
|
@implementation Test
|
|
@synthesize aBlock;
|
|
@dynamic aBlockW, aBlockS, aBlockR, aBlockC, aBlockA;
|
|
@end
|
|
|
|
int main(void) {
|
|
Test *t;
|
|
t.aBlock = ^{ doSomething(); };
|
|
t.aBlockW = ^{ doSomething(); };
|
|
t.aBlockS = ^{ doSomething(); };
|
|
}
|
|
|
|
// CHECK-ARC: 11:1: warning: retain'ed block property does not copy the block - use copy attribute instead
|
|
// CHECK-ARC: @property (retain) void (^aBlock)(void);
|
|
// CHECK-ARC: ^
|
|
// CHECK-ARC: 12:1: error: property attributes 'retain' and 'weak' are mutually exclusive
|
|
// CHECK-ARC: @property (weak, retain) void (^aBlockW)(void);
|
|
// CHECK-ARC: ^
|
|
// CHECK-ARC: 15:1: error: property attributes 'copy' and 'retain' are mutually exclusive
|
|
// CHECK-ARC: @property (copy, retain) void (^aBlockC)(void);
|
|
// CHECK-ARC: ^
|
|
// CHECK-ARC: 16:1: error: property attributes 'assign' and 'retain' are mutually exclusive
|
|
// CHECK-ARC: @property (assign, retain) void (^aBlockA)(void);
|
|
// CHECK-ARC: ^
|
|
// CHECK-ARC: 27:13: warning: assigning block literal to a weak property; object will be released after assignment
|
|
// CHECK-ARC: t.aBlockW = ^{ doSomething(); };
|
|
// CHECK-ARC: ^ ~~~~~~~~~~~~~~~~~~~
|
|
// CHECK-ARC: 2 warnings and 3 errors generated.
|
|
|
|
// CHECK: 11:1: warning: retain'ed block property does not copy the block - use copy attribute instead
|
|
// CHECK: @property (retain) void (^aBlock)(void);
|
|
// CHECK: ^
|
|
// CHECK: 12:1: error: property attributes 'retain' and 'weak' are mutually exclusive
|
|
// CHECK: @property (weak, retain) void (^aBlockW)(void);
|
|
// CHECK: ^
|
|
// CHECK: 15:1: error: property attributes 'copy' and 'retain' are mutually exclusive
|
|
// CHECK: @property (copy, retain) void (^aBlockC)(void);
|
|
// CHECK: ^
|
|
// CHECK: 16:1: error: property attributes 'assign' and 'retain' are mutually exclusive
|
|
// CHECK: @property (assign, retain) void (^aBlockA)(void);
|
|
// CHECK: ^
|
|
// CHECK: 1 warning and 3 errors generated.
|