summaryrefslogtreecommitdiffstats
path: root/tests/ui/for-loop-while/liveness-loop-break.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/for-loop-while/liveness-loop-break.rs')
-rw-r--r--tests/ui/for-loop-while/liveness-loop-break.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/for-loop-while/liveness-loop-break.rs b/tests/ui/for-loop-while/liveness-loop-break.rs
new file mode 100644
index 000000000..60a63bccb
--- /dev/null
+++ b/tests/ui/for-loop-while/liveness-loop-break.rs
@@ -0,0 +1,13 @@
+// run-pass
+fn test() {
+ let v;
+ loop {
+ v = 3;
+ break;
+ }
+ println!("{}", v);
+}
+
+pub fn main() {
+ test();
+}