File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1461,6 +1461,33 @@ bool instrument_cover_goals(
1461
1461
cmdline.isset (" no-trivial-tests" ));
1462
1462
}
1463
1463
1464
+ if (cmdline.isset (" cover-traces-must-terminate" ))
1465
+ {
1466
+ // instrument an additional goal in CPROVER_START. This will rephrase
1467
+ // the reachability problem by asking BMC to provide a solution that
1468
+ // satisfies a goal while getting to the end of the program-under-test.
1469
+ const auto sf_it=
1470
+ goto_functions.function_map .find (goto_functions.entry_point ());
1471
+ if (sf_it==goto_functions.function_map .end ())
1472
+ {
1473
+ msg.error () << " cover-traces-must-terminate: invalid entry point ["
1474
+ << goto_functions.entry_point () << " ]"
1475
+ << messaget::eom;
1476
+ return true ;
1477
+ }
1478
+ auto if_it=sf_it->second .body .instructions .end ();
1479
+ while (!if_it->is_function_call ())
1480
+ if_it--;
1481
+ if_it++;
1482
+ const std::string &comment=
1483
+ " additional goal to ensure complete trace coverage." ;
1484
+ sf_it->second .body .insert_before_swap (if_it);
1485
+ if_it->make_assertion (false_exprt ());
1486
+ if_it->source_location .set_comment (comment);
1487
+ if_it->source_location .set_property_class (" reachability_constraint" );
1488
+ if_it->source_location .set_function (if_it->function );
1489
+ }
1490
+
1464
1491
goto_functions.update ();
1465
1492
return false ;
1466
1493
}
You can’t perform that action at this time.
0 commit comments