forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for if-then-else optimisation in goto convert
The optimisation has been inadvertently broken by 199d4cc due to lack of a regression test.
- Loading branch information
1 parent
8e6244c
commit d433438
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public class Test { | ||
|
||
public int foo(int i) { | ||
int x = 0; | ||
if (i > 0) { | ||
x++; | ||
} | ||
else | ||
{ | ||
x--; | ||
} | ||
return x + 1000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
KNOWNBUG | ||
Test.class | ||
--show-goto-functions --function Test.foo | ||
activate-multi-line-match | ||
EXIT=0 | ||
SIGNAL=0 | ||
IF \w* <= 0 THEN GOTO 1\n\s*//.*\n\s*//.*\n\s*\w*:: | ||
-- | ||
IF !\(\w* <= 0\) THEN GOTO 1\n\s*//.*\n.*GOTO 2\n\s*//.*\n\s*//.*\n\s*1: \w*:: | ||
^warning: ignoring |