From af199b06016f0acab1e98de12c017f51b5d3780a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 13 Jun 2011 12:50:18 +0000 Subject: [PATCH] PR gas/12854 Add additional checks for extraneous shifts and extra tests in the testsuite. --- gas/config/tc-arm.c | 8 ++++++++ gas/testsuite/gas/arm/shift-bad.l | 13 ++++++++----- gas/testsuite/gas/arm/shift-bad.s | 7 ++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index a34dceca5db..bf329d6831d 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -11570,6 +11570,10 @@ do_t_shift (void) inst.instruction |= inst.operands[0].reg; inst.instruction |= inst.operands[2].reg << 3; + + /* PR 12854: Error on extraneous shifts. */ + constraint (inst.operands[2].shifted, + _("extraneous shift as part of operand to shift insn")); } else { @@ -11609,6 +11613,10 @@ do_t_shift (void) inst.instruction |= inst.operands[0].reg; inst.instruction |= inst.operands[2].reg << 3; + + /* PR 12854: Error on extraneous shifts. */ + constraint (inst.operands[2].shifted, + _("extraneous shift as part of operand to shift insn")); } else { diff --git a/gas/testsuite/gas/arm/shift-bad.l b/gas/testsuite/gas/arm/shift-bad.l index 6db9583cd7e..3c9fb6e476f 100644 --- a/gas/testsuite/gas/arm/shift-bad.l +++ b/gas/testsuite/gas/arm/shift-bad.l @@ -1,6 +1,9 @@ .*shift-bad.s: Assembler messages: -.*shift-bad.s:3: Error: extraneous shift as part of operand to shift insn -- `asr r0,r1,r2,ror#5' -.*shift-bad.s:4: Error: extraneous shift as part of operand to shift insn -- `ror r0,r1,r2,lsl r3' -.*shift-bad.s:8: Error: extraneous shift as part of operand to shift insn -- `ror r0,r1,r2,lsl#1' -.*shift-bad.s:9: Error: extraneous shift as part of operand to shift insn -- `lsl r0,r1,r2,lsl#1' -.*shift-bad.s:10: Error: extraneous shift as part of operand to shift insn -- `lsl r0,r1,r2,asr r0' +.*shift-bad.s:2: Error: extraneous shift as part of operand to shift insn -- `asr r0,r1,r2,ror#5' +.*shift-bad.s:3: Error: extraneous shift as part of operand to shift insn -- `ror r0,r1,r2,lsl r3' +.*shift-bad.s:7: Error: extraneous shift as part of operand to shift insn -- `ror r0,r0,r2,lsl#1' +.*shift-bad.s:8: Error: extraneous shift as part of operand to shift insn -- `lsl r0,r0,r2,lsl#1' +.*shift-bad.s:9: Error: extraneous shift as part of operand to shift insn -- `lsl r0,r0,r2,asr r0' +.*shift-bad.s:13: Error: extraneous shift as part of operand to shift insn -- `ror r0,r1,r2,lsl#1' +.*shift-bad.s:14: Error: extraneous shift as part of operand to shift insn -- `lsl r0,r1,r2,lsl#1' +.*shift-bad.s:15: Error: extraneous shift as part of operand to shift insn -- `lsl r0,r1,r2,asr r0' diff --git a/gas/testsuite/gas/arm/shift-bad.s b/gas/testsuite/gas/arm/shift-bad.s index 6e6a795abf1..6ee069b1cd3 100644 --- a/gas/testsuite/gas/arm/shift-bad.s +++ b/gas/testsuite/gas/arm/shift-bad.s @@ -1,10 +1,15 @@ - .syntax unified asr r0, r1, r2, ror #5 ror r0, r1, r2, lsl r3 .thumb_func foo: + ror r0, r0, r2, lsl #1 + lsl r0, r0, r2, lsl #1 + lsl r0, r0, r2, asr r0 + + .syntax unified + ror r0, r1, r2, lsl #1 lsl r0, r1, r2, lsl #1 lsl r0, r1, r2, asr r0 -- 2.30.2