* gcc.dg/vect/vect-shift-1.c: Include tree-vect.h header. Check
[official-gcc.git] / gcc / testsuite / obj-c++.dg / defs.mm
blob3027985ed0c98e6f5e521f2c0d3d31678ba5a437
1 /* Check @defs() in Objective-C++ */
2 /* Contributed by Devang Patel  <dpatel@apple.com>  */
4 /* { dg-options "-lobjc" } */
5 /* { dg-do run } */
7 #include <stdlib.h>
8 #include <objc/objc.h>
9 #include <objc/Object.h>
11 extern void abort(void);
13 @interface A : Object
15   @public
16     int a;
18 @end
20 struct A_defs 
22   @defs(A);
25 @implementation A
26 - init 
28   a = 42;
29   return self;
31 @end
34 int main() 
36   A *a = [A init];
37   struct A_defs *a_defs = (struct A_defs *)a;
38   
39   if (a->a != a_defs->a)
40     abort ();   
41   
42   return 0;