Skip to content

Commit 839f0f0

Browse files
authored
Merge pull request #5629 from martin-cs/feature/verify-prints-history
goto_analyzer --verify now prints histories in the XML and JSON output
2 parents 56c3c76 + 6d54f18 commit 839f0f0

File tree

4 files changed

+315
-247
lines changed

4 files changed

+315
-247
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
main.c
3+
--verify --recursive-interprocedural --one-domain-per-history --vsd --branching 4 --json -
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
\"falseHistories\": \[ \"local_control_flow_history : location \d+ after \d+ not taken after \d+ taken\" \]
7+
\"unknownHistories\": \[ \"local_control_flow_history : location \d+ after \d+ taken after \d+ taken\" \]
8+
--
9+
^warning: ignoring
10+
--
11+
Make sure that the JSON output contains the histories in which the assertion is false and unknown
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <assert.h>
2+
3+
int main(int argc, char **argv)
4+
{
5+
int nondet1;
6+
int nondet2;
7+
int x;
8+
9+
if(nondet1)
10+
{
11+
// Taking this path the assertion clearly holds
12+
x = 1;
13+
}
14+
else
15+
{
16+
if(nondet2)
17+
{
18+
// Taking this path the assertion clearly fails
19+
x = 0;
20+
}
21+
// Not taking the branch means the assertion is unknown
22+
// because x is non-deterministic
23+
}
24+
25+
assert(x);
26+
27+
return 0;
28+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
main.c
3+
--verify --recursive-interprocedural --one-domain-per-history --vsd --branching 4 --xml -
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
<history>local_control_flow_history : location \d+ after \d+ taken after \d+ taken<\/history>
7+
<history>local_control_flow_history : location \d+ after \d+ not taken after \d+ taken<\/history>
8+
--
9+
^warning: ignoring
10+
--
11+
Make sure that the JSON output contains the histories in which the assertion is false and unknown

0 commit comments

Comments
 (0)