Skip to content

Commit 4da8871

Browse files
author
Daniel Kroening
committed
test for issue #188
1 parent d7bcd08 commit 4da8871

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

regression/cbmc/Pointer_array5/main.c

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <assert.h>
2+
#include <stdlib.h>
3+
4+
extern int nondet_int();
5+
6+
int main() {
7+
8+
int arraylen=nondet_int();
9+
10+
if(arraylen==3)
11+
{
12+
int** array_init = malloc(sizeof(int *)*arraylen);
13+
14+
int a0, a1, a2;
15+
16+
array_init[0] = &a0;
17+
array_init[1] = &a1;
18+
array_init[2] = &a2;
19+
20+
void **local_array=(void**)array_init;
21+
22+
int *address=(int *)local_array[0];
23+
assert(address==&a0);
24+
}
25+
26+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring

0 commit comments

Comments
 (0)