xref: /llvm-project/clang/test/Rewriter/rewrite-local-static-id.mm (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
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 -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" -emit-llvm -o %t %t-rw.cpp
3
4void *sel_registerName(const char *);
5
6@interface foo
7@end
8
9@interface foo2 : foo
10+ (id)x;
11@end
12
13typedef void (^b_t)(void);
14
15void bar(b_t block);
16
17void f() {
18        static id foo = 0;
19        bar(^{
20                foo = [foo2 x];
21        });
22}
23
24