]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Tue, 17 Oct 2023 14:07:33 +0000 (14:07 +0000)
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!();