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 "-fsigned-char" } */
5 /* { dg-do run { target *-*-darwin* } } */
6 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
8 typedef struct objc_object { struct objc_class *class_pointer; } *id;
10 extern void abort(void);
11 extern int strcmp(const char *, const char *);
13 #define CHECK_IF(expr) if(!(expr)) abort();
17 struct objc_class *isa;
33 @interface Derived: Base
43 @implementation Derived
47 const char *s1r = "{Base=#ib32b8b3b8sb16b8b8b2b8c}";
48 const char *s1 = @encode(Base);
49 const char *s2r = "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}";
50 const char *s2 = @encode(Derived);
52 CHECK_IF(!strcmp(s1r, s1));
53 CHECK_IF(!strcmp(s2r, s2));