Tighten up blocks rewriter to handle casts and some other interesting cases.
This fixes <rdar://problem/6289007> clang block rewriter: ^ in cast is not rewritten.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57591 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Rewriter/block-test.c b/test/Rewriter/block-test.c
index 0a6bde0..82b63a0 100644
--- a/test/Rewriter/block-test.c
+++ b/test/Rewriter/block-test.c
@@ -1,5 +1,16 @@
// RUN: clang -rewrite-blocks %s -o -
+static int (^block)(const void *, const void *) = (int (^)(const void *, const void *))0;
+static int (*func)(int (^block)(void *, void *)) = (int (*)(int (^block)(void *, void *)))0;
+
+typedef int (^block_T)(const void *, const void *);
+typedef int (*func_T)(int (^block)(void *, void *));
+
+void foo(const void *a, const void *b, void *c) {
+ int (^block)(const void *, const void *) = (int (^)(const void *, const void *))c;
+ int (*func)(int (^block)(void *, void *)) = (int (*)(int (^block)(void *, void *)))c;
+}
+
typedef void (^test_block_t)();
int main(int argc, char **argv) {