[gcc r14-7949] gccrs: Add regression test for nested macros

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 16 18:09:54 GMT 2024


https://gcc.gnu.org/g:a289b3614defa2745842a58df23ca11fff583332

commit r14-7949-ga289b3614defa2745842a58df23ca11fff583332
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed Aug 30 17:11:24 2023 +0200

    gccrs: 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 <pierre-emmanuel.patry@embecosm.com>

Diff:
---
 gcc/testsuite/rust/compile/nested_macro_definition.rs | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

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 00000000000..c0b72506acc
--- /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!();
+}


More information about the Gcc-cvs mailing list