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

Function main

src/RandomProgramGenerator.cpp:351–1473  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

349
350// ----------------------------------------------------------------------------
351int
352main(int argc, char **argv)
353{
354 g_Seed = platform_gen_seed();
355
356 CGOptions::set_default_settings();
357
358 for (int i=1; i<argc; i++) {
359
360 if (strcmp (argv[i], "--help") == 0 ||
361 strcmp (argv[i], "-h") == 0) {
362 print_help();
363 return 0;
364 }
365
366 if (strcmp (argv[i], "-hh") == 0) {
367 print_advanced_help();
368 return 0;
369 }
370
371 if (strcmp (argv[i], "--version") == 0 ||
372 strcmp (argv[i], "-v") == 0) {
373 print_version();
374 return 0;
375 }
376
377 if (strcmp (argv[i], "--seed") == 0 ||
378 strcmp (argv[i], "-s") == 0) {
379 i++;
380 arg_check(argc, i);
381
382 if (!parse_int_arg(argv[i], &g_Seed))
383 exit(-1);
384 continue;
385 }
386
387 if (strcmp (argv[i], "--max-block-size") == 0) {
388 unsigned long size = 0;
389 i++;
390 arg_check(argc, i);
391 if (!parse_int_arg(argv[i], &size))
392 exit(-1);
393 CGOptions::max_block_size(size);
394 continue;
395 }
396
397 if (strcmp (argv[i], "--max-funcs") == 0) {
398 unsigned long size = 0;
399 i++;
400 arg_check(argc, i);
401 if (!parse_int_arg(argv[i], &size))
402 exit(-1);
403 CGOptions::max_funcs(size);
404 continue;
405 }
406
407 if (strcmp (argv[i], "--func1_max_params") == 0) {
408 unsigned long num = 0;

Callers

nothing calls this directly

Calls 9

platform_gen_seedFunction · 0.85
strcmpFunction · 0.85
print_helpFunction · 0.85
print_advanced_helpFunction · 0.85
print_versionFunction · 0.85
arg_checkFunction · 0.85
parse_int_argFunction · 0.85
parse_string_argFunction · 0.85
goGeneratorMethod · 0.45

Tested by

no test coverage detected