URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* PR rtl-optimization/28636 */
|
/* PR rtl-optimization/28636 */
|
/* Origin: Andreas Schwab <schwab@suse.de> */
|
/* Origin: Andreas Schwab <schwab@suse.de> */
|
|
|
extern void abort(void);
|
extern void abort(void);
|
|
|
struct input_ty
|
struct input_ty
|
{
|
{
|
unsigned char *buffer_position;
|
unsigned char *buffer_position;
|
unsigned char *buffer_end;
|
unsigned char *buffer_end;
|
};
|
};
|
|
|
int input_getc_complicated (struct input_ty *x) { return 0; }
|
int input_getc_complicated (struct input_ty *x) { return 0; }
|
|
|
int check_header (struct input_ty *deeper)
|
int check_header (struct input_ty *deeper)
|
{
|
{
|
unsigned len;
|
unsigned len;
|
for (len = 0; len < 6; len++)
|
for (len = 0; len < 6; len++)
|
if (((deeper)->buffer_position < (deeper)->buffer_end
|
if (((deeper)->buffer_position < (deeper)->buffer_end
|
? *((deeper)->buffer_position)++
|
? *((deeper)->buffer_position)++
|
: input_getc_complicated((deeper))) < 0)
|
: input_getc_complicated((deeper))) < 0)
|
return 0;
|
return 0;
|
return 1;
|
return 1;
|
}
|
}
|
|
|
struct input_ty s;
|
struct input_ty s;
|
unsigned char b[6];
|
unsigned char b[6];
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
s.buffer_position = b;
|
s.buffer_position = b;
|
s.buffer_end = b + sizeof b;
|
s.buffer_end = b + sizeof b;
|
if (!check_header(&s))
|
if (!check_header(&s))
|
abort();
|
abort();
|
if (s.buffer_position != s.buffer_end)
|
if (s.buffer_position != s.buffer_end)
|
abort();
|
abort();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.