https://gcc.gnu.org/g:e03ffa0b5c0c47237afb6ff901297b1cafea7fc6

commit e03ffa0b5c0c47237afb6ff901297b1cafea7fc6
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Sat Jul 12 10:04:22 2025 +0200

    Copie fichiers assembleur

Diff:
---
 gcc/testsuite/lib/gfortran-dg.exp | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/lib/gfortran-dg.exp 
b/gcc/testsuite/lib/gfortran-dg.exp
index 4abf2fe5dccf..1bfc19a3368d 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -19,7 +19,7 @@ load_lib torture-options.exp
 
 # Define gfortran callbacks for dg.exp.
 
-proc gfortran-dg-test { prog do_what extra_tool_flags } {
+proc gfortran-dg-test-1 { prog do_what extra_tool_flags } {
     set result \
        [gcc-dg-test-1 gfortran_target_compile $prog $do_what $extra_tool_flags]
     
@@ -114,6 +114,29 @@ proc gfortran-dg-test { prog do_what extra_tool_flags } {
     return [list $comp_output $output_file]
 }
 
+proc gfortran-dg-test { prog do_what extra_tool_flags } {
+    set result [uplevel [list gfortran-dg-test-1 $prog $do_what 
$extra_tool_flags]]
+    global asm_target_dir
+    if [file exists $asm_target_dir] {
+       set output_file [lindex $result 1] 
+       set asm_file "[file rootname $output_file].s"
+       set flag_found [expr false]
+       foreach flag $extra_tool_flags {
+           if { $flag == "-O2" } {
+               set flag_found [expr true]
+           }
+       }
+       if $flag_found {
+           if [file exists $asm_file] {
+               file copy -force $asm_file $asm_target_dir
+           } else {
+               puts "NOT found $asm_file"
+           }
+       }
+    }
+    return $result
+}
+
 proc gfortran-dg-prune { system text } {
     return [gcc-dg-prune $system $text]
 }

Reply via email to