Fix <rdar://problem/6418623> Bogus block type compatibility warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60842 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/blocks.m b/test/SemaObjC/blocks.m
new file mode 100644
index 0000000..dd8380a
--- /dev/null
+++ b/test/SemaObjC/blocks.m
@@ -0,0 +1,22 @@
+// RUN: clang -fsyntax-only -verify -fblocks %s
+@protocol NSObject;
+
+void bar(id(^)(void));
+void foo(id <NSObject>(^objectCreationBlock)(void)) {
+    return bar(objectCreationBlock);
+}
+
+void bar2(id(*)(void));
+void foo2(id <NSObject>(*objectCreationBlock)(void)) {
+    return bar2(objectCreationBlock);
+}
+
+void bar3(id(*)());
+void foo3(id (*objectCreationBlock)(int)) {
+    return bar3(objectCreationBlock);
+}
+
+void bar4(id(^)());
+void foo4(id (^objectCreationBlock)(int)) {
+    return bar4(objectCreationBlock); // expected-warning{{incompatible block pointer types passing 'id (^)(int)', expected 'id (^)()'}}
+}