diff options
Diffstat (limited to 'gcc/testsuite/rust/compile/break2.rs')
-rw-r--r-- | gcc/testsuite/rust/compile/break2.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/break2.rs b/gcc/testsuite/rust/compile/break2.rs new file mode 100644 index 0000000..5ac806a --- /dev/null +++ b/gcc/testsuite/rust/compile/break2.rs @@ -0,0 +1,15 @@ +fn main() { + let mut a = 1; + let mut b = 1; + + let mut c; + while b > 10 { + if (b == 2) { + break b; // { dg-error "can only break with a value inside 'loop'" } + // { dg-error "failed to type resolve expression" "" { target *-*-* } .-1 } + } + c = a + b; + a = b; + b = c; + } +} |