diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 4fd13d3d89..42871d2e82 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,19 @@ +Thu Aug 30 21:58:48 2001 J"orn Rennecke + + * gas/h8300/h8300.exp (do_h8300_cbranch): Remove invocation. + (do_h8300_branch, do_h8300h_cbranch, do_h8300h_branch): Likewise. + (do_h8300s_cbranch, do_h8300s_branch, ffxx1): Likwise. + * gas/h8300/h8300-coff.exp, gas/h8300/h8300-elf.exp: New files. + * gas/h8300/branch-elf.s, gas/h8300/branchh-elf.s: Likewise. + * gas/h8300/branchs-elf.s, gas/h8300/ffxx1-elf.d: Likewise. + * gas/h8300/ffxx1-elf.s: Likewise. + * gas/h8300/branch.s, gas/h8300/branchh.s: Move to: + * gas/h8300/branch-coff.s, gas/h8300/branchh-coff.s + * gas/h8300/branchs.s, gas/h8300/ffxx1.d: Move to: + * gas/h8300/branchs-coff.s, gas/h8300/ffxx1-coff.d . + * gas/h8300/ffxx1.s: Move to: + * gas/h8300/ffxx1-coff.s . + Wed Aug 29 12:05:13 2001 J"orn Rennecke * lib/gas-defs.exp: (regexp_diff) At verbosity 3, also show diff --git a/gas/testsuite/gas/h8300/branch.s b/gas/testsuite/gas/h8300/branch-coff.s similarity index 100% rename from gas/testsuite/gas/h8300/branch.s rename to gas/testsuite/gas/h8300/branch-coff.s diff --git a/gas/testsuite/gas/h8300/branch-elf.s b/gas/testsuite/gas/h8300/branch-elf.s new file mode 100644 index 0000000000..8a0fbb14dd --- /dev/null +++ b/gas/testsuite/gas/h8300/branch-elf.s @@ -0,0 +1,13 @@ + .section zpage +vector: + .word h8300_branches + .text +h8300_branches: + bsr h8300_branches + jmp h8300_branches + jmp @r0 + jmp @@vector:8 + jsr h8300_branches + jsr @r0 + jsr @@vector:8 + diff --git a/gas/testsuite/gas/h8300/branchh.s b/gas/testsuite/gas/h8300/branchh-coff.s similarity index 100% rename from gas/testsuite/gas/h8300/branchh.s rename to gas/testsuite/gas/h8300/branchh-coff.s diff --git a/gas/testsuite/gas/h8300/branchh-elf.s b/gas/testsuite/gas/h8300/branchh-elf.s new file mode 100644 index 0000000000..7cbc62f3e2 --- /dev/null +++ b/gas/testsuite/gas/h8300/branchh-elf.s @@ -0,0 +1,12 @@ + .h8300h + .text +h8300h_branches: + bsr h8300h_branches:8 + bsr h8300h_branches:16 + jmp h8300h_branches + jmp @er0 + jmp @@16:8 + jsr h8300h_branches + jsr @er0 + jsr @@16:8 + diff --git a/gas/testsuite/gas/h8300/branchs.s b/gas/testsuite/gas/h8300/branchs-coff.s similarity index 100% rename from gas/testsuite/gas/h8300/branchs.s rename to gas/testsuite/gas/h8300/branchs-coff.s diff --git a/gas/testsuite/gas/h8300/branchs-elf.s b/gas/testsuite/gas/h8300/branchs-elf.s new file mode 100644 index 0000000000..8f33e17967 --- /dev/null +++ b/gas/testsuite/gas/h8300/branchs-elf.s @@ -0,0 +1,12 @@ + .h8300s + .text +h8300s_branches: + bsr h8300s_branches:8 + bsr h8300s_branches:16 + jmp h8300s_branches + jmp @er0 + jmp @@16:8 + jsr h8300s_branches + jsr @er0 + jsr @@16:8 + diff --git a/gas/testsuite/gas/h8300/ffxx1.d b/gas/testsuite/gas/h8300/ffxx1-coff.d similarity index 100% rename from gas/testsuite/gas/h8300/ffxx1.d rename to gas/testsuite/gas/h8300/ffxx1-coff.d diff --git a/gas/testsuite/gas/h8300/ffxx1.s b/gas/testsuite/gas/h8300/ffxx1-coff.s similarity index 100% rename from gas/testsuite/gas/h8300/ffxx1.s rename to gas/testsuite/gas/h8300/ffxx1-coff.s diff --git a/gas/testsuite/gas/h8300/ffxx1-elf.d b/gas/testsuite/gas/h8300/ffxx1-elf.d new file mode 100644 index 0000000000..5640f22f22 --- /dev/null +++ b/gas/testsuite/gas/h8300/ffxx1-elf.d @@ -0,0 +1,22 @@ +#objdump: --prefix-addresses -dr +#name: FFxx1 + +# Test for FFxx:8 addressing. + +.*: file format .*h8300.* + +Disassembly of section .text: +0+0000 04 00 orc #0x0,ccr + 0: R_H8_DIR16 .text[+]0x400 + ... +0+0400
f8 7f mov.b #0x7f,r0l +0+0402 28 bb mov.b @0xbb:8,r0l +0+0404 6a 88 ff b9 mov.b r0l,@0xffb9:16 +0+0408 f8 01 mov.b #0x1,r0l +0+040a 6a 88 ff bb mov.b r0l,@0xffbb:16 +0+040e 79 01 00 00 mov.w #0x0,r1 +0+0412 0b 01 adds #0x1,er1 +0+0414 46 fc bne .-4 \(412\) +0+0416 12 88 rotl r0l +0+0418 40 f0 bra .-16 \(40a\) + ... diff --git a/gas/testsuite/gas/h8300/ffxx1-elf.s b/gas/testsuite/gas/h8300/ffxx1-elf.s new file mode 100644 index 0000000000..53fc84160d --- /dev/null +++ b/gas/testsuite/gas/h8300/ffxx1-elf.s @@ -0,0 +1,20 @@ + .equ p6ddr, 0xffb9 ;0x7f for output + .equ p6dr, 0xffbb + .equ seed, 0x01 + .text + .org 0 +reset: .word main ;reset vector +; + .org 0x400 +main: mov.b #0x7f,r0l ;port 6 ddr = 7F + mov.b @0xffbb:8,r0l ;***test*** + mov.b r0l,@p6ddr:16 +; + mov.b #seed,r0l ;start with 0000001 +loop: mov.b r0l,@p6dr:16 ;output to port 6 +delay: mov.w #0x0000,r1 +deloop: adds.w #1,r1 + bne deloop:8 ;not = 0 + rotl r0l + bra loop:8 + .word 0 diff --git a/gas/testsuite/gas/h8300/h8300-coff.exp b/gas/testsuite/gas/h8300/h8300-coff.exp new file mode 100644 index 0000000000..d6b9c9cd0b --- /dev/null +++ b/gas/testsuite/gas/h8300/h8300-coff.exp @@ -0,0 +1,283 @@ +# +# Some H8/300 coff tests +# +proc do_h8300_cbranch {} { + set testname "cbranch.s: h8300 conditional branch tests" + set x 0 + + gas_start "cbranch.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 4200\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 4300\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 4600\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 4700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 4800\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 4900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 20] then { pass $testname } else { fail $testname } +} + +proc do_h8300_branch {} { + set testname "branch.s: h8300 branch tests" + set x 0 + + gas_start "branch-coff.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 5500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5A000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 5900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 5B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 5E000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 5F00\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 7] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_cbranch {} { + set testname "cbranchh.s: h8300h conditional branch tests" + set x 0 + + gas_start "cbranchh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 4200\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 4300\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 4600\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 4700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 4800\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 4900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 40] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_branch {} { + set testname "branchh.s: h8300h branch tests" + set x 0 + + gas_start "branchh-coff.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 5500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 5900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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_h8300s_cbranch {} { + set testname "cbranchs.s: h8300s conditional branch tests" + set x 0 + + gas_start "cbranchs.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 4000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 4100\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 4200\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 4300\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 4400\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 4500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 4600\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 4700\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 4800\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 4900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 40] then { pass $testname } else { fail $testname } +} + +proc do_h8300s_branch {} { + set testname "branchs.s: h8300s branch tests" + set x 0 + + gas_start "branchs-coff.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 5500\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 5900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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*-*-coff] + || [istarget h8300*-*-hms*] + || [istarget h8300*-*-rtems*] } then { + + # Test the basic h8300 instruction parser + do_h8300_cbranch + do_h8300_branch + + # Now test the h8300h instruction parser + do_h8300h_cbranch + do_h8300h_branch + + # Now test the h8300s instruction parser + do_h8300s_cbranch + do_h8300s_branch + + # Now some random tests + run_dump_test "ffxx1-coff" +} diff --git a/gas/testsuite/gas/h8300/h8300-elf.exp b/gas/testsuite/gas/h8300/h8300-elf.exp new file mode 100644 index 0000000000..260e8d9ebc --- /dev/null +++ b/gas/testsuite/gas/h8300/h8300-elf.exp @@ -0,0 +1,280 @@ +# +# Some H8/300 elf tests +# +proc do_h8300_cbranch {} { + set testname "cbranch.s: h8300 conditional branch tests" + set x 0 + + gas_start "cbranch.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 40FE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 40FC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 41FA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 41F8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 42F6\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 43F4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 44F2\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 44F0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 45EE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 45EC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 46EA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 47E8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 48E6\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 49E4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 4AE2\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 4BE0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 4CDE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 4DDC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 4EDA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 4FD8\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 20] then { pass $testname } else { fail $testname } +} + +proc do_h8300_branch {} { + set testname "branch.s: h8300 branch tests" + set x 0 + + gas_start "branch-elf.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 55FE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5A000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 5900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 5B00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 5E000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 5F00\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 7] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_cbranch {} { + set testname "cbranchh.s: h8300h conditional branch tests" + set x 0 + + gas_start "cbranchh.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 40FE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 40FC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 41FA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 41F8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 42F6\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 43F4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 44F2\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 44F0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 45EE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 45EC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 46EA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 47E8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 48E6\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 49E4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 4AE2\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 4BE0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 4CDE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 4DDC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 4EDA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 4FD8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 5800FFD4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c 5800FFD0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 5810FFCC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 5810FFC8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0038 5820FFC4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 003c 5830FFC0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0040 5840FFBC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0044 5840FFB8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0048 5850FFB4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 5850FFB0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0050 5860FFAC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0054 5870FFA8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0058 5880FFA4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 005c 5890FFA0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0060 58A0FF9C\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0064 58B0FF98\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0068 58C0FF94\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 006c 58D0FF90\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0070 58E0FF8C\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0074 58F0FF88\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 40] then { pass $testname } else { fail $testname } +} + +proc do_h8300h_branch {} { + set testname "branchh.s: h8300h branch tests" + set x 0 + + gas_start "branchh-elf.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 55FE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5C00FFFA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 5900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 5B10\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 5F10\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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_h8300s_cbranch {} { + set testname "cbranchs.s: h8300s conditional branch tests" + set x 0 + + gas_start "cbranchs.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 40FE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 40FC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0004 41FA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 41F8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0008 42F6\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 43F4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 44F2\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 44F0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0010 45EE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 45EC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 46EA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0016 47E8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0018 48E6\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001a 49E4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001c 4AE2\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 001e 4BE0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0020 4CDE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0022 4DDC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0024 4EDA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0026 4FD8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0028 5800FFD4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 002c 5800FFD0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0030 5810FFCC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0034 5810FFC8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0038 5820FFC4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 003c 5830FFC0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0040 5840FFBC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0044 5840FFB8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0048 5850FFB4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 004c 5850FFB0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0050 5860FFAC\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0054 5870FFA8\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0058 5880FFA4\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 005c 5890FFA0\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0060 58A0FF9C\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0064 58B0FF98\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0068 58C0FF94\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 006c 58D0FF90\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0070 58E0FF8C\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0074 58F0FF88\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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 == 40] then { pass $testname } else { fail $testname } +} + +proc do_h8300s_branch {} { + set testname "branchs.s: h8300s branch tests" + set x 0 + + gas_start "branchs-elf.s" "-al" + + # Check each instruction bit pattern to verify it got + # assembled correctly. + while 1 { + expect { + -re " +\[0-9\]+ 0000 55FE\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0002 5C00FFFA\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000a 5900\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000c 5B10\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n" { set x [expr $x+1] } + -re " +\[0-9\]+ 0014 5F10\[^\n\]*\n" { set x [expr $x+1] } + timeout { perror "timeout\n; break } + 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*-*-elf] then { + # Test the basic h8300 instruction parser + do_h8300_cbranch + do_h8300_branch + + # Now test the h8300h instruction parser + do_h8300h_cbranch + do_h8300h_branch + + # Now test the h8300s instruction parser + do_h8300s_cbranch + do_h8300s_branch + + # Now some random tests + run_dump_test "ffxx1-elf" +} diff --git a/gas/testsuite/gas/h8300/h8300.exp b/gas/testsuite/gas/h8300/h8300.exp index 013c55c8b5..a34876e019 100644 --- a/gas/testsuite/gas/h8300/h8300.exp +++ b/gas/testsuite/gas/h8300/h8300.exp @@ -2111,12 +2111,10 @@ if [istarget h8300*-*-*] then { # Test the basic h8300 instruction parser do_h8300_add_sub do_h8300_logical - do_h8300_cbranch do_h8300_bitops1 do_h8300_bitops2 do_h8300_bitops3 do_h8300_bitops4 - do_h8300_branch do_h8300_compare do_h8300_decimal do_h8300_incdec @@ -2130,12 +2128,10 @@ if [istarget h8300*-*-*] then { # Now test the h8300h instruction parser do_h8300h_add_sub do_h8300h_logical - do_h8300h_cbranch do_h8300h_bitops1 do_h8300h_bitops2 do_h8300h_bitops3 do_h8300h_bitops4 - do_h8300h_branch do_h8300h_compare do_h8300h_decimal do_h8300h_incdec @@ -2151,12 +2147,10 @@ if [istarget h8300*-*-*] then { # Now test the h8300s instruction parser do_h8300s_add_sub do_h8300s_logical - do_h8300s_cbranch do_h8300s_bitops1 do_h8300s_bitops2 do_h8300s_bitops3 do_h8300s_bitops4 - do_h8300s_branch do_h8300s_compare do_h8300s_decimal do_h8300s_incdec @@ -2178,6 +2172,5 @@ if [istarget h8300*-*-*] then { set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ] set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*]] - run_dump_test "ffxx1" gas_test "cmpsi2.s" "" "" "cmpsi2.s" }