xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-modern-atautoreleasepool.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -E %s -o %t.mm
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-rw.cpp
3*f4a2713aSLionel Sambuc// RUN: FileCheck --input-file=%t-rw.cpp %s
4*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
5*f4a2713aSLionel Sambuc// radar 11474836
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambucextern "C"
8*f4a2713aSLionel Sambucvoid *sel_registerName(const char *);
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc@interface I
11*f4a2713aSLionel Sambuc{
12*f4a2713aSLionel Sambuc  id ivar;
13*f4a2713aSLionel Sambuc}
14*f4a2713aSLionel Sambuc- (id) Meth;
15*f4a2713aSLionel Sambuc+ (id) MyAlloc;;
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc@implementation I
19*f4a2713aSLionel Sambuc- (id) Meth {
20*f4a2713aSLionel Sambuc   @autoreleasepool {
21*f4a2713aSLionel Sambuc      id p = [I MyAlloc];
22*f4a2713aSLionel Sambuc      if (!p)
23*f4a2713aSLionel Sambuc        return ivar;
24*f4a2713aSLionel Sambuc   }
25*f4a2713aSLionel Sambuc  return 0;
26*f4a2713aSLionel Sambuc}
27*f4a2713aSLionel Sambuc+ (id) MyAlloc {
28*f4a2713aSLionel Sambuc    return 0;
29*f4a2713aSLionel Sambuc}
30*f4a2713aSLionel Sambuc@end
31*f4a2713aSLionel Sambuc
32*f4a2713aSLionel Sambuc// CHECK: /* @autoreleasepool */ { __AtAutoreleasePool __autoreleasepool;
33