Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / 20060202-1.c
blob9d440741c6bbf0f9572731a51d41681d22f68fc5
1 typedef unsigned int size_t;
2 typedef const struct objc_selector
4 void *sel_id;
6 *SEL;
7 typedef struct objc_object
10 *id;
11 typedef struct objc_class *Class;
12 struct objc_class
14 struct sarray *dtable;
16 typedef size_t sidx;
17 struct soffset
19 unsigned int boffset:(sizeof (size_t) * 8) / 2;
20 unsigned int eoffset:(sizeof (size_t) * 8) / 2;
22 union sofftype
24 struct soffset off;
25 sidx idx;
27 struct sarray
29 size_t capacity;
31 static __inline__ unsigned int
32 soffset_decode (sidx indx)
34 union sofftype x;
35 x.idx = indx;
36 return x.off.eoffset + (x.off.boffset * (1 << 5));
38 static __inline__ void *
39 sarray_get_safe (struct sarray *array, sidx indx)
41 if (soffset_decode (indx) < array->capacity)
42 return (void *)sarray_get (array, indx);
44 void *
45 get_imp (Class class, SEL sel)
47 void *res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
48 if (res == 0)
51 res = get_imp (class, sel);