Skip to content

Commit 02224b3

Browse files
peterschrammelgiulio-garbi
authored andcommitted
Add --nondet-static-matching regex option to goto-instrument
1 parent 5ad4962 commit 02224b3

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

doc/man/goto-instrument.1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ add nondeterministic initialization of variables with static lifetime
392392
same as nondet\-static except for the variable \fIe\fR
393393
(use multiple times if required)
394394
.TP
395+
\fB\-\-nondet\-static\-matching\fR \fIr\fR
396+
add nondeterministic initialization of variables
397+
with static lifetime matching regex \fIr\fR
398+
.TP
395399
\fB\-\-function\-enter\fR \fIf\fR
396400
.TQ
397401
\fB\-\-function\-exit\fR \fIf\fR

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ int goto_instrument_parse_optionst::doit()
154154
}
155155
}
156156

157+
// ignore default/user-specified initialization
158+
// of matching variables with static lifetime
159+
if(cmdline.isset("nondet-static-matching"))
160+
{
161+
log.status() << "Adding nondeterministic initialization "
162+
"of matching static/global variables"
163+
<< messaget::eom;
164+
nondet_static_matching(
165+
goto_model, cmdline.get_value("nondet-static-matching"));
166+
}
167+
157168
instrument_goto_program();
158169

159170
if(cmdline.isset("validate-goto-model"))
@@ -1898,6 +1909,8 @@ void goto_instrument_parse_optionst::help()
18981909
" --nondet-static add nondeterministic initialization of variables with static lifetime\n" // NOLINT(*)
18991910
" --nondet-static-exclude e same as nondet-static except for the variable e\n" //NOLINT(*)
19001911
" (use multiple times if required)\n"
1912+
" --nondet-static-matching r add nondeterministic initialization of variables\n"
1913+
" with static lifetime matching regex r\n"
19011914
" --function-enter <f>, --function-exit <f>, --branch <f>\n"
19021915
" instruments a call to <f> at the beginning,\n" // NOLINT(*)
19031916
" the exit, or a branch point, respectively\n"

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Author: Daniel Kroening, [email protected]
6565
"(isr):" \
6666
"(stack-depth):(nondet-static)" \
6767
"(nondet-static-exclude):" \
68+
"(nondet-static-matching):" \
6869
"(function-enter):(function-exit):(branch):" \
6970
OPT_SHOW_GOTO_FUNCTIONS \
7071
OPT_SHOW_PROPERTIES \

0 commit comments

Comments
 (0)