struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20000412-6.c
blobafa8440afbe3bfa43abece765b7df88a7a0a880d
1 /*
2 20000412-6.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 unsigned bug (unsigned short value, unsigned short *buffer,
12 unsigned short *bufend);
14 unsigned short buf[] = {1, 4, 16, 64, 256};
16 void
17 testTortureExecute (void)
19 if (bug (512, buf, buf + 3) != 491)
20 ASSERT (0);
22 return;
25 unsigned
26 bug (unsigned short value, unsigned short *buffer, unsigned short *bufend)
28 unsigned short *tmp;
30 for (tmp = buffer; tmp < bufend; tmp++)
31 value -= *tmp;
33 return value;