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

Method OutputHeader

src/OutputMgr.cpp:252–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void
253OutputMgr::OutputHeader(int argc, char *argv[], unsigned long seed)
254{
255 std::ostream &out = get_main_out();
256 if (CGOptions::concise()) {
257 out << "// Options: ";
258 if (argc <= 1) {
259 out << " (none)";
260 } else {
261 for (int i = 1; i < argc; ++i) {
262 out << " " << argv[i];
263 }
264 }
265 out << endl;
266 }
267 else {
268 out << "/*" << endl;
269 out << " * This is a RANDOMLY GENERATED PROGRAM." << endl;
270 out << " *" << endl;
271 out << " * Generator: " << PACKAGE_STRING << endl;
272 out << " * Git version: " << git_version << endl;
273 out << " * Options: ";
274 if (argc <= 1) {
275 out << " (none)";
276 } else {
277 for (int i = 1; i < argc; ++i) {
278 out << " " << argv[i];
279 }
280 }
281 out << endl;
282 out << " * Seed: " << seed << endl;
283 out << " */" << endl;
284 out << endl;
285 }
286
287 if (!CGOptions::longlong()) {
288 out << endl;
289 out << "#define NO_LONGLONG" << std::endl;
290 out << endl;
291 }
292 if (CGOptions::enable_float()) {
293 out << "#include <float.h>\n";
294 out << "#include <math.h>\n";
295 }
296
297 ExtensionMgr::OutputHeader(out);
298
299 out << runtime_include << endl;
300
301 if (!CGOptions::compute_hash()) {
302 if (CGOptions::allow_int64())
303 out << "volatile uint64_t " << Variable::sink_var_name << " = 0;" << endl;
304 else
305 out << "volatile uint32_t " << Variable::sink_var_name << " = 0;" << endl;
306 }
307 out << endl;
308
309 out << "static long __undefined;" << endl;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected