]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add regression test for nested macros
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 30 Aug 2023 15:11:24 +0000 (17:11 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:34 +0000 (19:00 +0100)
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>
gcc/testsuite/rust/compile/nested_macro_definition.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/nested_macro_definition.rs b/gcc/testsuite/rust/compile/nested_macro_definition.rs
new file mode 100644 (file)
index 0000000..c0b7250
--- /dev/null
@@ -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!();
+}