aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-08-30 17:11:24 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-08-31 14:27:34 +0000
commit764a6c27038a5df8c0c14b1df446382b0c0fdf18 (patch)
treefb7d1e40ec2f1bafce494eb34ae7f0e33eab830d /gcc
parent9ff9f4ec3252c5a02783baa610cc4a40f1a3c771 (diff)
downloadgcc-764a6c27038a5df8c0c14b1df446382b0c0fdf18.zip
gcc-764a6c27038a5df8c0c14b1df446382b0c0fdf18.tar.gz
gcc-764a6c27038a5df8c0c14b1df446382b0c0fdf18.tar.bz2
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/rust/compile/nested_macro_definition.rs16
1 files changed, 16 insertions, 0 deletions
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!();
+}