Fariborz Jahanian | be8d55c | 2012-06-29 18:27:08 +0000 | [diff] [blame] | 1 | // 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 | |
| 5 | extern "C" void *sel_registerName(const char *); |
Fariborz Jahanian | 6734ec4 | 2012-06-29 19:55:46 +0000 | [diff] [blame] | 6 | typedef unsigned long size_t; |
Fariborz Jahanian | be8d55c | 2012-06-29 18:27:08 +0000 | [diff] [blame] | 7 | |
| 8 | union U { |
| 9 | double d1; |
| 10 | char filler[32]; |
| 11 | }; |
| 12 | |
| 13 | struct 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 | |
| 24 | I* PI(); |
| 25 | |
| 26 | extern "C" { |
| 27 | |
| 28 | struct 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 Jahanian | 6734ec4 | 2012-06-29 19:55:46 +0000 | [diff] [blame] | 39 | S s4 = [PI() VAMeth : 2, ^{}, &foo]; |
| 40 | |
Fariborz Jahanian | be8d55c | 2012-06-29 18:27:08 +0000 | [diff] [blame] | 41 | return [PI() Meth1]; |
| 42 | } |
| 43 | |
| 44 | } |
| 45 | |