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