Skip to content

Commit aa5fcda

Browse files
authored
Merge pull request #4885 from danpoe/feature/constant-propagate-string-concatenation
[TG-8293] Constant propagation for empty strings and string concatenation [blocks: #4941]
2 parents d4e0bd0 + d9f75eb commit aa5fcda

File tree

48 files changed

+760
-60
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

+760
-60
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public class Main {
2+
public void test() {
3+
String s1 = "abc";
4+
String s2 = "xyz";
5+
String s3 = s1 + s2;
6+
assert s3.equals("abcxyz");
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
Main.class
3+
--function Main.test --property "java::Main.test:()V.assertion.1" --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
^VERIFICATION SUCCESSFUL$
8+
--
9+
--
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
public class Main {
2+
public void test1() {
3+
String s1 = "abc";
4+
String s2 = "xyz";
5+
String s3 = s1 + s2;
6+
assert s3.length() == 7;
7+
}
8+
9+
public void test2() {
10+
String s1 = "abc";
11+
String s2 = "xyz";
12+
String s3 = s1 + s2;
13+
assert s3.startsWith("abcdefg");
14+
}
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Main.class
3+
--function Main.test1
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
--
8+
--
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Main.class
3+
--function Main.test2
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
--
8+
--
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public class Main {
2+
public void test() {
3+
String s1 = "ディフ";
4+
String s2 = "ブルー";
5+
String s3 = s1 + s2;
6+
assert s3.length() == 6;
7+
assert s3.startsWith("ディフブルー");
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
Main.class
3+
--function Main.test --property "java::Main.test:()V.assertion.1" --property "java::Main.test:()V.assertion.2"
4+
^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
^VERIFICATION SUCCESSFUL$
8+
--
9+
--

0 commit comments

Comments
 (0)