PR tree-optimization/81384 - built-in form of strnlen missing
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20001203-2.c
blob03aabed9351612f8c153633adaf31635f3714a2d
1 struct obstack
3 long chunk_size;
4 struct _obstack_chunk *chunk;
5 char *object_base;
6 char *next_free;
7 char *chunk_limit;
8 int alignment_mask;
9 unsigned maybe_empty_object;
12 struct objfile
14 struct objfile *next;
15 struct obstack type_obstack;
18 struct type
20 unsigned length;
21 struct objfile *objfile;
22 short nfields;
23 struct field
25 union field_location
27 int bitpos;
28 unsigned long physaddr;
29 char *physname;
31 loc;
32 int bitsize;
33 struct type *type;
34 char *name;
36 *fields;
39 struct type *alloc_type (void);
40 void * xmalloc (unsigned int z);
41 void _obstack_newchunk (struct obstack *o, int i);
42 void get_discrete_bounds (long long *lowp, long long *highp);
44 extern void *memset(void *, int, __SIZE_TYPE__);
46 struct type *
47 create_array_type (struct type *result_type, struct type *element_type)
49 long long low_bound, high_bound;
50 if (result_type == ((void *)0))
52 result_type = alloc_type ();
54 get_discrete_bounds (&low_bound, &high_bound);
55 (result_type)->length =
56 (element_type)->length * (high_bound - low_bound + 1);
57 (result_type)->nfields = 1;
58 (result_type)->fields =
59 (struct field *) ((result_type)->objfile != ((void *)0)
60 ? (
62 struct obstack *__h =
63 (&(result_type)->objfile -> type_obstack);
65 struct obstack *__o = (__h);
66 int __len = ((sizeof (struct field)));
67 if (__o->chunk_limit - __o->next_free < __len)
68 _obstack_newchunk (__o, __len);
69 __o->next_free += __len; (void) 0;
72 struct obstack *__o1 = (__h);
73 void *value;
74 value = (void *) __o1->object_base;
75 if (__o1->next_free == value)
76 __o1->maybe_empty_object = 1;
77 __o1->next_free = (((((__o1->next_free) - (char *) 0)
78 +__o1->alignment_mask)
79 & ~ (__o1->alignment_mask))
80 + (char *) 0);
81 if (__o1->next_free - (char *)__o1->chunk
82 > __o1->chunk_limit - (char *)__o1->chunk)
83 __o1->next_free = __o1->chunk_limit;
84 __o1->object_base = __o1->next_free;
85 value;
86 });
87 }) : xmalloc (sizeof (struct field)));
88 return (result_type);
91 struct type *
92 alloc_type (void)
94 abort ();
96 void * xmalloc (unsigned int z)
98 return 0;
100 void _obstack_newchunk (struct obstack *o, int i)
102 abort ();
104 void
105 get_discrete_bounds (long long *lowp, long long *highp)
107 *lowp = 0;
108 *highp = 2;
111 int main(void)
113 struct type element_type;
114 struct type result_type;
116 memset (&element_type, 0, sizeof (struct type));
117 memset (&result_type, 0, sizeof (struct type));
118 element_type.length = 4;
119 create_array_type (&result_type, &element_type);
120 if (result_type.length != 12)
121 abort ();
122 exit (0);