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-options "-fnext-runtime -fsigned-char" } */
5 /* { dg-do run { target *-*-darwin* } } */
7 typedef struct objc_object { struct objc_class *class_pointer; } *id;
9 extern void abort(void);
10 extern int strcmp(const char *, const char *);
12 #define CHECK_IF(expr) if(!(expr)) abort();
16 struct objc_class *isa;
32 @interface Derived: Base
42 @implementation Derived
46 const char *s1r = "{Base=#ib32b8b3b8sb16b8b8b2b8c}";
47 const char *s1 = @encode(Base);
48 const char *s2r = "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}";
49 const char *s2 = @encode(Derived);
51 CHECK_IF(!strcmp(s1r, s1));
52 CHECK_IF(!strcmp(s2r, s2));