Debian Codegraph @

gcc/testsuite/g++.dg/torture/pr110308.C

raw
1 /* { dg-do compile } */
2
3 int channelCount, decodeBlock_outputLength;
4 struct BlockCodec {
5 virtual int decodeBlock(const unsigned char *, short *);
6 };
7 struct ms_adpcm_state {
8 char predictorIndex;
9 int sample1;
10 ms_adpcm_state();
11 };
12 bool decodeBlock_ok;
13 void encodeBlock() { ms_adpcm_state(); }
14 struct MSADPCM : BlockCodec {
15 int decodeBlock(const unsigned char *, short *);
16 };
17 void decodeSample(ms_adpcm_state, bool *);
18 int MSADPCM::decodeBlock(const unsigned char *, short *) {
19 ms_adpcm_state decoderState[2];
20 ms_adpcm_state *state[2];
21 state[0] = &decoderState[0];
22 if (channelCount == 2)
23 state[1] = &decoderState[0];
24 short m_coefficients[state[1]->predictorIndex];
25 for (int i = 0; i < channelCount; i++)
26 ++state[i]->sample1;
27 decodeSample(*state[1], &decodeBlock_ok);
28 return decodeBlock_outputLength;
29 }