Skip to content

Commit 0b09ffa

Browse files
committed
Test to make sure generics do not result in constant propagation failure
This was fine with develop with and without simplification after dereferencing, but would break if removing base_type_eq without adding the simplification step.
1 parent 73fadb3 commit 0b09ffa

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
public class Test {
2+
public static void main() {
3+
Generic<Integer> g = new GenericSub<Integer>();
4+
5+
int x = 0;
6+
for(int i = 0; i < 1000; ++i)
7+
x += g.get();
8+
9+
assert x == 0;
10+
}
11+
}
12+
13+
class Generic<T> {
14+
T key;
15+
int x;
16+
17+
public int get() { return 0; }
18+
19+
public Generic() {
20+
key = null;
21+
x = 5;
22+
}
23+
}
24+
25+
class GenericSub<S> extends Generic<S> {
26+
public int get() { return x; }
27+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
Test.class
3+
--function Test.main --show-vcc
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\{-\d+\} symex_dynamic::dynamic_object1#3 = \{ \{ \{ "java::GenericSub" \}, NULL, 0 \} \}$
7+
^\{-\d+\} symex_dynamic::dynamic_object1#4 = \{ \{ \{ "java::GenericSub" \}, NULL, 5 \} \}$
8+
--
9+
byte_extract_(big|little)_endian
10+
--
11+
The use of generics should not result in any byte_extract operations being
12+
generated for this test.

0 commit comments

Comments
 (0)