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 <pierre-emmanuel.patry@embecosm.com>
  • Loading branch information
P-E-P committed Nov 9, 2023
1 parent 9420d3f commit 5e58dcd
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 5e58dcd

Please sign in to comment.