Tests for while loops that may invalidate constraints
Wrote some small test cases that use while loops and moves, to make sure the poststate for the loop body gets propagated into the new prestate and deinitialization gets reflected. Along with that, rewrite the code for intersecting states. I still find it dodgy, but I guess I'll continue trying to add more tests. Also, I'll probably feel better about it once I start formalizing the algorithm.
This commit is contained in:
parent
6d1050b1c7
commit
85b5b2a8e4
9 changed files with 200 additions and 96 deletions
17
src/test/compile-fail/do-while-constraints.rs
Normal file
17
src/test/compile-fail/do-while-constraints.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
// xfail-stage0
|
||||
// error-pattern: Unsatisfied precondition constraint (for example, init(y
|
||||
fn main() {
|
||||
|
||||
let int y = 42;
|
||||
let int x;
|
||||
do {
|
||||
log y;
|
||||
do {
|
||||
do {
|
||||
do {
|
||||
x <- y;
|
||||
} while (true);
|
||||
} while (true);
|
||||
} while (true);
|
||||
} while (true);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue