./:
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / 980506-1.c
blob9bc2d8afc3e7f12ff23b4abb77a4dcab18d9dda4
1 /* The arrays are too large for the xstormy16 - won't fit in 16 bits. */
2 /* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } } */
3 /* { dg-do assemble { xfail xstormy16-*-* m6811-*-* m6812-*-* } } */
5 unsigned char TIFFFax2DMode[20][256];
6 unsigned char TIFFFax2DNextState[20][256];
7 unsigned char TIFFFaxUncompAction[20][256];
8 unsigned char TIFFFaxUncompNextState[20][256];
9 unsigned char TIFFFax1DAction[230][256];
10 unsigned char TIFFFax1DNextState[230][256];
12 typedef struct tableentry {
13 unsigned short length;
14 unsigned short code;
15 short runlen;
16 } tableentry;
18 extern tableentry TIFFFaxWhiteCodes[];
19 extern tableentry TIFFFaxBlackCodes[];
21 static short sp_data, sp_bit;
23 static unsigned char
24 fetchByte (inbuf)
26 unsigned char **inbuf;
29 unsigned char byte = **inbuf;
30 (*inbuf)++;
31 return (byte);
34 static int
35 decode_white_run (inbuf)
37 unsigned char **inbuf;
40 short state = sp_bit;
41 short action;
42 int runlen = 0;
44 for (;;)
46 if (sp_bit == 0)
48 nextbyte:
49 sp_data = fetchByte (inbuf);
52 action = TIFFFax1DAction[state][sp_data];
53 state = TIFFFax1DNextState[state][sp_data];
54 if (action == 0 )
55 goto nextbyte;
56 if (action == 1 )
57 return (-1 );
58 if (action == 210 )
59 return (-3 );
60 sp_bit = state;
61 action = (TIFFFaxWhiteCodes[ action - 2 ].runlen) ;
62 runlen += action;
63 if (action < 64)
64 return (runlen);