We need a finer grain to filter tests and organise them.
gcc/testsuite/ChangeLog:
* rust/compile/builtin_macro_compile_error.rs: Move to...
* rust/compile/macros/builtin/compile_error.rs: ...here.
* rust/compile/builtin_macro_concat.rs: Move to...
* rust/compile/macros/builtin/concat.rs: ...here.
* rust/compile/builtin_macro_eager1.rs: Move to...
* rust/compile/macros/builtin/eager1.rs: ...here.
* rust/compile/builtin_macro_eager2.rs: Move to...
* rust/compile/macros/builtin/eager2.rs: ...here.
* rust/compile/builtin_macro_eager3.rs: Move to...
* rust/compile/macros/builtin/eager3.rs: ...here.
* rust/compile/builtin_macro_env.rs: Move to...
* rust/compile/macros/builtin/env.rs: ...here.
* rust/compile/builtin_macro_include_bytes.rs: Move to...
* rust/compile/macros/builtin/include_bytes.rs: ...here.
* rust/compile/builtin_macro_include_bytes_location_info.rs: Move to...
* rust/compile/macros/builtin/include_bytes_location_info.rs: ...here.
* rust/compile/builtin_macro_include_str.rs: Move to...
* rust/compile/macros/builtin/include_str.rs: ...here.
* rust/compile/builtin_macro_include_str_location_info.rs: Move to...
* rust/compile/macros/builtin/include_str_location_info.rs: ...here.
* rust/compile/builtin_macro_not_found.rs: Move to...
* rust/compile/macros/builtin/not_found.rs: ...here.
* rust/compile/builtin_macro_recurse2.rs: Move to...
* rust/compile/macros/builtin/recurse2.rs: ...here.
* rust/compile/macros/builtin/builtin_macro.exp: New test.
* rust/compile/invalid_utf8: Move invalid-utf8 data to...
* rust/compile/macros/builtin/invalid_utf8: ...here.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
+++ /dev/null
-#![feature(rustc_attrs)]
-
-#[rustc_builtin_macro]
-macro_rules! include_bytes {
- () => {{}};
-}
-
-fn main () {
- let file = "include.txt";
- include_bytes! (file); // { dg-error "argument must be a string literal" "" }
- include_bytes! (); // { dg-error "macro takes 1 argument" "" }
- include_bytes! ("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" }
- include_bytes! ("builtin_macro_include_bytes.rs"); // ok
- include_bytes! ("builtin_macro_include_bytes.rs",); // trailing comma ok
-}
+++ /dev/null
-#![feature(rustc_attrs)]
-
-#[rustc_builtin_macro]
-macro_rules! include_str {
- () => {{}};
-}
-
-fn main () {
- let file = "include.txt";
- include_str! (file); // { dg-error "argument must be a string literal" "" }
- include_str! (); // { dg-error "macro takes 1 argument" "" }
- include_str! ("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" }
- include_str! ("builtin_macro_include_str.rs"); // ok
- include_str! ("builtin_macro_include_str.rs",); // trailing comma ok
- include_str! ("invalid_utf8"); // { dg-error "invalid_utf8 was not a valid utf-8 file" "" }
-}
--- /dev/null
+# Copyright (C) 2021-2024 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Compile tests, no torture testing.
+#
+# These tests raise errors in the front end; torture testing doesn't apply.
+
+# Load support procs.
+load_lib rust-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+set saved-dg-do-what-default ${dg-do-what-default}
+
+set dg-do-what-default "compile"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.rs]] "" ""
+set dg-do-what-default ${saved-dg-do-what-default}
+
+# All done.
+dg-finish
--- /dev/null
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! include_bytes {
+ () => {{}};
+}
+
+fn main() {
+ let file = "include.txt";
+ include_bytes!(file); // { dg-error "argument must be a string literal" "" }
+ include_bytes!(); // { dg-error "macro takes 1 argument" "" }
+ include_bytes!("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" }
+ include_bytes!("include_bytes.rs"); // ok
+ include_bytes!("include_bytes.rs",); // trailing comma ok
+}
--- /dev/null
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! include_str {
+ () => {{}};
+}
+
+fn main() {
+ let file = "include.txt";
+ include_str!(file); // { dg-error "argument must be a string literal" "" }
+ include_str!(); // { dg-error "macro takes 1 argument" "" }
+ include_str!("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" }
+ include_str!("include_str.rs"); // ok
+ include_str!("include_str.rs",); // trailing comma ok
+ include_str!("invalid_utf8"); // { dg-error "invalid_utf8 was not a valid utf-8 file" "" }
+}