xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/objc-modern-StretAPI.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2*f4a2713aSLionel Sambuc// 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*f4a2713aSLionel Sambuc// rdar://11359268
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambucextern "C" void *sel_registerName(const char *);
6*f4a2713aSLionel Sambuctypedef unsigned long size_t;
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambucunion U {
9*f4a2713aSLionel Sambuc  double d1;
10*f4a2713aSLionel Sambuc  char filler[32];
11*f4a2713aSLionel Sambuc};
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambucstruct S {
14*f4a2713aSLionel Sambuc  char filler[128];
15*f4a2713aSLionel Sambuc};
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc@interface I
18*f4a2713aSLionel Sambuc- (struct S) Meth : (int) arg1 : (id) arg2;
19*f4a2713aSLionel Sambuc- (struct S) Meth1;
20*f4a2713aSLionel Sambuc- (union U) Meth2 : (double)d;
21*f4a2713aSLionel Sambuc- (struct S) VAMeth : (int)anchor, ...;
22*f4a2713aSLionel Sambuc@end
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel SambucI* PI();
25*f4a2713aSLionel Sambuc
26*f4a2713aSLionel Sambucextern "C" {
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambucstruct S foo () {
29*f4a2713aSLionel Sambuc  struct S s = [PI() Meth : 1 : (id)0];
30*f4a2713aSLionel Sambuc
31*f4a2713aSLionel Sambuc  U u = [PI() Meth2 : 3.14];
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc  S s1 = [PI() VAMeth : 12, 13.4, 1000, "hello"];
34*f4a2713aSLionel Sambuc
35*f4a2713aSLionel Sambuc  S s2 = [PI() VAMeth : 12];
36*f4a2713aSLionel Sambuc
37*f4a2713aSLionel Sambuc  S s3 = [PI() VAMeth : 0, "hello", "there"];
38*f4a2713aSLionel Sambuc
39*f4a2713aSLionel Sambuc  S s4 = [PI() VAMeth : 2, ^{}, &foo];
40*f4a2713aSLionel Sambuc
41*f4a2713aSLionel Sambuc  return [PI() Meth1];
42*f4a2713aSLionel Sambuc}
43*f4a2713aSLionel Sambuc
44*f4a2713aSLionel Sambuc}
45*f4a2713aSLionel Sambuc
46