[COMMITTED 022/101] gccrs: Add a test regular variadic functions errors

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Tue Jan 30 12:06:38 GMT 2024


From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Add a new regression test for the error message in regular function
variadic errors during ast validation pass.

gcc/testsuite/ChangeLog:

	* rust/compile/non_foreign_variadic_function.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/testsuite/rust/compile/non_foreign_variadic_function.rs | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/non_foreign_variadic_function.rs

diff --git a/gcc/testsuite/rust/compile/non_foreign_variadic_function.rs b/gcc/testsuite/rust/compile/non_foreign_variadic_function.rs
new file mode 100644
index 00000000000..2a4d3090a66
--- /dev/null
+++ b/gcc/testsuite/rust/compile/non_foreign_variadic_function.rs
@@ -0,0 +1,4 @@
+pub fn toto(a: i32, ...) {}
+// { dg-error "only foreign or .unsafe extern .C.. functions may be C-variadic" "" { target *-*-* } .-1 }
+
+fn main() {}
-- 
2.42.1



More information about the Gcc-rust mailing list