blob: 129b56cbe92ddd1d75bcd5a2ef7350228ee9665b [file] [log] [blame]
Fariborz Jahanianbe8d55c2012-06-29 18:27:08 +00001// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2// 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// rdar://11359268
4
5extern "C" void *sel_registerName(const char *);
Fariborz Jahanian6734ec42012-06-29 19:55:46 +00006typedef unsigned long size_t;
Fariborz Jahanianbe8d55c2012-06-29 18:27:08 +00007
8union U {
9 double d1;
10 char filler[32];
11};
12
13struct S {
14 char filler[128];
15};
16
17@interface I
18- (struct S) Meth : (int) arg1 : (id) arg2;
19- (struct S) Meth1;
20- (union U) Meth2 : (double)d;
21- (struct S) VAMeth : (int)anchor, ...;
22@end
23
24I* PI();
25
26extern "C" {
27
28struct S foo () {
29 struct S s = [PI() Meth : 1 : (id)0];
30
31 U u = [PI() Meth2 : 3.14];
32
33 S s1 = [PI() VAMeth : 12, 13.4, 1000, "hello"];
34
35 S s2 = [PI() VAMeth : 12];
36
37 S s3 = [PI() VAMeth : 0, "hello", "there"];
38
Fariborz Jahanian6734ec42012-06-29 19:55:46 +000039 S s4 = [PI() VAMeth : 2, ^{}, &foo];
40
Fariborz Jahanianbe8d55c2012-06-29 18:27:08 +000041 return [PI() Meth1];
42}
43
44}
45