diff options
author | Nick Clifton <nickc@redhat.com> | 2004-08-05 09:09:02 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2004-08-05 09:09:02 +0000 |
commit | 92868b6eba6bd5e0f6f88aa2ec219a7cd5cfc3b8 (patch) | |
tree | 4f15d9a4155c94f22a4aa9459e35c74652fd28b9 | |
parent | dd90efdb05f4e2ae728a0a3a1b31e46d575ff236 (diff) | |
download | gdb-92868b6eba6bd5e0f6f88aa2ec219a7cd5cfc3b8.zip gdb-92868b6eba6bd5e0f6f88aa2ec219a7cd5cfc3b8.tar.gz gdb-92868b6eba6bd5e0f6f88aa2ec219a7cd5cfc3b8.tar.bz2 |
Addition of new test case to check rx generation with adds and subs instruction
for plain H8/300 target.
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/h8300/addsubrxcheck.s | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/h8300/h8300.exp | 34 |
3 files changed, 56 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 30ce2d6..f0679eb 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-08-05 Nitin Yewale <nitiny@kpitcummins.com> + + * h8300/h8300.exp: Addition of new test case to check rx + generation with adds and subs instruction for plain H8/300 target. + * h8300/addsubrxcheck.s: New test source file. + 2004-08-01 Stephane Carrez <stcarrez@nerim.fr> * gas/m68hc11/m68hc11.exp: Fix tests for 2.15 diff --git a/gas/testsuite/gas/h8300/addsubrxcheck.s b/gas/testsuite/gas/h8300/addsubrxcheck.s new file mode 100644 index 0000000..8ad1912 --- /dev/null +++ b/gas/testsuite/gas/h8300/addsubrxcheck.s @@ -0,0 +1,16 @@ + .section .text + .global _main +_main: + mov.w r6,@-r7 + mov.w r7,r6 + subs #2,r7 + mov.w @(-2,r6),r2 + subs #2,r2 + mov.w r2,@(-2,r6) + sub.w r2,r2 + mov.w r2,r0 + adds #2,r7 + mov.w @r7+,r6 + rts + .size _main, .-_main + .end diff --git a/gas/testsuite/gas/h8300/h8300.exp b/gas/testsuite/gas/h8300/h8300.exp index 10b30f4..104a882 100644 --- a/gas/testsuite/gas/h8300/h8300.exp +++ b/gas/testsuite/gas/h8300/h8300.exp @@ -2143,6 +2143,38 @@ proc do_h8300hn_addressgen {} { 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 @@ -2162,6 +2194,8 @@ if [istarget h8300*-*-*] then { do_h8300_rotate_shift do_h8300hn_addressgen + do_h8300_addsubrxcheck + # Now test the h8300h instruction parser do_h8300h_add_sub do_h8300h_logical |