1 /* Test Objective-C capability for handling GNU/C99 designated
2 initializers, and distinguishing them from message sends. */
3 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */
4 /* { dg-options "-std=gnu99" } */
9 #include <objc/Object.h>
11 @interface Cls : Object
18 + (int) meth1 { return 45; }
19 + (int) meth2 { return 21; }
25 [2 * 2 ... 5] = (int)[0 meth2], /* { dg-warning "invalid receiver type" } */
26 /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 25 } */
27 /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 25 } */
28 /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 25 } */
32 if (arr[0] != 0 || arr[1] != 45 || arr[2] != 21 || arr[3] != 3)
33 abort (); /* { dg-warning "implicit declaration" } */
35 printf ("%s\n", [super name]);
36 printf ("%d %d %d %d %d %d\n", arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]);