]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add new test for invalid variadics
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 9 Nov 2023 22:29:05 +0000 (23:29 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:13:14 +0000 (19:13 +0100)
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 <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/invalid_variadics.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/invalid_variadics.rs b/gcc/testsuite/rust/compile/invalid_variadics.rs
new file mode 100644 (file)
index 0000000..5706b67
--- /dev/null
@@ -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 }
+}