Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Rewriter / rewrite-nested-blocks-1.mm
blob27eb0543a6a07d4cea4ddc6c7e3740f55e8ba24c
1 // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
2 // RUN: %clang_cc1 -fsyntax-only -std=gnu++98 -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3 // RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
4 // RUN: %clang_cc1 -fsyntax-only -std=gnu++98 -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
6 typedef unsigned long size_t;
7 void *sel_registerName(const char *);
9 void f(void (^block)(void));
10 void f2(id);
11 void f3(int);
12 char f4(id, id);
14 @interface Baz
15 - (void)b:(void (^)(void))block;
16 @end
18 @interface Bar
19 @end
21 @interface Foo {
22         int _x;
24 @end
26 @implementation Foo
27 - (void)method:(Bar *)up {
28     Baz *down;
29         int at;
30     id cq;
31     __block char didit = 'a';
32     __block char upIsFinished = 'b';
33     f(^{
34             id old_cq;
35                         f2(cq);
36             [down b:^{
37                     [down b:^{
38                             f(^{
39                                     didit = f4(up, down);
40                                                                         upIsFinished = 'c';
41                                     self->_x++;
42                                 });
43                         }];
44                 }];
45                                 f2(old_cq);
46                         f3(at);
47     });
49 @end