Skip to content

Add regression test for TG-2479 #5006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added jbmc/regression/jbmc/lambda4/LambdaBasic$If.class
Binary file not shown.
Binary file added jbmc/regression/jbmc/lambda4/LambdaBasic.class
Binary file not shown.
37 changes: 37 additions & 0 deletions jbmc/regression/jbmc/lambda4/LambdaBasic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
public class LambdaBasic {

private boolean endOnSuccess = true;

public void testThis(int branch) {
boolean endOnSuccess;
endOnSuccess = this.endOnSuccess;
If boo = () -> {
if (endOnSuccess) {
return 1;
}
return 0;
};

int x0 = boo.xInt();
// assert successful
if (branch == 1) {
if (endOnSuccess) {
assert x0 == 1;
} else {
assert x0 == 0;
}
// assert failed
} else {
if (endOnSuccess) {
assert x0 != 1;
} else {
assert x0 != 0;
}
}
}

interface If {

int xInt();
}
}
13 changes: 13 additions & 0 deletions jbmc/regression/jbmc/lambda4/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CORE
LambdaBasic.class
--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'
line 19 assertion.*SUCCESS$
line 21 assertion.*SUCCESS$
line 26 assertion.*FAILURE$
line 28 assertion.*FAILURE$
^EXIT=10$
^SIGNAL=0$
--
--
This test is a minimised example reported in TG-2479 and fixed during lambda
development.