Skip to content

Commit 41629be

Browse files
committed
Add incremental smt2 with null pointers regression test
1 parent 908d76e commit 41629be

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <assert.h>
2+
#include <inttypes.h>
3+
#include <stdbool.h>
4+
#include <stddef.h>
5+
6+
int main()
7+
{
8+
int notdet_int;
9+
int *ptr;
10+
bool notdet_bool;
11+
if(notdet_bool)
12+
{
13+
ptr = &notdet_int;
14+
assert(((uint64_t)ptr) > 1);
15+
}
16+
else
17+
{
18+
ptr = NULL;
19+
}
20+
assert(((uint64_t)ptr) != 0);
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CORE
2+
null_pointer.c
3+
--trace
4+
Passing problem to incremental SMT2 solving
5+
line 14 assertion \(\(uint64_t\)ptr\) > 1: SUCCESS
6+
line 20 assertion \(\(uint64_t\)ptr\) != 0: FAILURE
7+
notdet_bool=FALSE \(0+\)
8+
^EXIT=10$
9+
^SIGNAL=0$
10+
--
11+
notdet_bool=TRUE
12+
--
13+
Tests for null related functionality.
14+
* Assignment of the value NULL to a pointer.
15+
* Comparison of NULL pointer value against 0.
16+
* Check that the address of a non-null pointer is not an offset into the NULL
17+
object.

0 commit comments

Comments
 (0)