]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a new test for mbe named macro_rules
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 17 Oct 2023 12:56:09 +0000 (14:56 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:17 +0000 (19:09 +0100)
Macro rules named macro_rules may cause some problems if not handled
correctly. This new test ensure we always compile those macros named
macro_rules correctly as well as other macro definitions.

gcc/testsuite/ChangeLog:

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

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

diff --git a/gcc/testsuite/rust/compile/macro57.rs b/gcc/testsuite/rust/compile/macro57.rs
new file mode 100644 (file)
index 0000000..0640d2f
--- /dev/null
@@ -0,0 +1,13 @@
+macro_rules! macro_rules {
+    () => {};
+}
+
+macro_rules! foo {
+    () => {};
+}
+
+foo!();
+
+fn main() {}
+
+macro_rules!();