2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / 980506-1.c
blob5c22e7e508f9f41bd74195f719e5c1a29d3d8add
1 /* The arrays are too large for the xstormy16 - won't fit in 16 bits. */
2 /* { dg-do assemble } */
3 /* { dg-require-effective-target size32plus } */
4 /* { dg-xfail-if "The array too big" { m6811-*-* m6812-*-* } { "*" } { "" } } /*
5 /* { dg-skip-if "Array too big" { "avr-*-*" } { "*" } { "" } } */
6 /* { dg-xfail-if "The array too big" { h8300-*-* } { "-mno-h" "-mn" } { "" } } */
8 unsigned char TIFFFax2DMode[20][256];
9 unsigned char TIFFFax2DNextState[20][256];
10 unsigned char TIFFFaxUncompAction[20][256];
11 unsigned char TIFFFaxUncompNextState[20][256];
12 unsigned char TIFFFax1DAction[230][256];
13 unsigned char TIFFFax1DNextState[230][256];
15 typedef struct tableentry {
16 unsigned short length;
17 unsigned short code;
18 short runlen;
19 } tableentry;
21 extern tableentry TIFFFaxWhiteCodes[];
22 extern tableentry TIFFFaxBlackCodes[];
24 static short sp_data, sp_bit;
26 static unsigned char
27 fetchByte (inbuf)
29 unsigned char **inbuf;
32 unsigned char byte = **inbuf;
33 (*inbuf)++;
34 return (byte);
37 static int
38 decode_white_run (inbuf)
40 unsigned char **inbuf;
43 short state = sp_bit;
44 short action;
45 int runlen = 0;
47 for (;;)
49 if (sp_bit == 0)
51 nextbyte:
52 sp_data = fetchByte (inbuf);
55 action = TIFFFax1DAction[state][sp_data];
56 state = TIFFFax1DNextState[state][sp_data];
57 if (action == 0 )
58 goto nextbyte;
59 if (action == 1 )
60 return (-1 );
61 if (action == 210 )
62 return (-3 );
63 sp_bit = state;
64 action = (TIFFFaxWhiteCodes[ action - 2 ].runlen) ;
65 runlen += action;
66 if (action < 64)
67 return (runlen);