Skip to content

Commit 2281131

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 0ed6d89 commit 2281131

File tree

48 files changed

+83
-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.

48 files changed

+83
-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/NondetInit/test_lazy.desc

Lines changed: 1 addition & 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
--function Test.check --lazy-methods
44
^VERIFICATION SUCCESSFUL$

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 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)

regression/cbmc-java/lazyloading1/test.desc

Lines changed: 1 addition & 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.main
44
^EXIT=0$

regression/cbmc-java/lazyloading10/test.desc

Lines changed: 1 addition & 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
44
^EXIT=6$

regression/cbmc-java/lazyloading11/test.desc

Lines changed: 1 addition & 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$

regression/cbmc-java/lazyloading2/test.desc

Lines changed: 1 addition & 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.main
44
^EXIT=0$

regression/cbmc-java/lazyloading3/test.desc

Lines changed: 1 addition & 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.main
44
^EXIT=0$

regression/cbmc-java/lazyloading4/test.desc

Lines changed: 1 addition & 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
Main.class
33
--lazy-methods
44
^EXIT=0$

regression/cbmc-java/lazyloading5/test.desc

Lines changed: 1 addition & 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 --function test.main
44
^EXIT=0$

regression/cbmc-java/lazyloading6/test.desc

Lines changed: 1 addition & 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.setx
44
^EXIT=0$

regression/cbmc-java/lazyloading7/test.desc

Lines changed: 1 addition & 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'
44
^EXIT=0$

regression/cbmc-java/lazyloading8/test.desc

Lines changed: 1 addition & 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:(F)V'
44
^EXIT=0$

regression/cbmc-java/lazyloading9/test.desc

Lines changed: 1 addition & 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.*'
44
^EXIT=0$

regression/cbmc-java/lazyloading_array_parameter/test.desc

Lines changed: 1 addition & 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.g
44
^EXIT=0$

regression/cbmc-java/lazyloading_cyclic_class/test.desc

Lines changed: 1 addition & 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.test
44
^EXIT=0$

regression/cbmc-java/lazyloading_indirect_array_parameter/test.desc

Lines changed: 1 addition & 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.g
44
^EXIT=0$

regression/cbmc-java/lazyloading_indirect_generic_array_parameter/test.desc

Lines changed: 1 addition & 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.g
44
^EXIT=0$

regression/cbmc-java/lazyloading_inheritance/test.desc

Lines changed: 1 addition & 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.test
44
^EXIT=0$

regression/cbmc-java/lazyloading_inheritance_field/test.desc

Lines changed: 1 addition & 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.test
44
^EXIT=0$

regression/cbmc-java/lazyloading_multiple_array_types/test.desc

Lines changed: 1 addition & 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.check
44
^EXIT=0$

regression/cbmc-java/lazyloading_multiple_generic_parameters/test.desc

Lines changed: 1 addition & 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.g
44
^EXIT=0$

regression/cbmc-java/lazyloading_recursive_class/test.desc

Lines changed: 1 addition & 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.test
44
^EXIT=0$

regression/cbmc-java/lazyloading_synthetic_method_cleanup1/check_clinit_normally_present.desc

Lines changed: 1 addition & 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
--show-goto-functions --function Test.main
44
java::Unused::clinit_wrapper

regression/cbmc-java/lazyloading_synthetic_method_cleanup1/check_clinit_removed_by_lazy_loading.desc

Lines changed: 1 addition & 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 --show-goto-functions --function Test.main
44
--
Lines changed: 1 addition & 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 --function Test.main
44
VERIFICATION SUCCESSFUL

regression/cbmc-java/lazyloading_synthetic_method_cleanup2/check_clinit_normally_present.desc

Lines changed: 1 addition & 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
--show-goto-functions --function Test.main
44
java::Unused1::clinit_wrapper

regression/cbmc-java/lazyloading_synthetic_method_cleanup2/check_clinit_removed_by_lazy_loading.desc

Lines changed: 1 addition & 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 --show-goto-functions --function Test.main
44
--
Lines changed: 1 addition & 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 --function Test.main
44
VERIFICATION SUCCESSFUL

regression/cbmc-java/lazyloading_synthetic_method_cleanup3/check_clinit_normally_present.desc

Lines changed: 1 addition & 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
--show-goto-functions --function Test.main
44
java::Opaque\.<clinit>:\(\)V

