blob: 8a0694a5a532d4e2ca76ae3750544d2ca4dee992 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
/*
pr34176.c from the execute part of the gcc torture tests.
*/
#include <testfwk.h>
#ifdef __SDCC
#pragma std_c89
#pragma disable_warning 85
#pragma disable_warning 225
#endif
#include <string.h>
typedef unsigned int index_ty;
typedef index_ty *index_list_ty;
struct mult_index
{
index_ty index;
unsigned int count;
};
struct mult_index_list
{
struct mult_index *item;
size_t nitems;
size_t nitems_max;
struct mult_index *item2;
size_t nitems2_max;
};
int
hash_find_entry (size_t *result)
{
*result = 2;
return 0;
}
extern void abort (void);
struct mult_index *
foo (size_t n)
{
static count = 0;
if (count++ > 0)
ASSERT (0);
return 0;
}
void
testTortureExecute (void)
{
size_t nitems = 0;
for (;;)
{
size_t list;
hash_find_entry (&list);
{
size_t len2 = list;
struct mult_index *destptr;
struct mult_index *dest;
size_t new_max = nitems + len2;
if (new_max != len2)
break;
dest = foo (new_max);
destptr = dest;
while (len2--)
destptr++;
nitems = destptr - dest;
}
}
return;
}
|