@@ -245,6 +245,19 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
245
245
options.set_option (" trace" , true );
246
246
}
247
247
248
+ if (cmdline.isset (" export-core-goto" ))
249
+ {
250
+ options.set_option (
251
+ " export-core-goto" , cmdline.get_value (" export-core-goto" ));
252
+ if (options.get_option (" export-core-goto" ).empty ())
253
+ {
254
+ log .error ()
255
+ << " ERROR: Please provide a filename to write the goto-binary to."
256
+ << messaget::eom;
257
+ exit (CPROVER_EXIT_INTERNAL_ERROR);
258
+ }
259
+ }
260
+
248
261
if (cmdline.isset (" localize-faults" ))
249
262
options.set_option (" localize-faults" , true );
250
263
@@ -549,21 +562,25 @@ int cbmc_parse_optionst::doit()
549
562
// At this point, our goto-model should be in core-goto form (all of the
550
563
// transformations have been run and the program is ready to be given to the
551
564
// solver).
552
- if (cmdline. isset (" export-core-goto" ))
565
+ if (options. is_set (" export-core-goto" ))
553
566
{
554
- auto core_goto_filename = cmdline.get_value (" export-core-goto" );
555
- auto success =
567
+ auto core_goto_filename = options.get_option (" export-core-goto" );
568
+
569
+ bool success =
556
570
!write_goto_binary (core_goto_filename, goto_model, ui_message_handler);
557
571
558
572
if (!success)
559
573
{
560
- log .error () << " Unable to export goto-program in file "
574
+ log .error () << " ERROR: Unable to export goto-program in file "
561
575
<< core_goto_filename << messaget::eom;
562
576
return CPROVER_EXIT_INTERNAL_ERROR;
563
577
}
564
- log .status () << " Exported goto-program in core-goto form at "
565
- << core_goto_filename << messaget::eom;
566
- return CPROVER_EXIT_SUCCESS;
578
+ else
579
+ {
580
+ log .status () << " Exported goto-program in core-goto form at "
581
+ << core_goto_filename << messaget::eom;
582
+ return CPROVER_EXIT_SUCCESS;
583
+ }
567
584
}
568
585
569
586
if (
0 commit comments