Fix handling of case sensitive register aliases and add a test for the bug
authorNick Clifton <nickc@redhat.com>
Fri, 30 Apr 2004 10:51:13 +0000 (10:51 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 30 Apr 2004 10:51:13 +0000 (10:51 +0000)
gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/arm.exp
gas/testsuite/gas/arm/reg-alias.d [new file with mode: 0644]
gas/testsuite/gas/arm/reg-alias.s [new file with mode: 0644]

index 8743b24639bf0d8bce74346e7f8dadf818ceb62c..53570b9152fd05d89c3b8e910ec8e265356d4e5d 100644 (file)
@@ -1,3 +1,12 @@
+2004-04-30  Nick Clifton  <nickc@redhat.com>
+
+       * 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  <ford@vss.fsi.com>
 
        * dwarf2dbg.c (dwarf2_finish): Add SEC_DEBUGGING to section flags.
index 0269df3270bf55153653d452d700934d5bc1ef06..3f21c84a6ce6f07b995e3b5da4d28d39cbb7f3c9 100644 (file)
@@ -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;
index 1cfce64ede428f3c0e15d8ca0696e9fa3ba1bef5..70b65bc4b45072faf9bf27c5a38cf179255c3112 100644 (file)
@@ -1,3 +1,11 @@
+2004-04-30  Nick Clifton  <nickc@redhat.com>
+
+       * 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  <bje@au.ibm.com>
 
        * gas/ppc/power4.s: Add dcbz and dcbzl test cases.
index e5ec8be412688bcc8b51bdc9848afd502c18efee..36045e6c1ef20fe2ce99cb04a726a0264ec6f3ec 100644 (file)
@@ -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 (file)
index 0000000..d9b4be2
--- /dev/null
@@ -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 (file)
index 0000000..5086b8b
--- /dev/null
@@ -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