]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: nr2.0: Add macros 2.0 resolution testcase.
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 2 Aug 2023 10:56:03 +0000 (12:56 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:28 +0000 (19:00 +0100)
gcc/testsuite/ChangeLog:

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

gcc/testsuite/rust/compile/name_resolution10.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/name_resolution10.rs b/gcc/testsuite/rust/compile/name_resolution10.rs
new file mode 100644 (file)
index 0000000..33643bd
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-options "-frust-name-resolution-2.0 -frust-compile-until=lowering" }
+
+#![feature(decl_macro)]
+
+pub mod foo {
+    pub mod bar {
+        pub mod baz {
+            // macros 2.0 get inserted in Ribs like items
+            pub macro boof() {}
+        }
+    }
+}
+
+#[macro_export]
+fn main() {
+    foo::bar::baz::boof!();
+    crate::foo::bar::baz::boof!();
+    self::foo::bar::baz::boof!();
+}