Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
0e3ee39c41462652f41993a5610265abea6daa96
rust/src/test/run-pass/while-loop-constraints-2.rs

16 lines
209 B
Rust
Raw Normal View History

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.
2011-06-27 18:12:37 -07:00
// xfail-stage0
fn main() {
let int y = 42;
let int z = 42;
let int x;
while (z < 50) {
Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.
2011-07-13 15:44:09 -07:00
z += 1;
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.
2011-06-27 18:12:37 -07:00
while (false) {
x <- y;
y = z;
}
log y;
}
assert (y == 42 && z == 50);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 169ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API