]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a test for malformed derive declaration input
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 18 Jul 2023 14:10:01 +0000 (16:10 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:55:57 +0000 (18:55 +0100)
Add a new test to highlight possible future regressions on malformed
proc_macro_derive input.

gcc/testsuite/ChangeLog:

* rust/compile/proc_macro_derive_malformed.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/proc_macro_derive_malformed.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_malformed.rs b/gcc/testsuite/rust/compile/proc_macro_derive_malformed.rs
new file mode 100644 (file)
index 0000000..d83256b
--- /dev/null
@@ -0,0 +1,4 @@
+// { dg-additional-options "-frust-crate-type=proc-macro" }
+
+#[proc_macro_derive] // { dg-excess-errors "malformed 'proc_macro_derive' attribute input" }
+pub fn my_invalid_macro() {}