summaryrefslogtreecommitdiff
path: root/test/Sema/warn-documentation.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/warn-documentation.m')
-rw-r--r--test/Sema/warn-documentation.m70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/Sema/warn-documentation.m b/test/Sema/warn-documentation.m
index 5e95e2a1e8a2f..3c1a369c4b14b 100644
--- a/test/Sema/warn-documentation.m
+++ b/test/Sema/warn-documentation.m
@@ -229,3 +229,73 @@ int FooBar();
- (void) VarArgMeth : (id)arg, ... {}
@end
+/**
+ * blockPointerVariable
+ *
+ * @param i is integer.
+ * @returns integer.
+ */
+int (^blockPointerVariable)(int i);
+
+struct HasFields {
+ /**
+ * blockPointerField
+ *
+ * \param i is integer.
+ * \returns integer.
+ */
+ int (^blockPointerFields)(int i);
+};
+
+// expected-warning@+5 {{'\returns' command used in a comment that is attached to a function returning void}}
+/**
+ * functionPointerVariable
+ *
+ * \param p not here.
+ * \returns integer.
+ */
+void (^_Nullable blockPointerVariableThatLeadsNowhere)();
+
+@interface CheckFunctionBlockPointerVars {
+ /**
+ * functionPointerIVar
+ *
+ * @param i is integer.
+ * @returns integer.
+ */
+ int (*functionPointerIVar)(int i);
+
+ /**
+ * blockPointerIVar
+ *
+ * \param i is integer.
+ * \returns integer.
+ */
+ int (^blockPointerIVar)(int i);
+}
+
+/**
+ * functionPointerProperty
+ *
+ * @param i is integer.
+ * @returns integer.
+ */
+@property int (*functionPointerProperty)(int i);
+
+/**
+ * blockPointerProperty
+ *
+ * \param i is integer.
+ * \returns integer.
+ */
+@property int (^blockPointerProperty)(int i);
+
+/**
+ * blockReturnsNothing
+ *
+ * \returns Nothing, but can allow this as this pattern is used to document the
+ * value that the property getter returns.
+ */
+@property void (^blockReturnsNothing)();
+
+@end