summaryrefslogtreecommitdiff
path: root/Test/aitest0/Intervals.bpl
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2013-05-30 14:17:40 -0700
committerGravatar Rustan Leino <unknown>2013-05-30 14:17:40 -0700
commitecd49b32f40d6a0683beb89a8ae7cc2ba40d853f (patch)
tree2ebe0022174a49e76c0365c8cdfc4e65378c6f1c /Test/aitest0/Intervals.bpl
parent6a9e8449f14e8c3858ab0809036e68a0a43c2d4e (diff)
Fixed bug in Interval abstract domain (pertaining to unary negation)
Diffstat (limited to 'Test/aitest0/Intervals.bpl')
-rw-r--r--Test/aitest0/Intervals.bpl18
1 files changed, 18 insertions, 0 deletions
diff --git a/Test/aitest0/Intervals.bpl b/Test/aitest0/Intervals.bpl
index 7ed2c3d2..4520a032 100644
--- a/Test/aitest0/Intervals.bpl
+++ b/Test/aitest0/Intervals.bpl
@@ -73,3 +73,21 @@ procedure Thresholds4()
assert i * 2 == 400; // error: this would hold in an execution, but /infer:j is too weak to infer invariant i<=200
}
+procedure UnaryNegation0() returns (x: int) // this was once buggy
+{
+ x := -1;
+ loop_head:
+ x := x;
+ goto loop_head, after_loop;
+ after_loop:
+ assert x == -1;
+}
+procedure UnaryNegation1() returns (x: int) // this was once buggy
+{
+ x := -1;
+ loop_head:
+ x := x;
+ goto loop_head, after_loop;
+ after_loop:
+ assert x == 1; // error
+}