1 /* Check if bitfield ivars are correctly @encode'd when
2 the NeXT runtime is used. */
3 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */
4 /* { dg-do run { target *-*-darwin* } } */
5 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
6 /* { dg-options "-fsigned-char" } */
7 // { dg-additional-options "-Wno-objc-root-class" }
9 typedef struct objc_object { struct objc_class *class_pointer; } *id;
14 #define CHECK_IF(expr) if(!(expr)) abort();
18 struct objc_class *isa;
34 @interface Derived: Base
44 @implementation Derived
48 const char *s1r = "{Base=#ib32b8b3b8sb16b8b8b2b8c}";
49 const char *s1 = @encode(Base);
50 const char *s2r = "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}";
51 const char *s2 = @encode(Derived);
53 CHECK_IF(!strcmp(s1r, s1));
54 CHECK_IF(!strcmp(s2r, s2));