Add copyright notices
[deliverable/binutils-gdb.git] / gas / testsuite / gas / h8300 / h8300.exp
index 2aa2b06136064d17f49bab298b2e735a35f46f3d..10434b43debd88db6634e66d82c69d48d325f00c 100644 (file)
@@ -1,3 +1,20 @@
+# Copyright 2012
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  
+
 #
 # Some H8/300 tests
 #
@@ -2070,6 +2087,13 @@ proc do_h8300s_multiple {} {
            -re " +\[0-9\]+ 000c 01106DF0\[^\n\]*\n"   { set x [expr $x+1] }
            -re " +\[0-9\]+ 0010 01206DF0\[^\n\]*\n"   { set x [expr $x+1] }
            -re " +\[0-9\]+ 0014 01306DF0\[^\n\]*\n"   { set x [expr $x+1] }
+            -re " +\[0-9\]+ 0018 01106D73\[^\n\]*\n"   { set x [expr $x+1] }
+            -re " +\[0-9\]+ 001c 01106DF2\[^\n\]*\n"   { set x [expr $x+1] }
+            -re " +\[0-9\]+ 0020 01106D75\[^\n\]*\n"   { set x [expr $x+1] }
+            -re " +\[0-9\]+ 0024 01206D76\[^\n\]*\n"   { set x [expr $x+1] }
+            -re " +\[0-9\]+ 0028 01106DF4\[^\n\]*\n"   { set x [expr $x+1] }
+            -re " +\[0-9\]+ 002c 01206DF4\[^\n\]*\n"   { set x [expr $x+1] }
+
            eof                                 { break }
        }
     }
@@ -2079,7 +2103,7 @@ proc do_h8300s_multiple {} {
     gas_finish
 
     # Did we find what we were looking for?  If not, flunk it.
-    if [expr $x == 6] then { pass $testname } else { fail $testname }
+    if [expr $x == 12] then { pass $testname } else { fail $testname }
 }
 
 proc do_h8300h_mov32bug {} {
@@ -2091,7 +2115,7 @@ proc do_h8300h_mov32bug {} {
 
        while 1 {
            expect {
-               -re "00000002\[^\n\]*32\[^\n\]*_a.0x0*88ca6c00\[^\n\]*\n"
+               -re "00000002\[^\n\]*32\[^\n\]*_a-0x77359400\[^\n\]*\n"
                                                { set x [expr $x+1] }
                timeout                         { perror "timeout\n; break }
                eof                             { break }
@@ -2107,6 +2131,67 @@ 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 }
+}
+
+proc do_h8300_addsubrxcheck {} {
+    set testname "addsubrxcheck.s: h8300 check rx generation for adds subs instructions"
+    set x 0
+
+    gas_start "addsubrxcheck.s" "-al"
+
+    # Check each instruction bit pattern to verify it got
+    # assembled correctly.
+    while 1 {
+       expect {
+           -re " +\[0-9\]+ .* 6DF6\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 0D76\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 1B87\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 6F62FFFE\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 1B82\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 6FE2FFFE\[^\n\]*\n"   { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 1922\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 0D20\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 0B87\[^\n\]*\n"       { set x [expr $x+1] }
+           -re " +\[0-9\]+ .* 6D76\[^\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 == 11] then { pass $testname } else { fail $testname }
+}
+
 if [istarget h8300*-*-*] then {
     # Test the basic h8300 instruction parser
     do_h8300_add_sub
@@ -2124,6 +2209,9 @@ if [istarget h8300*-*-*] then {
     do_h8300_movw
     do_h8300_pushpop
     do_h8300_rotate_shift
+    do_h8300hn_addressgen
+
+    do_h8300_addsubrxcheck
 
     # Now test the h8300h instruction parser
     do_h8300h_add_sub
@@ -2167,14 +2255,12 @@ if [istarget h8300*-*-*] then {
 
     do_h8300h_mov32bug
 
-    run_dump_test h8sx_disp2
-    run_dump_test h8sx_rtsl
-    run_dump_test h8sx_mov_imm
-
     # Now some random tests
     set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] ]
     set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
     set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*]]
 
     gas_test "cmpsi2.s" "" "" "cmpsi2.s"
+
+    run_dump_test "pr3134"
 }
This page took 0.024983 seconds and 4 git commands to generate.