Skip to content

Commit 5731f68

Browse files
author
martin
committed
Enable the CPROVER library for goto-analyzer
This does change the functionality quite substantially but strangely it only seems to affect one test, and that is syntactic rather than semantic. As with many of the other changes in this PR, I suspect this is swapping one lot of broken, untested functionality for another, slightly less broken but still not working lot of functionality.
1 parent 7096241 commit 5731f68

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

regression/goto-analyzer/no-match-const-fp-dynamic-array-non-const-fp/test.desc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ CORE
22
main.c
33
--show-goto-functions --pointer-check
44
^Removing function pointers and virtual functions$
5-
^\s*IF fp == f1 THEN GOTO [0-9]$
6-
^\s*IF fp == f2 THEN GOTO [0-9]$
7-
^\s*IF fp == f3 THEN GOTO [0-9]$
8-
^\s*IF fp == f4 THEN GOTO [0-9]$
9-
^\s*IF fp == f5 THEN GOTO [0-9]$
10-
^\s*IF fp == f6 THEN GOTO [0-9]$
11-
^\s*IF fp == f7 THEN GOTO [0-9]$
12-
^\s*IF fp == f8 THEN GOTO [0-9]$
13-
^\s*IF fp == f9 THEN GOTO [0-9]$
5+
^\s*IF fp == f1 THEN GOTO [0-9]+$
6+
^\s*IF fp == f2 THEN GOTO [0-9]+$
7+
^\s*IF fp == f3 THEN GOTO [0-9]+$
8+
^\s*IF fp == f4 THEN GOTO [0-9]+$
9+
^\s*IF fp == f5 THEN GOTO [0-9]+$
10+
^\s*IF fp == f6 THEN GOTO [0-9]+$
11+
^\s*IF fp == f7 THEN GOTO [0-9]+$
12+
^\s*IF fp == f8 THEN GOTO [0-9]+$
13+
^\s*IF fp == f9 THEN GOTO [0-9]+$
1414
^EXIT=0$
1515
^SIGNAL=0$
1616
--

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Author: Daniel Kroening, [email protected]
3131
#include <goto-programs/goto_convert_functions.h>
3232
#include <goto-programs/goto_inline.h>
3333
#include <goto-programs/initialize_goto_model.h>
34+
#include <goto-programs/instrument_preconditions.h>
3435
#include <goto-programs/link_to_library.h>
3536
#include <goto-programs/process_goto_program.h>
3637
#include <goto-programs/read_goto_binary.h>
@@ -876,25 +877,23 @@ bool goto_analyzer_parse_optionst::process_goto_program(
876877
// adding the library.
877878
remove_asm(goto_model);
878879

879-
#if 0
880880
// add the library
881881
log.status() << "Adding CPROVER library (" << config.ansi_c.arch << ")" << messaget::eom;
882882
link_to_library(
883883
goto_model, ui_message_handler, cprover_cpp_library_factory);
884884
link_to_library(goto_model, ui_message_handler, cprover_c_library_factory);
885885

886-
// these are commented out as well because without the library
887-
// this initialization code doesn’t make any sense
888886
add_malloc_may_fail_variable_initializations(goto_model);
889887

890-
#endif
891-
892888
// remove function pointers
893889
log.status() << "Removing function pointers and virtual functions"
894890
<< messaget::eom;
895891
remove_function_pointers(
896892
ui_message_handler, goto_model, cmdline.isset("pointer-check"));
897893

894+
// instrument library preconditions
895+
instrument_preconditions(goto_model);
896+
898897
// do partial inlining
899898
log.status() << "Partial Inlining" << messaget::eom;
900899
goto_partial_inline(goto_model, ui_message_handler);

0 commit comments

Comments
 (0)