Skip to content

Commit 046ed40

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
Regression test for null-pointer optimisation
This is to guard against the regression earlier introduced in #4444 (and reverted in #4656).
1 parent d00b242 commit 046ed40

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

regression/cbmc/null4/main.c

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
int main()
2+
{
3+
void *ptr;
4+
if(ptr == 0)
5+
{
6+
return 0;
7+
}
8+
__CPROVER_assert(ptr != 0, "null");
9+
}

regression/cbmc/null4/test.desc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
Pull request #4444 introduced optimisations during symbolic execution that
11+
caused this test to spuriously fail (as the branch `ptr == 0` was removed).

0 commit comments

Comments
 (0)