aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-09-13 16:30:28 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2023-01-31 14:16:51 +0100
commit739d0509ed55aa650f197618a0902c6e0553b639 (patch)
tree2e49f896396db54b52c0eab0ac5fc4e769bed912 /gcc
parentff9d7741d4b9d5255bc809a7505225216ecc7b86 (diff)
downloadgcc-739d0509ed55aa650f197618a0902c6e0553b639.zip
gcc-739d0509ed55aa650f197618a0902c6e0553b639.tar.gz
gcc-739d0509ed55aa650f197618a0902c6e0553b639.tar.bz2
gccrs: attributes: Add #[macro_use] as builtin
gcc/rust/ChangeLog: * util/rust-attributes.cc: Add `macro_use` to list of builtin attributes. gcc/testsuite/ChangeLog: * rust/compile/macro_export_1.rs: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/util/rust-attributes.cc1
-rw-r--r--gcc/testsuite/rust/compile/macro_export_1.rs2
2 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 9db77b4..1c85273 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -40,6 +40,7 @@ static const BuiltinAttrDefinition __definitions[]
{"no_mangle", CODE_GENERATION},
{"repr", CODE_GENERATION},
{"path", EXPANSION},
+ {"macro_use", NAME_RESOLUTION},
// From now on, these are reserved by the compiler and gated through
// #![feature(rustc_attrs)]
{"rustc_inherit_overflow_checks", CODE_GENERATION}};
diff --git a/gcc/testsuite/rust/compile/macro_export_1.rs b/gcc/testsuite/rust/compile/macro_export_1.rs
new file mode 100644
index 0000000..f87df08
--- /dev/null
+++ b/gcc/testsuite/rust/compile/macro_export_1.rs
@@ -0,0 +1,2 @@
+#[macro_use]
+mod foo {}