From 0f9752e4b23cab42709824ca8f504b0dcd941c10 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Mon, 20 Nov 2023 11:37:12 +0100 Subject: [PATCH] Add a test regular variadic functions errors 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 --- 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 000000000000..2a4d3090a66b --- /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() {}