struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr34176.c
blob8a0694a5a532d4e2ca76ae3750544d2ca4dee992
1 /*
2 pr34176.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c89
9 #pragma disable_warning 85
10 #pragma disable_warning 225
11 #endif
13 #include <string.h>
15 typedef unsigned int index_ty;
16 typedef index_ty *index_list_ty;
18 struct mult_index
20 index_ty index;
21 unsigned int count;
24 struct mult_index_list
26 struct mult_index *item;
27 size_t nitems;
28 size_t nitems_max;
30 struct mult_index *item2;
31 size_t nitems2_max;
34 int
35 hash_find_entry (size_t *result)
37 *result = 2;
38 return 0;
41 extern void abort (void);
42 struct mult_index *
43 foo (size_t n)
45 static count = 0;
46 if (count++ > 0)
47 ASSERT (0);
48 return 0;
51 void
52 testTortureExecute (void)
54 size_t nitems = 0;
56 for (;;)
58 size_t list;
60 hash_find_entry (&list);
62 size_t len2 = list;
63 struct mult_index *destptr;
64 struct mult_index *dest;
65 size_t new_max = nitems + len2;
67 if (new_max != len2)
68 break;
69 dest = foo (new_max);
71 destptr = dest;
72 while (len2--)
73 destptr++;
75 nitems = destptr - dest;
79 return;