MCPcopy Create free account
hub / github.com/csmith-project/csmith / OutputStepHashFuncDef

Method OutputStepHashFuncDef

src/OutputMgr.cpp:183–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void
184OutputMgr::OutputStepHashFuncDef(std::ostream &out)
185{
186 out << std::endl;
187 out << "void " << OutputMgr::step_hash_func_name << "(int stmt_id)" << std::endl;
188 out << "{" << std::endl;
189
190 int indent = 1;
191 OutputMgr::output_tab_(out, indent);
192 out << "int i = 0;" << std::endl;
193 OutputMgr::OutputHashFuncInvocation(out, indent);
194 OutputMgr::output_tab_(out, indent);
195 out << "printf(\"before stmt(%d): ";
196 out << "checksum = %X\\n\", stmt_id, crc32_context ^ 0xFFFFFFFFUL);" << std::endl;
197
198 OutputMgr::output_tab_(out, indent);
199 out << "crc32_context = 0xFFFFFFFFUL; " << std::endl;
200
201 OutputMgr::output_tab_(out, indent);
202 out << "for (i = 0; i < 256; i++) { " << std::endl;
203 OutputMgr::output_tab_(out, indent+1);
204 out << "crc32_tab[i] = 0;" << std::endl;
205 OutputMgr::output_tab_(out, indent);
206 out << "}" << std::endl;
207 OutputMgr::output_tab_(out, indent);
208 out << "crc32_gentab();" << endl;
209 out << "}" << std::endl;
210}
211
212void
213OutputMgr::OutputHashFuncDecl(std::ostream &out)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected