xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/objc-modern-StretAPI-3.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://14932320
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambucextern "C" void *sel_registerName(const char *);
6*f4a2713aSLionel Sambuctypedef unsigned long size_t;
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuctypedef struct {
9*f4a2713aSLionel Sambuc    unsigned long long x;
10*f4a2713aSLionel Sambuc    unsigned long long y;
11*f4a2713aSLionel Sambuc} myPoint;
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuctypedef struct {
14*f4a2713aSLionel Sambuc    unsigned long long x;
15*f4a2713aSLionel Sambuc    unsigned long long y;
16*f4a2713aSLionel Sambuc} allPoint;
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc@interface Obj
19*f4a2713aSLionel Sambuc+ (myPoint)foo;
20*f4a2713aSLionel Sambuc+ (myPoint)foo : (int)Arg1 : (double)fArg;
21*f4a2713aSLionel Sambuc+ (allPoint)fee;
22*f4a2713aSLionel Sambuc@end
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambuc@implementation Obj
25*f4a2713aSLionel Sambuc+ (allPoint)fee {
26*f4a2713aSLionel Sambuc    allPoint a;
27*f4a2713aSLionel Sambuc    a.x = a.y = 3;
28*f4a2713aSLionel Sambuc
29*f4a2713aSLionel Sambuc    return a;
30*f4a2713aSLionel Sambuc}
31*f4a2713aSLionel Sambuc+ (myPoint)foo {
32*f4a2713aSLionel Sambuc    myPoint r;
33*f4a2713aSLionel Sambuc    r.x = 1;
34*f4a2713aSLionel Sambuc    r.y = 2;
35*f4a2713aSLionel Sambuc    return r;
36*f4a2713aSLionel Sambuc}
37*f4a2713aSLionel Sambuc
38*f4a2713aSLionel Sambuc+ (myPoint)foo : (int)Arg1 : (double)fArg {
39*f4a2713aSLionel Sambuc  myPoint r;
40*f4a2713aSLionel Sambuc  return r;
41*f4a2713aSLionel Sambuc}
42*f4a2713aSLionel Sambuc@end
43*f4a2713aSLionel Sambuc
44*f4a2713aSLionel SambucmyPoint Ret_myPoint() {
45*f4a2713aSLionel Sambuc  return [Obj foo];
46*f4a2713aSLionel Sambuc}
47*f4a2713aSLionel Sambuc
48*f4a2713aSLionel SambucallPoint Ret_allPoint() {
49*f4a2713aSLionel Sambuc  return [Obj fee];
50*f4a2713aSLionel Sambuc}
51*f4a2713aSLionel Sambuc
52*f4a2713aSLionel SambucmyPoint Ret_myPoint1(int i, double d) {
53*f4a2713aSLionel Sambuc  return [Obj foo:i:d];
54*f4a2713aSLionel Sambuc}
55*f4a2713aSLionel Sambuc
56*f4a2713aSLionel SambucmyPoint Ret_myPoint2() {
57*f4a2713aSLionel Sambuc  return [Obj foo];
58*f4a2713aSLionel Sambuc}
59