Daily bump.
[official-gcc.git] / gcc / testsuite / objc.dg / ivar-problem-1.m
blob0d5bb66ea324088d8e4e56b52d380d27e5de65ab
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
2 /* { dg-do compile } */
4 /* This test checks what happens if there are 16 instance variables.
5    In that case, the class was not created correctly.  In this testcase,
6    we have two classes, one with 15 variables and one with 16.  Older
7    GCCs would generate a bogus warning for the second class but not 
8    for the first one.  */
10 #include <stdlib.h>
11 #include <objc/objc.h>
13 #if defined(__has_attribute) && __has_attribute(objc_root_class)
14 __attribute__((objc_root_class))
15 #endif
16 @interface MyRootClass1
18   Class isa;
19   int v2;
20   int v3;
21   int v4;
22   int v5;
23   int v6;
24   int v7;
25   int v8;
26   int v9;
27   int v10;
28   int v11;
29   int v12;
30   int v13;
31   int v14;
32   int v15;
34 - (id) init;
35 @end
37 @implementation MyRootClass1
38 - (id) init { return self; }
39 @end
42 #if defined(__has_attribute) && __has_attribute(objc_root_class)
43 __attribute__((objc_root_class))
44 #endif
45 @interface MyRootClass2
47   Class isa;
48   int v2;
49   int v3;
50   int v4;
51   int v5;
52   int v6;
53   int v7;
54   int v8;
55   int v9;
56   int v10;
57   int v11;
58   int v12;
59   int v13;
60   int v14;
61   int v15;
62   /* Adding the 16th variable used to cause bogus warnings to be
63      generated.  */
64   int v16;
66 - (id) init;
67 @end
69 @implementation MyRootClass2
70 - (id) init { return self; } /* This should not generate a bogus warning.  */
71 @end