]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix execute testsuite
authorOwen Avery <powerboat9.gamer@gmail.com>
Tue, 17 Jun 2025 14:42:05 +0000 (10:42 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:49 +0000 (16:36 +0200)
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.gamer@gmail.com>
gcc/testsuite/rust/execute/black_box.rs
gcc/testsuite/rust/execute/execute.exp [new file with mode: 0644]
gcc/testsuite/rust/execute/xfail/match-identifierpattern-enum.rs [moved from gcc/testsuite/rust/execute/match-identifierpattern-enum.rs with 100% similarity]

index 7a9920eba947ec710f0384fdc1cecdaf4e25780a..58d10a3e42096b0d7fe2dae8fc2dcd66fdb3be56 100644 (file)
@@ -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 (file)
index 0000000..3754778
--- /dev/null
@@ -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