Skip to content

Commit 28a878f

Browse files
committed
Add tests for symex-driven lazy loading
This adds variants of the three test directories that use JBMC (cbmc-java, jbmc-strings and strings-smoke-tests) to run with --symex-driven-lazy-loading, except for the small number of tests that are expected to fail for harmless reasons, and one that is expected to fail and which may be a bug (strings-smoke-tests/java_append_char).
1 parent 698d21a commit 28a878f

File tree

52 files changed

+164
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+164
-47
lines changed

regression/cbmc-java/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
add_test_pl_tests(
22
"$<TARGET_FILE:jbmc>"
33
)
4+
5+
add_test_pl_profile(
6+
"cbmc-java-symex-driven-lazy-loading"
7+
"$<TARGET_FILE:jbmc> --symex-driven-lazy-loading"
8+
"-C;-X;symex-driven-lazy-loading-expected-failure"
9+
"CORE"
10+
)

regression/cbmc-java/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ default: tests.log
22

33
test:
44
@../test.pl -p -c ../../../src/jbmc/jbmc
5+
@../test.pl -p -c "../../../src/jbmc/jbmc --symex-driven-lazy-loading" -X symex-driven-lazy-loading-expected-failure
56

67
tests.log: ../test.pl
78
@../test.pl -p -c ../../../src/jbmc/jbmc
9+
@../test.pl -p -c "../../../src/jbmc/jbmc --symex-driven-lazy-loading" -X symex-driven-lazy-loading-expected-failure
810

911
show:
1012
@for dir in *; do \
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--function Test.check --lazy-methods
44
^VERIFICATION SUCCESSFUL$
55
--
6+
--
7+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/covered1/test.desc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
covered1.class
33
--cover location --json-ui --show-properties
44
^EXIT=0$
@@ -25,3 +25,5 @@ covered1.class
2525
.*\"coveredLines\": \"35\",$
2626
--
2727
^warning: ignoring
28+
--
29+
This fails with symex-driven lazy loading because it does not currently support --show-properties.

regression/cbmc-java/generic_class_bound1/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Gn.class
33
--cover location
44
^EXIT=0$
@@ -9,3 +9,6 @@ Gn.class
99
.*file Gn.java line 11 function java::Gn.foo1:\(LGn;\)V bytecode-index 5 block 3: FAILED
1010
.*file Gn.java line 13 function java::Gn.main:\(\[Ljava/lang/String;\)V bytecode-index 2 block 2: SATISFIED
1111
--
12+
--
13+
This fails under symex-driven lazy loading because the FAILED blocks occur in functions that are unreachable
14+
from the entry point, so with symex-driven loading the functions foo1 and the constructor don't get created at all.

regression/cbmc-java/jsr1/test.desc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap.class
33
--show-goto-functions
44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
\\"statement\\" \(\\"jsr\\"\)
88
\\"statement\\" \(\\"ret\\"\)
9+
--
10+
This doesn't work under symex-driven lazy loading because no entry-point function is given.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
SymStream.class
33
--verbosity 10 --show-goto-functions
44
^EXIT=0
55
^SIGNAL=0
66
--
77
--
88
just to test that it doesn't crash in this situation, cf. TG-2684
9+
Doesn't work with symex-driven loading because there is no entry point (we want to load the entire class)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::A\.f:\(\)V
77
--
88
elaborate java::B\.g:\(\)V
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point test.sety
44
^EXIT=6$
55
^SIGNAL=0$
66
entry point 'test\.sety' is ambiguous between:
77
test\.sety:\(I\)V
88
test\.sety:\(F\)V
9+
--
10+
--
11+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading11/test.desc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point 'test.sety:(I)V' --lazy-methods-extra-entry-point 'test.sety:(F)V'
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.sety:\(I\)V
88
CI lazy methods: elaborate java::test\.sety:\(F\)V
99
--
1010
CI lazy methods: elaborate java::test\.setx:\(I\)V
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

0 commit comments

Comments
 (0)