Skip to content

Commit 5a6e58b

Browse files
authored
Merge pull request #5006 from yumibagge/yb/jbmc-regression-tg-2479
Add regression test for TG-2479
2 parents fdf114e + 4b296f2 commit 5a6e58b

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
180 Bytes
Binary file not shown.
1.3 KB
Binary file not shown.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
public class LambdaBasic {
2+
3+
private boolean endOnSuccess = true;
4+
5+
public void testThis(int branch) {
6+
boolean endOnSuccess;
7+
endOnSuccess = this.endOnSuccess;
8+
If boo = () -> {
9+
if (endOnSuccess) {
10+
return 1;
11+
}
12+
return 0;
13+
};
14+
15+
int x0 = boo.xInt();
16+
// assert successful
17+
if (branch == 1) {
18+
if (endOnSuccess) {
19+
assert x0 == 1;
20+
} else {
21+
assert x0 == 0;
22+
}
23+
// assert failed
24+
} else {
25+
if (endOnSuccess) {
26+
assert x0 != 1;
27+
} else {
28+
assert x0 != 0;
29+
}
30+
}
31+
}
32+
33+
interface If {
34+
35+
int xInt();
36+
}
37+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CORE
2+
LambdaBasic.class
3+
--function LambdaBasic.testThis --property 'java::LambdaBasic.testThis:(I)V.assertion.1' --property 'java::LambdaBasic.testThis:(I)V.assertion.2' --property 'java::LambdaBasic.testThis:(I)V.assertion.3' --property 'java::LambdaBasic.testThis:(I)V.assertion.4'
4+
line 19 assertion.*SUCCESS$
5+
line 21 assertion.*SUCCESS$
6+
line 26 assertion.*FAILURE$
7+
line 28 assertion.*FAILURE$
8+
^EXIT=10$
9+
^SIGNAL=0$
10+
--
11+
--
12+
This test is a minimised example reported in TG-2479 and fixed during lambda
13+
development.

0 commit comments

Comments
 (0)