Skip to content

Commit e70aa7d

Browse files
added two test cases into goto-instrument regression for checking array_copy
added two test cases related to array copy in the goto-instrument regression suite to further test the full-slice option
1 parent 27227cc commit e70aa7d

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdlib.h>
2+
#include <assert.h>
3+
4+
int main()
5+
{
6+
int *ptr=malloc(sizeof(int));
7+
*ptr=42;
8+
ptr=realloc(ptr, 20);
9+
assert(*ptr==42);
10+
11+
int *ptr2=malloc(2*sizeof(int));
12+
*ptr2=42;
13+
*(ptr2+1)=42;
14+
ptr2=realloc(ptr2, 20);
15+
assert(*ptr2==42);
16+
assert(*(ptr2+1)==42);
17+
18+
return 0;
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
main.c
3+
--full-slice --add-library
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <stdlib.h>
2+
#include <assert.h>
3+
4+
void foo(int argc)
5+
{
6+
void* x=0;
7+
8+
if(argc>3)
9+
x=malloc(4*sizeof(int));
10+
else
11+
x=malloc(3*sizeof(int));
12+
*(int*)x=42;
13+
14+
x=realloc(x, sizeof(int));
15+
16+
assert(*(int*)x==42);
17+
}
18+
19+
int main(int argc, char* argv[])
20+
{
21+
//__CPROVER_ASYNC_1:
22+
foo(argc);
23+
24+
return 0;
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
main.c
3+
--full-slice --add-library
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$

0 commit comments

Comments
 (0)