* tree-outof-ssa.c (_elim_graph): Change the type of edge_list
[official-gcc.git] / gcc / testsuite / obj-c++.dg / bitfield-3.mm
blobd607a3efc9d4077dee0939f925d3b1454702eb77
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 "C" {
10   extern void abort(void);
11   extern int strcmp(const char *, const char *);
14 #define CHECK_IF(expr) if(!(expr)) abort();
16 @interface Base 
18     struct objc_class *isa;
19     int full;
20     int full2: 32;
21     int _refs: 8;
22     int field2: 3;
23     unsigned f3: 8;
24     short cc;
25     unsigned g: 16;
26     int r2: 8;
27     int r3: 8;
28     int r4: 2;
29     int r5: 8;
30     char c;
32 @end
34 @interface Derived: Base
36     char d;
37     int _field3: 6;
39 @end
41 @implementation Base
42 @end
44 @implementation Derived
45 @end
47 int main(void) {
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));
56   return 0;