Skip to content

Commit 8aa38e7

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 7b5d73b commit 8aa38e7

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
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: 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,6 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Main.class
33
--lazy-methods
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL
7+
--
8+
--
9+
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,6 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL
7+
--
8+
--
9+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading6/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.setx
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.setx:\(I\)V
88
--
99
CI lazy methods: elaborate java::test\.sety:\(I\)V
1010
CI lazy methods: elaborate java::test\.sety:\(F\)V
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading7/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'
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.sety:\(I\)V
88
--
99
CI lazy methods: elaborate java::test\.setx:\(I\)V
1010
CI lazy methods: elaborate java::test\.sety:\(F\)V
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading8/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:(F)V'
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.sety:\(F\)V
88
--
99
CI lazy methods: elaborate java::test\.sety:\(I\)V
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
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
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point 'test.*'
44
^EXIT=0$
@@ -7,3 +7,6 @@ VERIFICATION SUCCESSFUL
77
CI lazy methods: elaborate java::test\.setx:\(I\)V
88
CI lazy methods: elaborate java::test\.sety:\(I\)V
99
CI lazy methods: elaborate java::test\.sety:\(F\)V
10+
--
11+
--
12+
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,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.test
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::Base\.f:\(\)V
77
--
8+
--
9+
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,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
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,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
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.test
44
^EXIT=0$
@@ -7,3 +7,5 @@ elaborate java::Base\.f:\(\)V
77
--
88
elaborate java::Derived\.f:\(\)V
99
elaborate java::Middle\.f:\(\)V
10+
--
11+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.test
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::Base\.f:\(\)V
77
--
8+
--
9+
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.check
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::A\.f:\(\)I
77
elaborate java::B\.g:\(\)I
88
VERIFICATION SUCCESSFUL
9+
--
10+
--
11+
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,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading_nested_generic_parameters/test.desc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ The right methods are loaded, but verification is not successful
1111
because __CPROVER_start doesn't create appropriately typed input for
1212
this kind of nested generic parameter, so dynamic cast checks fail upon
1313
fetching the generic type's field.
14+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.test
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::Base\.f:\(\)V
77
--
8+
--
9+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

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
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --show-goto-functions --function Test.main
44
--
55
java::Unused::clinit_wrapper
66
Unused\.<clinit>\(\)
7+
--
8+
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,4 +1,7 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --function Test.main
44
VERIFICATION SUCCESSFUL
5+
--
6+
--
7+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

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
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --show-goto-functions --function Test.main
44
--
55
java::Unused1::clinit_wrapper
66
java::Unused2::clinit_wrapper
77
Unused2\.<clinit>\(\)
8+
--
9+
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,4 +1,7 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --function Test.main
44
VERIFICATION SUCCESSFUL
5+
--
6+
--
7+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

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
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --show-goto-functions --function Test.main
44
--
55
java::Opaque\.<clinit>:\(\)V
66
java::Opaque::clinit_wrapper
7+
--
8+
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,4 +1,7 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --function Test.main
44
VERIFICATION SUCCESSFUL
5+
--
6+
--
7+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

0 commit comments

Comments
 (0)