8sa1-gcc/gcc/testsuite/gcc.c-torture/execute/20000412-6.c
Hans-Peter Nilsson 045a1f9d31 * execute/20000412-6.c: New test.
From-SVN: r33126
2000-04-12 20:54:03 +00:00

23 lines
415 B
C

unsigned bug (unsigned short value, unsigned short *buffer,
unsigned short *bufend);
unsigned short buf[] = {1, 4, 16, 64, 256};
int main()
{
if (bug (512, buf, buf + 3) != 491)
abort ();
exit (0);
}
unsigned
bug (unsigned short value, unsigned short *buffer, unsigned short *bufend)
{
unsigned short *tmp;
for (tmp = buffer; tmp < bufend; tmp++)
value -= *tmp;
return value;
}