]> gcc.gnu.org Git - gcc.git/commitdiff
Add a test regular variadic functions errors
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 20 Nov 2023 10:37:12 +0000 (11:37 +0100)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Tue, 21 Nov 2023 11:16:34 +0000 (11:16 +0000)
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 [new file with mode: 0644]

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 (file)
index 0000000..2a4d309
--- /dev/null
@@ -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() {}
This page took 0.061737 seconds and 5 git commands to generate.