From: "lenny.chiadmi-delage" <[email protected]>

Adds new test.

Fixes Rust-GCC/gccrs#1210

gcc/testsuite/ChangeLog:

        * rust/compile/issue-1210.rs: New test.

Signed-off-by: lenny.chiadmi-delage <[email protected]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/17231c82d4b1d56e93d6ade92b1dfa80b4c2c2e8

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4363

 gcc/testsuite/rust/compile/issue-1210.rs | 26 ++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/issue-1210.rs

diff --git a/gcc/testsuite/rust/compile/issue-1210.rs 
b/gcc/testsuite/rust/compile/issue-1210.rs
new file mode 100644
index 000000000..87939586f
--- /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);
+}
-- 
2.52.0

Reply via email to