From 764a6c27038a5df8c0c14b1df446382b0c0fdf18 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Wed, 30 Aug 2023 17:11:24 +0200 Subject: Add regression test for nested macros Add a new test to avoid regression on newly added changes about macros expanding to new macro definitions. gcc/testsuite/ChangeLog: * rust/compile/nested_macro_definition.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nested_macro_definition.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gcc/testsuite/rust/compile/nested_macro_definition.rs (limited to 'gcc') diff --git a/gcc/testsuite/rust/compile/nested_macro_definition.rs b/gcc/testsuite/rust/compile/nested_macro_definition.rs new file mode 100644 index 0000000..c0b7250 --- /dev/null +++ b/gcc/testsuite/rust/compile/nested_macro_definition.rs @@ -0,0 +1,16 @@ +// { dg-options "-frust-name-resolution-2.0" } + +macro_rules! toto { + () => { + macro_rules! tata { + () => { + let _i = 0; + }; + } + }; +} + +pub fn main() { + toto!(); + tata!(); +} -- cgit v1.1