This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testsuite] new test case to check address generation of symbol for H8300H normal mode target


Hi,

	Please find below patch which adds a new binutils dejagnu test case.

Test case description:-
	There was a problem with objdump utility regarding symbol address generation 
for H8300H normal mode target due to which it was not able to distinguish
between 24bit and 32 bit addressing.
	Below test case is just to ensure that objdump shows 16 bit address for symbols.

==========================================================================
testsuite/Changelog

2004-07-15  Nitin Yewale <nitiny@kpitcummins.com>

        * gas/h8300/h8300.exp (do_h8300hn_addressgen): Addition of
        new test case for H8300H normal target to check symbol 
        address generation.   
	  * gas/h8300/symaddgen.s : New test
==========================================================================	
--- binutils-040628/gas/testsuite/gas/h8300/h8300.exp	2004-07-08 14:55:53.000000000 +0530
+++ binutils-040628/gas/testsuite/gas/h8300/h8300.exp	2004-07-15 10:38:59.000000000 +0530
@@ -2114,6 +2114,34 @@ proc do_h8300h_mov32bug {} {
     if [expr $x == 1] then { pass $testname } else { fail $testname }
 }
 
+proc do_h8300hn_addressgen {} {
+    set testname "symaddgen.s: h8300hn symbol address generation"
+    set x 0
+
+    gas_start "symaddgen.s" "-al"
+
+    # Check each instruction bit pattern to verify it got
+    # assembled correctly.
+    while 1 {
+	expect {
+	    -re " +\[0-9\]+ 0000 01006DF6\[^\n\]*\n"   { set x [expr $x+1] }
+	    -re " +\[0-9\]+ 0004 0D76\[^\n\]*\n"       { set x [expr $x+1] }
+	    -re " +\[0-9\]+ 0006 790207D0\[^\n\]*\n"   { set x [expr $x+1] }
+	    -re " +\[0-9\]+ 000a 6B82F020\[^\n\]*\n"   { set x [expr $x+1] }
+	    -re " +\[0-9\]+ 000e 79022710\[^\n\]*\n"   { set x [expr $x+1] }
+	    -re " +\[0-9\]+ 0012 6B820000\[^\n\]*\n"   { set x [expr $x+1] }
+	    -re " +\[0-9\]+ 0016 01006D76\[^\n\]*\n"   { set x [expr $x+1] }
+	    -re " +\[0-9\]+ 001a 5470\[^\n\]*\n"       { set x [expr $x+1] }
+            
+	    eof					{ break }
+	}
+    }
+    # This was intended to do any cleanup necessary.  It kinda looks like it
+    # isn't needed, but just in case, please keep it in for now.
+    gas_finish
+    # Did we find what we were looking for?  If not, flunk it.
+    if [expr $x == 8] then { pass $testname } else { fail $testname }
+}
 if [istarget h8300*-*-*] then {
     # Test the basic h8300 instruction parser
     do_h8300_add_sub
@@ -2131,6 +2159,7 @@ if [istarget h8300*-*-*] then {
     do_h8300_movw
     do_h8300_pushpop
     do_h8300_rotate_shift
+    do_h8300hn_addressgen
 
     # Now test the h8300h instruction parser
     do_h8300h_add_sub
--- /dev/null	2002-08-31 05:01:37.000000000 +0530
+++ binutils-040628/gas/testsuite/gas/h8300/symaddgen.s	2004-07-14 17:36:50.000000000 +0530
@@ -0,0 +1,14 @@
+	.h8300hn
+	.text
+foo:
+	mov.l er6,@-er7
+	mov.w r7,r6
+	mov.w #2000,r2
+	mov.w r2,@-4064:16
+	mov.w #10000,r2
+	mov.w r2,@_var2
+	mov.l @er7+,er6
+	rts
+	.comm _var2,2,2
+	.end
==========================================================================	

Regards,
Nitin Yewale,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]