]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Update test with builtin macro definition
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Sat, 28 Mar 2026 18:27:04 +0000 (19:27 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 14 Apr 2026 21:48:47 +0000 (23:48 +0200)
Those test contain builtin macros that were not correctly defined. This
was mostly fine because the compiler emitted attribute errors before the
expansion step but now that the new builtin attribute checking is
executed after the expansion we cannot ignore those missing definitions.

gcc/testsuite/ChangeLog:

* rust/compile/doc_macro.rs: Add concat builtin macro definition.
* rust/compile/early_feature_gate_in_macro.rs: Add stringify builtin
macro definition.
* rust/compile/issue-3661.rs: Likewise.
* rust/compile/parse_time_feature_gate.rs: Add concat and stringify
builtin macro definition.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/doc_macro.rs
gcc/testsuite/rust/compile/early_feature_gate_in_macro.rs
gcc/testsuite/rust/compile/issue-3661.rs
gcc/testsuite/rust/compile/parse_time_feature_gate.rs

index 179455ddf951e89052b304c1418561e043f30dc3..dff69baad0747a25070041928979c5694958930a 100644 (file)
@@ -1,4 +1,10 @@
+#![feature(rustc_attrs)]
 #![feature(no_core)]
 #![no_core]
 #![feature(extended_key_value_attributes)]
 #![doc = concat!("AB")]
+
+#[rustc_builtin_macro]
+macro_rules! concat {
+    () => {{}};
+}
index f7657736261a5f95d28e1e75005b4bd26717cbff..9e2a51027aa66dba5276ef903fbd6b3a48901626 100644 (file)
@@ -8,6 +8,11 @@ macro_rules! concat {
     () => {{}};
 }
 
+#[rustc_builtin_macro]
+macro_rules! stringify {
+    () => {{}};
+}
+
 macro_rules! prefix_symbol(
     ($prefix : tt, { $($ident: ident, )* }) => {
         $(
index 7cb7c6add7a1e0ad4f98d95be71cc7f6bcaa1eb1..0c8eab3f2eb9b964db114dc8d641586f5ad7a96c 100644 (file)
@@ -1,9 +1,15 @@
 #![feature(no_core)]
 #![no_core]
 #![feature(extended_key_value_attributes)]
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! stringify {
+    () => {{}};
+}
 
 pub macro m($inner_str:expr) {
-    #[m = $inner_str] 
+    #[m = $inner_str]
     // { dg-error "macro not found" "" { target *-*-* } .-1 }
 
     struct S;
index 238b2cfd5c7e0ca46c408e7d03c7f87dd2017dcf..907ac0c519b585f34cf4b1806d8e1abf0c4938ac 100644 (file)
@@ -1,5 +1,16 @@
 #![feature(no_core)]
 #![no_core]
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! concat {
+    () => {{}};
+}
+
+#[rustc_builtin_macro]
+macro_rules! stringify {
+    () => {{}};
+}
 
 // { dg-error "arbitrary expressions in key-value attributes are unstable" "" { target *-*-* } .+1 }
 #[export_name = concat!(stringify!(non), stringify!(literal))]