From 22b5c6ce26a273d2d0d25357e39eb3d60b976ef6 Mon Sep 17 00:00:00 2001 From: David Goldman Date: Mon, 8 Apr 2019 19:52:45 +0000 Subject: Clean up ObjCPropertyDecl printing Summary: - `@property(attr, attr2)` instead of `@property ( attr,attr2 )`. - Change priority of attributes (see code/comments inline). - Support for printing weak and unsafe_unretained attributes. Subscribers: arphaman, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57965 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357937 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/AST/ast-print-objc-property.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/AST/ast-print-objc-property.m (limited to 'test/AST/ast-print-objc-property.m') diff --git a/test/AST/ast-print-objc-property.m b/test/AST/ast-print-objc-property.m new file mode 100644 index 0000000000..5a2c8207bf --- /dev/null +++ b/test/AST/ast-print-objc-property.m @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -ast-print %s -o - | FileCheck %s + +@interface NSObject +@end + +@interface Properties : NSObject +@property(class) int classFoo; +@property(nonatomic) int atomicBar; +@property(readonly) int readonlyConstant; +@property(retain, nonatomic, setter=my_setter:, getter=my_getter) id __crazy_name; +@property(nonatomic, strong, nullable) NSObject * objProperty; +@property(nonatomic, weak, null_resettable) NSObject * weakObj; +@property(nonatomic, copy, nonnull) NSObject * copyObj; +@end + +// CHECK: @property(class, atomic, assign, unsafe_unretained, readwrite) int classFoo; +// CHECK: @property(nonatomic, assign, unsafe_unretained, readwrite) int atomicBar; +// CHECK: @property(atomic, readonly) int readonlyConstant; +// CHECK: @property(nonatomic, retain, readwrite, getter = my_getter, setter = my_setter:) id __crazy_name; +// CHECK: @property(nonatomic, strong, readwrite, nullable) NSObject *objProperty; +// CHECK: @property(nonatomic, weak, readwrite, null_resettable) NSObject *weakObj; +// CHECK: @property(nonatomic, copy, readwrite, nonnull) NSObject *copyObj; -- cgit v1.2.3