Skip to content

Commit 16f63e8

Browse files
authored
Merge pull request #4781 from danpoe/feature/simplify-expression-index-of
[TG-8284] Expression simplification for indexOf()
2 parents 1e5fd65 + 7b7d526 commit 16f63e8

File tree

25 files changed

+290
-1
lines changed

25 files changed

+290
-1
lines changed
846 Bytes
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
public class Main {
2+
public void constantIndexOf() {
3+
String s1 = "abcabc";
4+
String s2 = "bc";
5+
assert s1.indexOf(s2) == 1;
6+
assert s1.indexOf(s2, -10) == 1;
7+
assert s1.indexOf("") == 0;
8+
assert s1.indexOf(s2, 3) == 4;
9+
assert s1.indexOf("cd") == -1;
10+
assert s1.indexOf(s2, 10) == -1;
11+
assert s1.indexOf("", 10) == -1;
12+
}
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE symex-driven-lazy-loading-expected-failure
2+
Main.class
3+
--function Main.constantIndexOf
4+
^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$
5+
^VERIFICATION SUCCESSFUL$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
--
725 Bytes
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class Main {
2+
public void constantIndexOf() {
3+
String s1 = "abcabc";
4+
assert s1.indexOf('b') == 1;
5+
assert s1.indexOf('b', -10) == 1;
6+
assert s1.indexOf('b', 3) == 4;
7+
assert s1.indexOf('d') == -1;
8+
assert s1.indexOf('b', 10) == -1;
9+
}
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE symex-driven-lazy-loading-expected-failure
2+
Main.class
3+
--function Main.constantIndexOf
4+
^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$
5+
^VERIFICATION SUCCESSFUL$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
--
629 Bytes
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public class Main {
2+
public void constantIndexOf(String arg) {
3+
String s1 = "abcabc";
4+
assert s1.indexOf(arg, 10) == -1;
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE symex-driven-lazy-loading-expected-failure
2+
Main.class
3+
--function Main.constantIndexOf --property "java::Main.constantIndexOf:(Ljava/lang/String;)V.assertion.1"
4+
^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$
5+
^VERIFICATION SUCCESSFUL$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
--
Binary file not shown.

0 commit comments

Comments
 (0)