OSDN Git Service

Formatting fixes.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / compile / 980506-1.c
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-*-* } } */
4
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];
11
12 typedef struct tableentry {
13     unsigned short length;
14     unsigned short code;
15     short       runlen;
16 } tableentry;
17
18 extern tableentry TIFFFaxWhiteCodes[];
19 extern tableentry TIFFFaxBlackCodes[];
20
21 static short sp_data, sp_bit;
22
23 static unsigned char
24 fetchByte (inbuf)
25
26 unsigned char **inbuf;
27
28 {
29     unsigned char byte = **inbuf;
30     (*inbuf)++;
31     return (byte);
32 }
33
34 static int
35 decode_white_run (inbuf)
36
37 unsigned char **inbuf;
38
39 {
40     short state = sp_bit;
41     short action;
42     int runlen = 0;
43
44     for (;;)
45     {
46         if (sp_bit == 0)
47         {
48         nextbyte:
49             sp_data = fetchByte (inbuf);
50         }
51
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);
65     }
66 }
67