Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20060910-1.c
blob00ebf04dc8776cdf02f2826349e905a21a36fefa
1 /*
2 20060910-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #pragma disable_warning 85
13 /* PR rtl-optimization/28636 */
14 /* Origin: Andreas Schwab <schwab@suse.de> */
16 struct input_ty
18 unsigned char *buffer_position;
19 unsigned char *buffer_end;
22 int input_getc_complicated (struct input_ty *x) { return 0; }
24 int check_header (struct input_ty *deeper)
26 unsigned len;
27 for (len = 0; len < 6; len++)
28 if (((deeper)->buffer_position < (deeper)->buffer_end
29 ? *((deeper)->buffer_position)++
30 : input_getc_complicated((deeper))) < 0)
31 return 0;
32 return 1;
35 struct input_ty s;
36 unsigned char b[6];
38 void testTortureExecute (void)
40 s.buffer_position = b;
41 s.buffer_end = b + sizeof b;
42 if (!check_header(&s))
43 ASSERT (0);
44 if (s.buffer_position != s.buffer_end)
45 ASSERT (0);
46 return;