Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Tweak tests for target with 4-byte doubles
@ 2002-05-23  8:52 Michael Snyder
  2002-05-23  9:09 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2002-05-23  8:52 UTC (permalink / raw)
  To: gdb-patches; +Cc: ezannoni


32-bit doubles on the D10V affect the precision of the results.

2002-05-23  Michael Snyder  <msnyder@redhat.com>

	* gdb.base/all-bin.exp: Allow for reduced floating point precision.
	* gdb.base/call-rt-st.exp: Ditto.

Index: all-bin.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/all-bin.exp,v
retrieving revision 1.2
diff -p -r1.2 all-bin.exp
*** all-bin.exp	6 Mar 2001 08:21:50 -0000	1.2
--- all-bin.exp	23 May 2002 15:40:03 -0000
*************** send_gdb "print v_int+v_double\n"
*** 189,198 ****
  gdb_expect {
      -re ".*206.56565.*$gdb_prompt $" {
          pass "print value of v_int+v_double"
!       }
      -re ".*$gdb_prompt $" { fail "print value of v_int+v_double" }
!     timeout           { fail "(timeout) print value of v_int+" }    
!   }
  
  
  #
--- 189,206 ----
  gdb_expect {
      -re ".*206.56565.*$gdb_prompt $" {
          pass "print value of v_int+v_double"
!     }
!     -re ".*206.565643.*$gdb_prompt $" {
! 	# D10V has 4-byte doubles
! 	if [istarget "d10v*-*"] then {
! 	    pass "print value of v_int+v_double (D10V)"
! 	} else {
! 	    fail "print value of v_int+v_double (precision)"
! 	}
!     }
      -re ".*$gdb_prompt $" { fail "print value of v_int+v_double" }
!     timeout     { fail "(timeout) print value of v_int+v_double" }
! }
  
  
  #
