From 057e28f5a77afd7f77454503b93e35f8290a3cd2 Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Thu, 30 Aug 2001 21:08:43 +0000 Subject: [PATCH] * 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 . --- gas/testsuite/ChangeLog | 16 ++ .../gas/h8300/{branch.s => branch-coff.s} | 0 gas/testsuite/gas/h8300/{branch.s => branch-elf.s} | 7 +- .../gas/h8300/{branchh.s => branchh-coff.s} | 0 .../gas/h8300/{branchh.s => branchh-elf.s} | 0 .../gas/h8300/{branchs.s => branchs-coff.s} | 0 .../gas/h8300/{branchs.s => branchs-elf.s} | 0 gas/testsuite/gas/h8300/{ffxx1.d => ffxx1-coff.d} | 0 gas/testsuite/gas/h8300/{ffxx1.s => ffxx1-coff.s} | 0 gas/testsuite/gas/h8300/{ffxx1.d => ffxx1-elf.d} | 9 +- gas/testsuite/gas/h8300/{ffxx1.s => ffxx1-elf.s} | 0 gas/testsuite/gas/h8300/h8300-coff.exp | 283 +++++++++++++++++++++ gas/testsuite/gas/h8300/h8300-elf.exp | 280 ++++++++++++++++++++ gas/testsuite/gas/h8300/h8300.exp | 7 - 14 files changed, 588 insertions(+), 14 deletions(-) copy gas/testsuite/gas/h8300/{branch.s => branch-coff.s} (100%) rename gas/testsuite/gas/h8300/{branch.s => branch-elf.s} (56%) copy gas/testsuite/gas/h8300/{branchh.s => branchh-coff.s} (100%) rename gas/testsuite/gas/h8300/{branchh.s => branchh-elf.s} (100%) copy gas/testsuite/gas/h8300/{branchs.s => branchs-coff.s} (100%) rename gas/testsuite/gas/h8300/{branchs.s => branchs-elf.s} (100%) copy gas/testsuite/gas/h8300/{ffxx1.d => ffxx1-coff.d} (100%) copy gas/testsuite/gas/h8300/{ffxx1.s => ffxx1-coff.s} (100%) rename gas/testsuite/gas/h8300/{ffxx1.d => ffxx1-elf.d} (74%) rename gas/testsuite/gas/h8300/{ffxx1.s => ffxx1-elf.s} (100%) create mode 100644 gas/testsuite/gas/h8300/h8300-coff.exp create mode 100644 gas/testsuite/gas/h8300/h8300-elf.exp diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 4fd13d3d8..42871d2e8 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% copy from gas/testsuite/gas/h8300/branch.s copy to gas/testsuite/gas/h8300/branch-coff.s diff --git a/gas/testsuite/gas/h8300/branch.s b/gas/testsuite/gas/h8300/branch-elf.s similarity index 56% rename from gas/testsuite/gas/h8300/branch.s rename to gas/testsuite/gas/h8300/branch-elf.s index 25806153c..8a0fbb14d 100644 --- a/gas/testsuite/gas/h8300/branch.s +++ b/gas/testsuite/gas/h8300/branch-elf.s @@ -1,10 +1,13 @@ + .section zpage +vector: + .word h8300_branches .text h8300_branches: bsr h8300_branches jmp h8300_branches jmp @r0 - jmp @@16:8 + jmp @@vector:8 jsr h8300_branches jsr @r0 - jsr @@16:8 + jsr @@vector:8 diff --git a/gas/testsuite/gas/h8300/branchh.s b/gas/testsuite/gas/h8300/branchh-coff.s similarity index 100% copy from gas/testsuite/gas/h8300/branchh.s copy to gas/testsuite/gas/h8300/branchh-coff.s diff --git a/gas/testsuite/gas/h8300/branchh.s b/gas/testsuite/gas/h8300/branchh-elf.s similarity index 100% rename from gas/testsuite/gas/h8300/branchh.s rename to gas/testsuite/gas/h8300/branchh-elf.s diff --git a/gas/testsuite/gas/h8300/branchs.s b/gas/testsuite/gas/h8300/branchs-coff.s similarity index 100% copy from gas/testsuite/gas/h8300/branchs.s copy to gas/testsuite/gas/h8300/branchs-coff.s diff --git a/gas/testsuite/gas/h8300/branchs.s b/gas/testsuite/gas/h8300/branchs-elf.s similarity index 100% rename from gas/testsuite/gas/h8300/branchs.s rename to gas/testsuite/gas/h8300/branchs-elf.s diff --git a/gas/testsuite/gas/h8300/ffxx1.d b/gas/testsuite/gas/h8300/ffxx1-coff.d similarity index 100% copy from gas/testsuite/gas/h8300/ffxx1.d copy 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% copy from gas/testsuite/gas/h8300/ffxx1.s copy to gas/testsuite/gas/h8300/ffxx1-coff.s diff --git a/gas/testsuite/gas/h8300/ffxx1.d b/gas/testsuite/gas/h8300/ffxx1-elf.d similarity index 74% rename from gas/testsuite/gas/h8300/ffxx1.d rename to gas/testsuite/gas/h8300/ffxx1-elf.d index 93455d521..5640f22f2 100644 --- a/gas/testsuite/gas/h8300/ffxx1.d +++ b/gas/testsuite/gas/h8300/ffxx1-elf.d @@ -6,8 +6,9 @@ .*: file format .*h8300.* Disassembly of section .text: +0+0000 04 00 orc #0x0,ccr + 0: R_H8_DIR16 .text[+]0x400 ... - 0: 16 main 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 @@ -15,9 +16,7 @@ Disassembly of section .text: 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 00 bne .0 \(416\) - 415: DISP8 deloop[+]0xffffffff +0+0414 46 fc bne .-4 \(412\) 0+0416 12 88 rotl r0l -0+0418 40 00 bra .0 \(41a\) - 419: DISP8 loop[+]0xffffffff +0+0418 40 f0 bra .-16 \(40a\) ... diff --git a/gas/testsuite/gas/h8300/ffxx1.s b/gas/testsuite/gas/h8300/ffxx1-elf.s similarity index 100% rename from gas/testsuite/gas/h8300/ffxx1.s rename to gas/testsuite/gas/h8300/ffxx1-elf.s diff --git a/gas/testsuite/gas/h8300/h8300-coff.exp b/gas/testsuite/gas/h8300/h8300-coff.exp new file mode 100644 index 000000000..d6b9c9cd0 --- /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 000000000..260e8d9eb --- /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 013c55c8b..a34876e01 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" } -- 2.11.4.GIT