1 /* Check that the sizeof() operator works with ObjC classes and their aliases. */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */
3 /* { dg-options "-lobjc" } */
7 #include <objc/Object.h>
9 extern void abort(void);
10 #define CHECK_IF(expr) if(!(expr)) abort();
12 @interface Foo: Object {
21 typedef Object MyObject;
22 typedef struct Foo Foo_type;
24 @compatibility_alias AliasObject Object;
27 CHECK_IF(sizeof(Foo) > sizeof(Object) && sizeof(Object) > 0);
28 CHECK_IF(sizeof(Foo) == sizeof(Foo_type));
29 CHECK_IF(sizeof(Object) == sizeof(MyObject));
30 CHECK_IF(sizeof(Object) == sizeof(AliasObject));