From: lenny.chiadmi-delage Date: Tue, 6 Jan 2026 16:47:47 +0000 (+0000) Subject: gccrs: Adds test of issue 1210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e2ef0d0c81ff6d1de817005e67fbe046107a485;p=thirdparty%2Fgcc.git gccrs: Adds test of issue 1210 Adds new test. Fixes Rust-GCC/gccrs#1210 gcc/testsuite/ChangeLog: * rust/compile/issue-1210.rs: New test. Signed-off-by: lenny.chiadmi-delage --- diff --git a/gcc/testsuite/rust/compile/issue-1210.rs b/gcc/testsuite/rust/compile/issue-1210.rs new file mode 100644 index 00000000000..87939586f78 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-1210.rs @@ -0,0 +1,26 @@ +enum E { + One, + Two, + Other +} + +fn foo (x: E) -> i32 { + let mut y = 0; + + match x { + E::One => { + y = 1, // { dg-error "expected .;. or .\}. after expression, found .,." "" {target *-*-*} 0 } + } + E::Two => { + y = 2; + } + _ => {} + } + + return y; +} + +fn main () { + let x = E::One; + let y = foo (x); +}