Index: call-rt-st.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-rt-st.exp,v
retrieving revision 1.8
diff -p -r1.8 call-rt-st.exp
*** call-rt-st.exp	6 Jan 2002 14:42:39 -0000	1.8
--- call-rt-st.exp	23 May 2002 15:40:03 -0000
*************** if ![gdb_skip_stdio_test "print print_on
*** 175,182 ****
  
  if {![gdb_skip_float_test "print print_one_double(*d1)"] && \
          ![gdb_skip_stdio_test "print print_one_double(*d1)"] } {
!     print_struct_call "print_one_double(*d1)" \
!             ".*Contents of one_double_t:\[ \r\n\]+1\\.111110\[ \r\n\]+.\[0-9\]+ = \\{double1 = 1\\.11111\\}"
  }
  
  if {![gdb_skip_float_test "print print_two_floats(*f3)"] && \
--- 175,188 ----
  
  if {![gdb_skip_float_test "print print_one_double(*d1)"] && \
          ![gdb_skip_stdio_test "print print_one_double(*d1)"] } {
!     if [istarget "d10v*-*"] then {
! 	# D10V has 4-byte doubles
! 	print_struct_call "print_one_double(*d1)" \
! 		".*Contents of one_double_t:\[ \r\n\]+1\\.111110\[ \r\n\]+.\[0-9\]+ = \\{double1 = 1\\.11110997\\}"
!     } else {
! 	print_struct_call "print_one_double(*d1)" \
! 		".*Contents of one_double_t:\[ \r\n\]+1\\.111110\[ \r\n\]+.\[0-9\]+ = \\{double1 = 1\\.11111\\}"
!     }
  }
  
  if {![gdb_skip_float_test "print print_two_floats(*f3)"] && \


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Tweak tests for target with 4-byte doubles
  2002-05-23  8:52 [PATCH] Tweak tests for target with 4-byte doubles Michael Snyder
@ 2002-05-23  9:09 ` Andrew Cagney
  2002-05-23 10:35   ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-05-23  9:09 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, ezannoni

> 2002-05-23  Michael Snyder  <msnyder@redhat.com>
> 
> 	* gdb.base/all-bin.exp: Allow for reduced floating point precision.
> 	* gdb.base/call-rt-st.exp: Ditto.
> 
> Index: all-bin.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/all-bin.exp,v
> retrieving revision 1.2
> diff -p -r1.2 all-bin.exp
> *** all-bin.exp	6 Mar 2001 08:21:50 -0000	1.2
> --- all-bin.exp	23 May 2002 15:40:03 -0000
> *************** send_gdb "print v_int+v_double\n"
> *** 189,198 ****
>   gdb_expect {
>       -re ".*206.56565.*$gdb_prompt $" {
>           pass "print value of v_int+v_double"
> !       }
>       -re ".*$gdb_prompt $" { fail "print value of v_int+v_double" }
> !     timeout           { fail "(timeout) print value of v_int+" }    
> !   }
>   

Michael,

Last time this was raised it was concluded that GDB shouldn't be testing 
the FPU here.  Rather than adding d10v specific hacks, reduce the 
precision of the value being checked.

(I think it was also suggested that instead of having if (d10v) have if 
(sizeof_double < 8) or something.

Andrew



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Tweak tests for target with 4-byte doubles
  2002-05-23  9:09 ` Andrew Cagney
@ 2002-05-23 10:35   ` Andrew Cagney
  2002-05-23 11:01     ` Michael Snyder
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-05-23 10:35 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Michael Snyder, gdb-patches, ezannoni

> 2002-05-23  Michael Snyder  <msnyder@redhat.com>
> 
>     * gdb.base/all-bin.exp: Allow for reduced floating point precision.
>     * gdb.base/call-rt-st.exp: Ditto.
> 
> Index: all-bin.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/all-bin.exp,v
> retrieving revision 1.2
> diff -p -r1.2 all-bin.exp
> *** all-bin.exp    6 Mar 2001 08:21:50 -0000    1.2
> --- all-bin.exp    23 May 2002 15:40:03 -0000
> *************** send_gdb "print v_int+v_double\n"
> *** 189,198 ****
>   gdb_expect {
>       -re ".*206.56565.*$gdb_prompt $" {
>           pass "print value of v_int+v_double"
> !       }
>       -re ".*$gdb_prompt $" { fail "print value of v_int+v_double" }
> !     timeout           { fail "(timeout) print value of v_int+" }    !   }
>  
> Michael,
> 
> Last time this was raised it was concluded that GDB shouldn't be testing the FPU here.  Rather than adding d10v specific hacks, reduce the precision of the value being checked.

Hmm, to expand a little:

 >       -re ".*206.56565.*$gdb_prompt $" {

to

	-re ".*206.56\[0-9\]*

so it isn't assuming a specific underlying floating-point representation.

enjoy,
Andrew



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Tweak tests for target with 4-byte doubles
  2002-05-23 10:35   ` Andrew Cagney
@ 2002-05-23 11:01     ` Michael Snyder
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Snyder @ 2002-05-23 11:01 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Michael Snyder, gdb-patches, ezannoni

Andrew Cagney wrote:
> 
> > 2002-05-23  Michael Snyder  <msnyder@redhat.com>
> >
> >     * gdb.base/all-bin.exp: Allow for reduced floating point precision.
> >     * gdb.base/call-rt-st.exp: Ditto.
> >
> > Index: all-bin.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.base/all-bin.exp,v
> > retrieving revision 1.2
> > diff -p -r1.2 all-bin.exp
> > *** all-bin.exp    6 Mar 2001 08:21:50 -0000    1.2
> > --- all-bin.exp    23 May 2002 15:40:03 -0000
> > *************** send_gdb "print v_int+v_double\n"
> > *** 189,198 ****
> >   gdb_expect {
> >       -re ".*206.56565.*$gdb_prompt $" {
> >           pass "print value of v_int+v_double"
> > !       }
> >       -re ".*$gdb_prompt $" { fail "print value of v_int+v_double" }
> > !     timeout           { fail "(timeout) print value of v_int+" }    !   }
> >
> > Michael,
> >
> > Last time this was raised it was concluded that GDB shouldn't be testing the FPU here.  Rather than adding d10v specific hacks, reduce the precision of the value being checked.
> 
> Hmm, to expand a little:
> 
>  >       -re ".*206.56565.*$gdb_prompt $" {
> 
> to
> 
>         -re ".*206.56\[0-9\]*
> 
> so it isn't assuming a specific underlying floating-point representation.
> 

Got it.  Will do.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-23 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-23  8:52 [PATCH] Tweak tests for target with 4-byte doubles Michael Snyder
2002-05-23  9:09 ` Andrew Cagney
2002-05-23 10:35   ` Andrew Cagney
2002-05-23 11:01     ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox