[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Rewriter / objc-modern-implicit-cast.mm
blobe6121991e56b0f7e59ec33c9f25e3ef3b2cc3099
1 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2 // RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3 // rdar://11202764
5 typedef void(^BL)(void);
7 id return_id(void(^block)(void)) {
8   return block;
11 BL return_block(id obj) {
12   return obj;
15 int main()
17     void(^block)(void);
18     id obj;
19     block = obj; // AnyPointerToBlockPointerCast
20     obj = block; // BlockPointerToObjCPointerCast
22    id obj1 = block;
24    void(^block1)(void) = obj1;
26    return_id(block1);
28    return_id(obj1);
30    return_block(block1);
32    return_block(obj1);