| 1 |
/* PR rtl-optimization/28636 */ |
| 2 |
/* Origin: Andreas Schwab <[email protected]> */ |
| 3 |
|
| 4 |
extern void abort(void); |
| 5 |
|
| 6 |
struct input_ty |
| 7 |
{ |
| 8 |
unsigned char *buffer_position; |
| 9 |
unsigned char *buffer_end; |
| 10 |
}; |
| 11 |
|
| 12 |
int input_getc_complicated (struct input_ty *x) { return 0; } |
| 13 |
|
| 14 |
int check_header (struct input_ty *deeper) |
| 15 |
{ |
| 16 |
unsigned len; |
| 17 |
for (len = 0; len < 6; len++) |
| 18 |
if (((deeper)->buffer_position < (deeper)->buffer_end |
| 19 |
? *((deeper)->buffer_position)++ |
| 20 |
: input_getc_complicated((deeper))) < 0) |
| 21 |
return 0; |
| 22 |
return 1; |
| 23 |
} |
| 24 |
|
| 25 |
struct input_ty s; |
| 26 |
unsigned char b[6]; |
| 27 |
|
| 28 |
int main (void) |
| 29 |
{ |
| 30 |
s.buffer_position = b; |
| 31 |
s.buffer_end = b + sizeof b; |
| 32 |
if (!check_header(&s)) |
| 33 |
abort(); |
| 34 |
if (s.buffer_position != s.buffer_end) |
| 35 |
abort(); |
| 36 |
return 0; |
| 37 |
} |