]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add test case to show issue is fixed
authorPhilip Herron <herron.philip@googlemail.com>
Fri, 11 Jul 2025 11:20:04 +0000 (12:20 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:55 +0000 (16:36 +0200)
Fixes Rust-GCC#1048

gcc/testsuite/ChangeLog:

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

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/testsuite/rust/compile/issue-1048.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/issue-1048.rs b/gcc/testsuite/rust/compile/issue-1048.rs
new file mode 100644 (file)
index 0000000..8d4053a
--- /dev/null
@@ -0,0 +1,8 @@
+macro_rules! maybe_return { ($e:expr) => ($e); }
+
+fn frob(x: i32) -> i32{
+    maybe_return! {x}
+    // { dg-error "mismatched types. expected .... but got .i32. .E0308." "" { target *-*-* } .-1 }
+    // should return -1 
+    -1
+}