Skip to content

Commit f1daa26

Browse files
author
Joel Allred
committed
Test for loop-less array init
1 parent 1c5d2bc commit f1daa26

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class NondetArrayPrimitive
2+
{
3+
void intArray(int[] array)
4+
{
5+
if (array != null && array.length > 1500 && array[1500] == 42) {
6+
assert false;
7+
}
8+
}
9+
10+
void floatArray(float[] array)
11+
{
12+
if (array != null && array.length > 1500 && array[1500] == 42.0) {
13+
assert false;
14+
}
15+
}
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
NondetArrayPrimitive.class
3+
--function NondetArrayPrimitive.floatArray --max-nondet-array-length 2000 --unwind 1
4+
^VERIFICATION FAILED$
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
line 13 assertion.*: FAILURE
8+
--
9+
Unwinding loop __CPROVER__start.0 iteration 2
10+
^warning: ignoring
11+
--
12+
Check no unwind needed to reach non-primitive array cell
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
NondetArrayPrimitive.class
3+
--function NondetArrayPrimitive.intArray --max-nondet-array-length 2000 --unwind 1
4+
^VERIFICATION FAILED$
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
line 6 assertion.*: FAILURE
8+
--
9+
Unwinding loop __CPROVER__start.0 iteration 2
10+
^warning: ignoring
11+
--
12+
Check no unwind needed to reach non-primitive array cell

0 commit comments

Comments
 (0)