From fe0171d248e6d4cbc59c3101b9e74e18a9292294 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 26 Feb 2021 16:37:30 +0000 Subject: [PATCH] Correct an error message in the ARM assembler. PR 27411 * config/tc-arm.c (do_t_add_sub): Correct error message. * testsuite/gas/arm/pr27411.s: New test. * testsuite/gas/arm/pr27411.d: New test driver. * testsuite/gas/arm/pr27411.l: Expected error output for new test. --- gas/ChangeLog | 8 ++++++++ gas/config/tc-arm.c | 2 +- gas/testsuite/gas/arm/pr27411.d | 2 ++ gas/testsuite/gas/arm/pr27411.l | 6 ++++++ gas/testsuite/gas/arm/pr27411.s | 14 ++++++++++++++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/arm/pr27411.d create mode 100644 gas/testsuite/gas/arm/pr27411.l create mode 100644 gas/testsuite/gas/arm/pr27411.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 8086006ca16..8dd9a59d072 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2021-02-26 Nick Clifton + + PR 27411 + * config/tc-arm.c (do_t_add_sub): Correct error message. + * testsuite/gas/arm/pr27411.s: New test. + * testsuite/gas/arm/pr27411.d: New test driver. + * testsuite/gas/arm/pr27411.l: Expected error output for new test. + 2021-02-24 Alan Modra PR 23691 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index d3bb56d7ba6..e35cdd51901 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -11635,7 +11635,7 @@ do_t_add_sub (void) } } else - constraint (inst.size_req == 2, BAD_HIREG); + constraint (inst.size_req == 2, _("cannot honor width suffix")); } if (inst.size_req == 4 || (inst.size_req != 2 && !opcode)) diff --git a/gas/testsuite/gas/arm/pr27411.d b/gas/testsuite/gas/arm/pr27411.d new file mode 100644 index 00000000000..14dcf43c3e4 --- /dev/null +++ b/gas/testsuite/gas/arm/pr27411.d @@ -0,0 +1,2 @@ +# name: PR 27411: Invalid immediate constants produce wrong error message +# error_output: pr27411.l diff --git a/gas/testsuite/gas/arm/pr27411.l b/gas/testsuite/gas/arm/pr27411.l new file mode 100644 index 00000000000..7201aa31ea7 --- /dev/null +++ b/gas/testsuite/gas/arm/pr27411.l @@ -0,0 +1,6 @@ +[^:]*: Assembler messages: +[^:]*:6: Error: cannot honor width suffix -- `add.n r4,#8' +[^:]*:9: Error: cannot honor width suffix -- `sub.n r4,#8' +[^:]*:12: Error: cannot honor width suffix -- `lsl.n r4,#8' +[^:]*:13: Error: cannot honor width suffix -- `lsl.n sp,#8' +#pass diff --git a/gas/testsuite/gas/arm/pr27411.s b/gas/testsuite/gas/arm/pr27411.s new file mode 100644 index 00000000000..0d1f25bdd29 --- /dev/null +++ b/gas/testsuite/gas/arm/pr27411.s @@ -0,0 +1,14 @@ + .syntax unified + .thumb + .align 2 + .thumb_func +f1: + add.n r4, #8 + add.n sp, #8 + add.w r4, #8 + sub.n r4, #8 + sub.n sp, #8 + sub.w r4, #8 + lsl.n r4, #8 + lsl.n sp, #8 + lsl.w r4, #8 -- 2.30.2