regression/cbmc-java/lazyloading_synthetic_method_cleanup3/check_clinit_removed_by_lazy_loading.desc

Lines changed: 1 addition & 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 --show-goto-functions --function Test.main
44
--
Lines changed: 1 addition & 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 --function Test.main
44
VERIFICATION SUCCESSFUL
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
DetectSplitPackagesTask.class
33
--show-symbol-table
44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
--
8+
This doesn't work under lazy loading because no entry-point function is given.

regression/cbmc-java/lvt-unexpected/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
unexpected.class
33
--verbosity 10 --show-symbol-table
44
^EXIT=0$
@@ -10,3 +10,5 @@ expected by the bytecode to goto conversion algorithms. Namely, the live range
1010
of parameter x in that method is not preceeded by a store_i instruction, which
1111
is perfectly possibly as per the JVM specs but currently additionally required
1212
in CBMC.
13+
14+
This doesn't work under lazy loading because no entry-point function is given.
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
method_parameters.class
33
--verbosity 10 --show-symbol-table
44
^EXIT=0$
@@ -7,3 +7,5 @@ method_parameters.class
77
--
88
The purpose of the test is ensuring that the bytecode -> symbol table AST
99
generation happens correctly. The generated .class file does not contain LVTs.
10+
11+
This doesn't work under lazy loading because no entry-point function is given.

regression/cbmc-java/method_parmeters2/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
method_parameters.class
33
--verbosity 10 --show-symbol-table
44
^EXIT=0$
@@ -8,3 +8,5 @@ method_parameters.class
88
The purpose of the test is ensuring that the bytecode -> symbol table AST
99
generation happens correctly. The generated .class file DOES contain LVTs, i.e.,
1010
it has been compiled with with "javac -g".
11+
12+
This doesn't work under lazy loading because no entry-point function is given.
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
main.class
33
package_friendly1.class package_friendly2.class --show-goto-functions
44
^main[.]main[\(][\)].*$
@@ -7,3 +7,5 @@ package_friendly1.class package_friendly2.class --show-goto-functions
77
^SIGNAL=0$
88
--
99
^warning: ignoring
10+
--
11+
This doesn't work under lazy loading because no entry-point function is given.

regression/cbmc-java/remove_virtual_function_typecast/test.desc

Lines changed: 1 addition & 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
VirtualFunctions.class
33
--lazy-methods --java-max-vla-length 48 --unwind 8 --java-unwind-enum-static --trace --cover location --function VirtualFunctions.check --show-goto-functions
44
\(struct VirtualFunctions\$B \*\)a \. VirtualFunctions\$B\.f:\(\)V\(\);$

regression/cbmc-java/removed_virtual_functions/test.desc

Lines changed: 1 addition & 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
ArrayListEquals.class
33
--lazy-methods --java-max-vla-length 48 --unwind 8 --java-unwind-enum-static --trace --cover location --function ArrayListEquals.check2 --show-goto-functions
44
e2 . ArrayList\$Itr.hasNext:\(\)Z\(\);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
E.class
3-
--show-goto-functions
3+
--function E.f --show-goto-functions
44
IF.*"java::D"
55
IF.*"java::O"
66
IF.*"java::C"

regression/cbmc-java/virtual7/test.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ test.class
33
--show-goto-functions --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
6-
IF.*"java::C".*THEN GOTO [12]
7-
IF.*"java::D".*THEN GOTO [12]
8-
IF.*"java::A".*THEN GOTO [12]
6+
IF.*"java::C".*THEN GOTO
7+
IF.*"java::D".*THEN GOTO
8+
IF.*"java::A".*THEN GOTO
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+
"jbmc-strings-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/jbmc-strings/StringIndexOf/test.desc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ Test.class
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7-
--

regression/jbmc-strings/java_char_array_init/test.desc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ assertion.* file test_init.java line 31 .* SUCCESS$
77
assertion.* file test_init.java line 33 .* SUCCESS$
88
assertion.* file test_init.java line 35 .* FAILURE$
99
assertion.* file test_init.java line 37 .* FAILURE$
10-
--
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+
"strings-smoke-tests-symex-driven-lazy-loading"
7+
"$<TARGET_FILE:jbmc> --symex-driven-lazy-loading"
8+
"-C;-X;symex-driven-lazy-loading-expected-failure"
9+
"CORE"
10+
)

0 commit comments

Comments
 (0)