Skip to content

Commit 701bf9c

Browse files
author
Enrico Steffinlongo
committed
Fix regression tests failing after removing redundant if components
This commit fixes the regression tests failing because of the optimization to the way `if` statements are translated to GOTO. Specifically it fixes - the expected result of `--cover location` in 2 `cbmc-cover` regression tests - the index of blocks in 3 regression tests from `cbmc` and `cprover`.
1 parent 90b86f2 commit 701bf9c

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

regression/cbmc-cover/block-coverage-report1/test.desc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ main.c
33
--cover location
44
block 1 \(lines main.c:main:3,5\): SATISFIED
55
block 2 \(lines main.c:main:6\): SATISFIED
6-
block 3 \(lines main.c:main:6,9\): FAILED
7-
block 4 \(lines main.c:main:8\): SATISFIED
8-
block 5 \(lines main.c:main:9\): SATISFIED
6+
block 3 \(lines main.c:main:8\): SATISFIED
7+
block 4 \(lines main.c:main:9\): SATISFIED
98
^EXIT=0$
109
^SIGNAL=0$
1110
--

regression/cbmc-cover/built-ins1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--cover location --unwind 1
44
^EXIT=0$
55
^SIGNAL=0$
6-
^\*\* 5 of 8 covered
6+
^\*\* 5 of 7 covered
77
--
88
^warning: ignoring
99
^\[.*<builtin-library-

regression/cbmc/destructors/compound_literal.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CORE new-smt-backend
22
main.c
33
--unwind 10 --show-goto-functions
44
activate-multi-line-match
5-
(?P<comment_block>\/\/ [0-9]+ file main\.c line [0-9]+ function main)[\s]*DEAD .*newAlloc0[\s]*(?P>comment_block)[\s]*DEAD .*pc[\s]*(?P>comment_block)[\s]*DEAD .*literal[\s]*(?P>comment_block)[\s]*9: END_FUNCTION
5+
(?P<comment_block>\/\/ [0-9]+ file main\.c line [0-9]+ function main)[\s]*DEAD .*newAlloc0[\s]*(?P>comment_block)[\s]*DEAD .*pc[\s]*(?P>comment_block)[\s]*DEAD .*literal[\s]*(?P>comment_block)[\s]*8: END_FUNCTION
66
^EXIT=0$
77
^SIGNAL=0$
88
--
@@ -16,7 +16,7 @@ Checks for:
1616
// 51 file main.c line 44 function main
1717
DEAD main::$tmp::literal
1818
// 52 file main.c line 45 function main
19-
9: END_FUNCTION
19+
8: END_FUNCTION
2020

2121
This asserts that when you've created a compound literal that both temp and real
2222
variable gets killed.

regression/cbmc/destructors/enter_lexical_block.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ CORE new-smt-backend
22
main.c
33
--unwind 10 --show-goto-functions
44
activate-multi-line-match
5-
(?P<comment_block>\/\/ [0-9]+ file main\.c line [0-9]+ function main)[\s]*6: .*newAlloc4 : struct tag-test[\s]*(?P>comment_block)[\s]*.*newAlloc4 := \{ 4 \}[\s]*(?P>comment_block)[\s]*.*newAlloc6 : struct tag-test[\s]*(?P>comment_block)[\s]*.*newAlloc6 := \{ 6 \}[\s]*(?P>comment_block)[\s]*.*newAlloc7 : struct tag-test[\s]*(?P>comment_block)[\s]*.*newAlloc7 := \{ 7 \}[\s]*(?P>comment_block)[\s]*GOTO 3
5+
(?P<comment_block>\/\/ [0-9]+ file main\.c line [0-9]+ function main)[\s]*5: .*newAlloc4 : struct tag-test[\s]*(?P>comment_block)[\s]*.*newAlloc4 := \{ 4 \}[\s]*(?P>comment_block)[\s]*.*newAlloc6 : struct tag-test[\s]*(?P>comment_block)[\s]*.*newAlloc6 := \{ 6 \}[\s]*(?P>comment_block)[\s]*.*newAlloc7 : struct tag-test[\s]*(?P>comment_block)[\s]*.*newAlloc7 := \{ 7 \}[\s]*(?P>comment_block)[\s]*GOTO 3
66
^EXIT=0$
77
^SIGNAL=0$
88
--
99
--
1010
Checks for:
1111

1212
// 37 file main.c line 36 function main
13-
6: DECL main::1::2::2::newAlloc4 : struct tag-test
13+
5: DECL main::1::2::2::newAlloc4 : struct tag-test
1414
// 38 file main.c line 36 function main
1515
ASSIGN main::1::2::2::newAlloc4 := { 4 }
1616
// 39 file main.c line 37 function main

regression/cprover/loops/while-break1.desc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ while-break1.c
33
--text --solve --inline
44
^EXIT=0$
55
^SIGNAL=0$
6-
^\(\d+\) ∀ ς : state \. S18\(ς\) ⇒ S12in\(ς\)$
6+
^\(\d+\) ∀ ς : state \. S15T\(ς\) ⇒ S12in\(ς\)$
77
^\(\d+\) ∀ ς : state \. S11\(ς\) ⇒ S12in\(ς\)$
88
^\(\d+\) ∀ ς : state \. \(S12in\(ς\) ∧ ¬\(1 ≠ 0\)\) ⇒ S12T\(ς\)$
99
^\(\d+\) ∀ ς : state \. \(S12in\(ς\) ∧ 1 ≠ 0\) ⇒ S12\(ς\)$
10-
^\(\d+\) ∀ ς : state \. \(S12\(ς\) ∧ ¬\(ς\(❝main::1::x❞\) = 0\)\) ⇒ S13T\(ς\)$
11-
^\(\d+\) ∀ ς : state \. \(S12\(ς\) ∧ ς\(❝main::1::x❞\) = 0\) ⇒ S13\(ς\)$
12-
^\(\d+\) ∀ ς : state \. S12T\(ς\) ⇒ S19in\(ς\)$
13-
^\(\d+\) ∀ ς : state \. S14\(ς\) ⇒ S19in\(ς\)$
14-
^\(\d+\) ∀ ς : state \. S16\(ς\) ⇒ S19in\(ς\)$
10+
^\(\d+\) ∀ ς : state \. \(S12\(ς\) ∧ ς\(❝main::1::x❞\) = 0\) ⇒ S13T\(ς\)$
11+
^\(\d+\) ∀ ς : state \. \(S12\(ς\) ∧ ¬\(ς\(❝main::1::x❞\) = 0\)\) ⇒ S13\(ς\)$
12+
^\(\d+\) ∀ ς : state \. S12T\(ς\) ⇒ S17in\(ς\)$
13+
^\(\d+\) ∀ ς : state \. S13T\(ς\) ⇒ S17in\(ς\)$
14+
^\(\d+\) ∀ ς : state \. S16\(ς\) ⇒ S17in\(ς\)$
1515
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
1616
--
1717
--

0 commit comments

Comments
 (0)