Don't warn when alignment of global common data exceeds maximum alignment.
[official-gcc.git] / gcc / testsuite / objc.dg / property / synthesize-10.m
blobfc4683187df93269956feaf4d6a9dd94c8866754
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
2 /* { dg-do run } */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5 /* Test @synthesize with bitfield instance variables.  */
7 #include <stdlib.h>
8 #include <objc/objc.h>
9 #include <objc/runtime.h>
11 @interface MyRootClass
13   Class isa;
14   int countA : 2;
15   int countB : 3;
16   int countC : 4;
18 + (id) initialize;
19 + (id) alloc;
20 - (id) init;
21 @property (nonatomic) int countA;
22 @property (nonatomic) int countB;
23 @property (nonatomic) int countC;
24 @end
26 @implementation MyRootClass
27 + (id) initialize { return self; }
28 + (id) alloc { return class_createInstance (self, 0); }
29 - (id) init { return self; }
30 @synthesize countA;
31 @synthesize countB;
32 @synthesize countC;
33 @end
35 int main (void)
37   MyRootClass *object = [[MyRootClass alloc] init];
39   object.countA = 1;
40   object.countB = 3;
41   object.countC = 4;
43   if (object.countA != 1)
44     abort ();
46   if (object.countB != 3)
47     abort ();
49   if (object.countC != 4)
50     abort ();
51   
52   return 0;