From: Pierre-Emmanuel Patry Date: Thu, 9 Nov 2023 22:29:05 +0000 (+0100) Subject: gccrs: Add new test for invalid variadics X-Git-Tag: basepoints/gcc-15~1991 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bbb2472501f71a1a9eabed4e345b4202ebd81ec1;p=thirdparty%2Fgcc.git gccrs: Add new test for invalid variadics Highlight invalid variadic filtering through the ast validation checker. gcc/testsuite/ChangeLog: * rust/compile/invalid_variadics.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/testsuite/rust/compile/invalid_variadics.rs b/gcc/testsuite/rust/compile/invalid_variadics.rs new file mode 100644 index 000000000000..5706b673791b --- /dev/null +++ b/gcc/testsuite/rust/compile/invalid_variadics.rs @@ -0,0 +1,6 @@ +extern "C" { + pub fn dog(b: i32, a: ..., c: i32); + // { dg-error "..... must be the last argument of a C-variadic function" "" { target *-*-* } .-1 } + pub fn cat(a: ...); + // { dg-error "C-variadic function must be declared with at least one named argument" "" { target *-*-* } .-1 } +}