[gcc r14-8148] gccrs: Add new test for invalid variadics

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 16 18:17:47 GMT 2024


https://gcc.gnu.org/g:bbb2472501f71a1a9eabed4e345b4202ebd81ec1

commit r14-8148-gbbb2472501f71a1a9eabed4e345b4202ebd81ec1
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Thu Nov 9 23:29:05 2023 +0100

    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 <pierre-emmanuel.patry@embecosm.com>

Diff:
---
 gcc/testsuite/rust/compile/invalid_variadics.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/testsuite/rust/compile/invalid_variadics.rs b/gcc/testsuite/rust/compile/invalid_variadics.rs
new file mode 100644
index 00000000000..5706b673791
--- /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 }
+}


More information about the Gcc-cvs mailing list