LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr64829.c
blob6a9f3d785fd16ec4a668fdb7bcd7f50beeaf6f5d
1 /* { dg-do compile } */
3 typedef unsigned char Uint8;
4 typedef int Sint32;
5 typedef unsigned int Uint32;
7 typedef union RMColorDataRef
9 Uint8* data8;
10 } RMColorDataRef;
12 typedef struct RMColorData
14 Uint32 dataCount;
15 RMColorDataRef dataRef;
16 } RMColorData;
18 typedef struct RMColorTable
20 Uint8 dataCompsOut;
21 RMColorDataRef dataRef;
22 } RMColorTable;
24 int fail ( const RMColorData * pInColor,
25 RMColorData * pOutColor,
26 const RMColorTable * pColorTable )
28 Uint32 comp;
29 Uint8 nCompOut;
31 Sint32 result;
33 Uint32 interpFrac1, interpFrac2, interpFrac3;
34 Sint32 val0, val1, val2, val3;
36 Uint8 * pOut;
38 const Uint8 * pClutData;
39 const Uint8 * pCornerPoint0;
41 Uint8 lastOut[((8) > (4) ? (8) : (4))];
43 pOut = pOutColor->dataRef.data8;
44 pClutData = pColorTable->dataRef.data8;
46 nCompOut = pColorTable->dataCompsOut;
48 pCornerPoint0 = pClutData;
50 for (comp = 0; comp < nCompOut; comp++)
52 val0 = *pCornerPoint0++;
54 result = val0 << 4;
56 result += (val1 - val0) * interpFrac1;
57 result += (val2 - val1) * interpFrac2;
58 result += (val3 - val2) * interpFrac3;
60 *pOut++ = lastOut[comp] = (Uint8)(result >> 4);
63 return (0);