https://gcc.gnu.org/g:cf8a078221d14c8d2cb16dfb4448ec121eb50d1a
commit r16-2935-gcf8a078221d14c8d2cb16dfb4448ec121eb50d1a Author: Arthur Cohen <arthur.co...@embecosm.com> Date: Fri Jul 4 16:19:44 2025 +0200 gccrs: attributes: Add #[test] and #[simd_test] gcc/rust/ChangeLog: * util/rust-attribute-values.h: Add declarations for them. * util/rust-attributes.cc: Add definitions. Diff: --- gcc/rust/util/rust-attribute-values.h | 4 ++++ gcc/rust/util/rust-attributes.cc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h index 47e6a175396c..09ef56647953 100644 --- a/gcc/rust/util/rust-attribute-values.h +++ b/gcc/rust/util/rust-attribute-values.h @@ -85,6 +85,10 @@ public: static constexpr auto &NON_EXHAUSTIVE = "non_exhaustive"; static constexpr auto &RUSTFMT = "rustfmt"; + + static constexpr auto &TEST = "test"; + + static constexpr auto &SIMD_TEST = "simd_test"; }; } // namespace Values } // namespace Rust diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 9bf4f7773c68..0c957fb20144 100644 --- a/gcc/rust/util/rust-attributes.cc +++ b/gcc/rust/util/rust-attributes.cc @@ -95,7 +95,10 @@ static const BuiltinAttrDefinition __definitions[] {Attrs::FUNDAMENTAL, TYPE_CHECK}, {Attrs::NON_EXHAUSTIVE, TYPE_CHECK}, - {Attrs::RUSTFMT, EXTERNAL}}; + {Attrs::RUSTFMT, EXTERNAL}, + + {Attrs::TEST, CODE_GENERATION}, + {Attrs::SIMD_TEST, CODE_GENERATION}}; BuiltinAttributeMappings * BuiltinAttributeMappings::get ()