forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for multiple array types in single method
- Loading branch information
1 parent
5009cbb
commit 1e11f6d
Showing
7 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class A { | ||
|
||
public int f() { | ||
return 1; | ||
} | ||
|
||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class B { | ||
|
||
public int g() { | ||
return 5; | ||
} | ||
|
||
} |
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
regression/cbmc-java/lazyloading_multiple_array_types/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
public class Test { | ||
|
||
A[] arrayA; | ||
B[] arrayB; | ||
|
||
public static void check(Test t) { | ||
if (t == null || t.arrayA == null || t.arrayB == null || | ||
t.arrayA.length == 0 || t.arrayB.length == 0 || | ||
t.arrayA[0] == null || t.arrayB[0] == null) | ||
return; | ||
int i = t.arrayA[0].f(); | ||
int j = t.arrayB[0].g(); | ||
int sum = i + j; | ||
assert(sum == 6); | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
regression/cbmc-java/lazyloading_multiple_array_types/test.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
Test.class | ||
--lazy-methods --verbosity 10 --function Test.check | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
elaborate java::A\.f:\(\)I | ||
elaborate java::B\.g:\(\)I | ||
VERIFICATION SUCCESSFUL |