Skip to content

Commit

Permalink
Add new test for invalid variadics
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
P-E-P committed Nov 14, 2023
1 parent 5cf0fc3 commit ca5ccfc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gcc/testsuite/rust/compile/invalid_variadics.rs
Original file line number Diff line number Diff line change
@@ -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 }
}

0 comments on commit ca5ccfc

Please sign in to comment.