https://gcc.gnu.org/g:aeb9d51334ca07a6dd233d6ad94569177df7784c
commit r16-2879-gaeb9d51334ca07a6dd233d6ad94569177df7784c Author: Owen Avery <powerboat9.ga...@gmail.com> Date: Tue Jun 17 10:42:05 2025 -0400 gccrs: Fix execute testsuite Our non-torture execute tests haven't actually been running. gcc/testsuite/ChangeLog: * rust/execute/black_box.rs: Return 0 from main. * rust/execute/match-identifierpattern-enum.rs: Move to... * rust/execute/xfail/match-identifierpattern-enum.rs: ...here. * rust/execute/execute.exp: New file. Signed-off-by: Owen Avery <powerboat9.ga...@gmail.com> Diff: --- gcc/testsuite/rust/execute/black_box.rs | 3 +- gcc/testsuite/rust/execute/execute.exp | 33 ++++++++++++++++++++++ .../{ => xfail}/match-identifierpattern-enum.rs | 0 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/rust/execute/black_box.rs b/gcc/testsuite/rust/execute/black_box.rs index 7a9920eba947..58d10a3e4209 100644 --- a/gcc/testsuite/rust/execute/black_box.rs +++ b/gcc/testsuite/rust/execute/black_box.rs @@ -21,10 +21,11 @@ pub fn black_box<T>(mut dummy: T) -> T { dummy } -fn main() { +fn main() -> i32 { let dummy: i32 = 42; let result = black_box(dummy); unsafe { printf("Value is: %i\n\0" as *const str as *const i8, result); } + 0 } diff --git a/gcc/testsuite/rust/execute/execute.exp b/gcc/testsuite/rust/execute/execute.exp new file mode 100644 index 000000000000..3754778bd4cd --- /dev/null +++ b/gcc/testsuite/rust/execute/execute.exp @@ -0,0 +1,33 @@ +# Copyright (C) 2021-2025 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/>. + +# Execute tests. + +# 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 "run" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.rs]] "" "" +set dg-do-what-default ${saved-dg-do-what-default} + +# All done. +dg-finish diff --git a/gcc/testsuite/rust/execute/match-identifierpattern-enum.rs b/gcc/testsuite/rust/execute/xfail/match-identifierpattern-enum.rs similarity index 100% rename from gcc/testsuite/rust/execute/match-identifierpattern-enum.rs rename to gcc/testsuite/rust/execute/xfail/match-identifierpattern-enum.rs