"fix" fortran ieee execute tests for alpha

Richard Henderson rth@twiddle.net
Mon Aug 30 13:04:00 GMT 2004


These tests construct denormals, inf, or nans by hand, and so
require -mieee in order to execute properly for alpha.  I've
copied the bits from c-torture's ieee.exp for this.  Duplication
sucks, but its easy.


r~


        * lib/fortran-torture.exp (fortran-torture-execute): Honor
        additional_flags set by alternate driver.
        (ieee-options): New procedure.
        * gfortran.fortran-torture/execute/intrinsic_fraction_exponent.x: New.
        * gfortran.fortran-torture/execute/intrinsic_nearest.x: New.
        * gfortran.fortran-torture/execute/intrinsic_set_exponent.x: New.
        * gfortran.fortran-torture/execute/nan_inf_fmt.x: New.

Index: gfortran.fortran-torture/execute/intrinsic_fraction_exponent.x
===================================================================
RCS file: gfortran.fortran-torture/execute/intrinsic_fraction_exponent.x
diff -N gfortran.fortran-torture/execute/intrinsic_fraction_exponent.x
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gfortran.fortran-torture/execute/intrinsic_fraction_exponent.x	30 Aug 2004 12:08:48 -0000
***************
*** 0 ****
--- 1,2 ----
+ lappend additional_flags [ieee-options]
+ return 0
Index: gfortran.fortran-torture/execute/intrinsic_nearest.x
===================================================================
RCS file: gfortran.fortran-torture/execute/intrinsic_nearest.x
diff -N gfortran.fortran-torture/execute/intrinsic_nearest.x
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gfortran.fortran-torture/execute/intrinsic_nearest.x	30 Aug 2004 12:08:48 -0000
***************
*** 0 ****
--- 1,2 ----
+ lappend additional_flags [ieee-options]
+ return 0
Index: gfortran.fortran-torture/execute/intrinsic_set_exponent.x
===================================================================
RCS file: gfortran.fortran-torture/execute/intrinsic_set_exponent.x
diff -N gfortran.fortran-torture/execute/intrinsic_set_exponent.x
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gfortran.fortran-torture/execute/intrinsic_set_exponent.x	30 Aug 2004 12:08:48 -0000
***************
*** 0 ****
--- 1,2 ----
+ lappend additional_flags [ieee-options]
+ return 0
Index: gfortran.fortran-torture/execute/nan_inf_fmt.x
===================================================================
RCS file: gfortran.fortran-torture/execute/nan_inf_fmt.x
diff -N gfortran.fortran-torture/execute/nan_inf_fmt.x
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gfortran.fortran-torture/execute/nan_inf_fmt.x	30 Aug 2004 12:08:48 -0000
***************
*** 0 ****
--- 1,2 ----
+ lappend additional_flags [ieee-options]
+ return 0
Index: lib/fortran-torture.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/fortran-torture.exp,v
retrieving revision 1.4
diff -c -p -d -r1.4 fortran-torture.exp
*** lib/fortran-torture.exp	16 Jul 2004 00:32:26 -0000	1.4
--- lib/fortran-torture.exp	30 Aug 2004 12:08:48 -0000
*************** proc fortran-torture-execute { src } {
*** 139,144 ****
--- 139,145 ----
      global TORTURE_OPTIONS
  
      # Check for alternate driver.
+     set additional_flags "";
      if [file exists [file rootname $src].x] {
  	verbose "Using alternate driver [file rootname [file tail $src]].x" 2
  	set done_p 0
*************** proc fortran-torture-execute { src } {
*** 184,189 ****
--- 185,193 ----
  
  	set options ""
  	lappend options "additional_flags=-w $option"
+ 	if { $additional_flags != "" } {
+ 	    lappend options "additional_flags=$additional_flags";
+ 	}
  	set comp_output [gfortran_target_compile "$src" "$executable" executable $options];
  
  	# See if we got something bad.
*************** proc fortran-torture { args } {
*** 341,343 ****
--- 345,365 ----
      }
  }
  
+ #
+ # ieee-options -- return options necessary for 100% ieee conformance.
+ #
+ proc ieee-options { } {
+     # Ensure that excess precision does not cause problems.
+     if [istarget "i?86-*-*"] then {
+       return "-ffloat-store"
+     }
+     if [istarget "m68k-*-*"] then {
+       return "-ffloat-store"
+     }
+                                                                                 
+     # Enable full IEEE compliance mode.
+     if { [istarget "alpha*-*-*"]
+          || [istarget "sh*-*-*"] } then {
+       return "-mieee"
+     }
+ }



More information about the Gcc-patches mailing list