Skip to content

Commit 65c8fe2

Browse files
author
Thomas Kiley
committed
Add tests for checking loop heads
Even though the slicing removes all the assignments, the loop heads are maintained in the test
1 parent 38fd003 commit 65c8fe2

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CORE
2+
test.c
3+
--unwind 6 test.c --trace --xml-ui --partial-loops --slice-formula
4+
activate-multi-line-match
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
\s*<loop-head .*>\n\s* <location .* line="5" .*/>\n\s*</loop-head>\n\s*<loop-head .*>\n\s* <location .* line="5".*/>\n\s*</loop-head>\n
8+
--
9+
--
10+
Ensure even with sliced formulas, we get a location only step for
11+
each iteration of the loop (called loop-heads) when using partial loops.
12+
13+
This test is checking the following XML:(deleting the new lines
14+
after each \n to obtain the monster regex above).
15+
16+
\s*<loop-head .*>
17+
\s* <location .* line="5" .*/>
18+
\s*</loop-head>
19+
\s*<loop-head .*>
20+
\s* <location .* line="5".*/>
21+
\s*</loop-head>
22+

regression/cbmc/loophead-trace/test.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
void main(void)
2+
{
3+
int i = 0;
4+
5+
while(1)
6+
{
7+
i = 1;
8+
}
9+
10+
// invalid assertion
11+
assert(i == 0);
12+
}

0 commit comments

Comments
 (0)