From 02dde21ba835d365506c3e5a1fa2b44a61ac1efb Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 30 Apr 2004 10:51:13 +0000 Subject: [PATCH] Fix handling of case sensitive register aliases and add a test for the bug --- gas/ChangeLog | 9 +++++++ gas/config/tc-arm.c | 8 +++---- gas/testsuite/ChangeLog | 8 +++++++ gas/testsuite/gas/arm/arm.exp | 50 +++++++++++---------------------------- gas/testsuite/gas/arm/reg-alias.d | 10 ++++++++ gas/testsuite/gas/arm/reg-alias.s | 14 +++++++++++ 6 files changed, 59 insertions(+), 40 deletions(-) create mode 100644 gas/testsuite/gas/arm/reg-alias.d create mode 100644 gas/testsuite/gas/arm/reg-alias.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 8743b2463..53570b915 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2004-04-30 Nick Clifton + + * config/tc-arm.c (create_register_alias): Fix typo checking for + case sensitive register aliases. + (co_proc_number): Use error message string in all_reg_maps[] + array. + (cp_reg_required_here): Likewise. + (fp_reg_required_here): Likewise. + 2004-04-29 Brian Ford * dwarf2dbg.c (dwarf2_finish): Add SEC_DEBUGGING to section flags. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 0269df327..3f21c84a6 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -3595,7 +3595,7 @@ co_proc_number (str) } else { - inst.error = _("bad or missing co-processor number"); + inst.error = all_reg_maps[REG_TYPE_CP].expected; return FAIL; } } @@ -3650,7 +3650,7 @@ cp_reg_required_here (str, where) /* In the few cases where we might be able to accept something else this error can be overridden. */ - inst.error = _("co-processor register expected"); + inst.error = all_reg_maps[REG_TYPE_CN].expected; /* Restore the start point. */ *str = start; @@ -3673,7 +3673,7 @@ fp_reg_required_here (str, where) /* In the few cases where we might be able to accept something else this error can be overridden. */ - inst.error = _("floating point register expected"); + inst.error = all_reg_maps[REG_TYPE_FN].expected; /* Restore the start point. */ *str = start; @@ -11439,7 +11439,7 @@ create_register_alias (newname, p) char *copy_of_str; char *r; -#ifdef IGNORE_OPCODE_CASE +#ifndef IGNORE_OPCODE_CASE newname = original_case_string; #endif copy_of_str = newname; diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 1cfce64ed..70b65bc4b 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2004-04-30 Nick Clifton + + * gas/arm/reg-alias.s: New file: Test case sensitive register + aliases. + * gas/arm/reg-alias.d: New file: Expected test output. + * gas/arm/arm.exp: Run reg-alias test. + Arrange tests in a more orderly fashion. + 2004-04-30 Ben Elliston * gas/ppc/power4.s: Add dcbz and dcbzl test cases. diff --git a/gas/testsuite/gas/arm/arm.exp b/gas/testsuite/gas/arm/arm.exp index e5ec8be41..36045e6c1 100644 --- a/gas/testsuite/gas/arm/arm.exp +++ b/gas/testsuite/gas/arm/arm.exp @@ -28,66 +28,44 @@ if {[istarget *arm*-*-*] || [istarget "xscale-*-*"]} then { run_dump_test "copro" } - run_dump_test "armv1" - - run_errors_test "armv1-bad" "-mcpu=arm7m" "ARM v1 errors" - gas_test "arm3.s" "-mcpu=arm3" $stdoptlist "Arm 3 instructions" - gas_test "arm6.s" "-mcpu=arm6" $stdoptlist "Arm 6 instructions" - gas_test "arm7dm.s" "-mcpu=arm7dm" $stdoptlist "Arm 7DM instructions" - - if {! [istarget arm*-*-aout] && ![istarget arm-*-pe]} then { - # The arm-aout port does not support Thumb mode. - gas_test "thumb.s" "-mcpu=arm7t" $stdoptlist "Thumb instructions" - } - gas_test "arch4t.s" "-march=armv4t" $stdoptlist "Arm architecture 4t instructions" - - run_dump_test "arch5tej" - gas_test "immed.s" "" $stdoptlist "immediate expressions" - gas_test "float.s" "-mcpu=arm7tdmi -mfpu=fpa" $stdoptlist "Core floating point instructions" + gas_test "offset.s" "" $stdoptlist "OFFSET_IMM regression" + run_dump_test "armv1" + run_dump_test "arch5tej" run_dump_test "fpa-monadic" - run_dump_test "fpa-dyadic" - run_dump_test "fpa-mem" - run_dump_test "vfp1xD" - run_dump_test "vfp1" - run_dump_test "vfp2" - - run_errors_test "vfp-bad" "-mfpu=vfp" "VFP errors" - run_dump_test "xscale" - run_dump_test "adrl" - - run_errors_test "req" "-mcpu=arm7m" ".req errors" - - run_dump_test "maverick" - + run_dump_test "reg-alias" + run_dump_test "maverick" run_dump_test "archv6" - run_dump_test "thumbv6" - + + run_errors_test "vfp-bad" "-mfpu=vfp" "VFP errors" + run_errors_test "req" "-mcpu=arm7m" ".req errors" + run_errors_test "armv1-bad" "-mcpu=arm7m" "ARM v1 errors" run_errors_test "r15-bad" "" "Invalid use of r15 errors" + run_errors_test "undefined" "" "Undefined local label error" if {[istarget *-*-elf*] || [istarget *-*-linux*]} then { run_dump_test "pic" - run_dump_test "mapping" } - gas_test "offset.s" "" $stdoptlist "OFFSET_IMM regression" - - run_errors_test "undefined" "" "Undefined local label error" + if {! [istarget arm*-*-aout] && ![istarget arm-*-pe]} then { + # The arm-aout port does not support Thumb mode. + gas_test "thumb.s" "-mcpu=arm7t" $stdoptlist "Thumb instructions" + } } # Not all arm targets are bi-endian, so only run this test on ones diff --git a/gas/testsuite/gas/arm/reg-alias.d b/gas/testsuite/gas/arm/reg-alias.d new file mode 100644 index 000000000..d9b4be29a --- /dev/null +++ b/gas/testsuite/gas/arm/reg-alias.d @@ -0,0 +1,10 @@ +#objdump: -dr --prefix-addresses --show-raw-insn +#name: Case Sensitive Register Aliases + +.*: +file format .*arm.* + +Disassembly of section .text: +0+0 <.*> ee060f10 mcr 15, 0, r0, cr6, cr0, \{0\} +0+4 <.*> e1a00000 nop \(mov r0,r0\) +0+8 <.*> e1a00000 nop \(mov r0,r0\) +0+c <.*> e1a00000 nop \(mov r0,r0\) diff --git a/gas/testsuite/gas/arm/reg-alias.s b/gas/testsuite/gas/arm/reg-alias.s new file mode 100644 index 000000000..5086b8b4c --- /dev/null +++ b/gas/testsuite/gas/arm/reg-alias.s @@ -0,0 +1,14 @@ + @ Test case-sensitive register aliases + .text + .global fred +fred: + +MMUPurgeTLBReg .req c6 +MMUCP .req p15 + +MCR MMUCP, 0, a1, MMUPurgeTLBReg, c0, 0 + @ The NOPs are here for ports like arm-aout which will pad + @ the .text section to a 16 byte boundary. + nop + nop + nop -- 2.11.4.GIT