gas/h8300/h8300.exp (do_h8300hn_addressgen): Addition of new test case for
[binutils-gdb.git] / gas / testsuite / gas / h8300 / h8300.exp
index a13c16aa347837b28bbe7fe8227bddb25db31fe4..10b30f49bf444acd5d3eee7bdca8f0794593c864 100644 (file)
@@ -2114,6 +2114,35 @@ 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\]+ .* 01006DF6\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 0D76\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 790207D0\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 6B82F020\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 79022710\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 6B820000\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 01006D76\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 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 +2160,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