]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: testsuite: Adds test from issue
authorlenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr>
Thu, 8 Jan 2026 11:25:14 +0000 (11:25 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Fri, 27 Feb 2026 14:57:04 +0000 (15:57 +0100)
As the issue as been resolved, i just added the test from the issue.

Fixes Rust-GCC/gccrs#1081

gcc/testsuite/ChangeLog:

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

Signed-off-by: lenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr>
gcc/testsuite/rust/compile/issue-1081.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/issue-1081.rs b/gcc/testsuite/rust/compile/issue-1081.rs
new file mode 100644 (file)
index 0000000..09daf78
--- /dev/null
@@ -0,0 +1,13 @@
+// { dg-additional-options "-w" }
+enum Foo {
+    A,
+    B,
+}
+
+fn inspect(f: Foo, g: u8) {
+    match (f, g) {
+        (Foo::A, 1) => {}
+        (Foo::B, 2) => {}
+        _ => {}
+    }
+}