From f86adc0752c2c939c5889ec7ed6ee2d3f20f1fb2 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 4 Aug 2009 14:56:10 +0000 Subject: [PATCH] * config/tc-arm.c (my_get_expression): Detect missing expressions. testsuite/ * gas/arm/missing.s: New. * gas/arm/missing.d: New. * gas/arm/missing.l: New. --- gas/ChangeLog | 4 ++++ gas/config/tc-arm.c | 7 ++++--- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/arm/missing.d | 3 +++ gas/testsuite/gas/arm/missing.l | 3 +++ gas/testsuite/gas/arm/missing.s | 2 ++ 6 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 gas/testsuite/gas/arm/missing.d create mode 100644 gas/testsuite/gas/arm/missing.l create mode 100644 gas/testsuite/gas/arm/missing.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 62c8a61c908..58564c64f5c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2009-08-04 Nathan Sidwell + + * config/tc-arm.c (my_get_expression): Detect missing expressions. + 2009-08-02 Eric B. Weddington * config/tc-avr.c (mcu_types): Add atmega8m1, atmega8c1, atmega16c1. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 1fe7f4c9e16..b843b62be70 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -913,13 +913,14 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode) seg = expression (ep); in_my_get_expression = 0; - if (ep->X_op == O_illegal) + if (ep->X_op == O_illegal || ep->X_op == O_absent) { - /* We found a bad expression in md_operand(). */ + /* We found a bad or missing expression in md_operand(). */ *str = input_line_pointer; input_line_pointer = save_in; if (inst.error == NULL) - inst.error = _("bad expression"); + inst.error = (ep->X_op == O_absent + ? _("missing expression") :_("bad expression")); return 1; } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 4ab5e729a11..29b04dd9a3d 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-08-04 Nathan Sidwell + + * gas/arm/missing.s: New. + * gas/arm/missing.d: New. + * gas/arm/missing.l: New. + 2009-07-15 Daniel Gutson Daniel Jacobowitz diff --git a/gas/testsuite/gas/arm/missing.d b/gas/testsuite/gas/arm/missing.d new file mode 100644 index 00000000000..6a0cbf2dbb6 --- /dev/null +++ b/gas/testsuite/gas/arm/missing.d @@ -0,0 +1,3 @@ +#name: missing operands +#as: -march=armv5 +#error-output: missing.l diff --git a/gas/testsuite/gas/arm/missing.l b/gas/testsuite/gas/arm/missing.l new file mode 100644 index 00000000000..d6e59658d5b --- /dev/null +++ b/gas/testsuite/gas/arm/missing.l @@ -0,0 +1,3 @@ +[^:]*: Assembler messages: +[^:]*:1: Error: missing expression -- `bl' +[^:]*:2: Error: missing expression -- `blx' diff --git a/gas/testsuite/gas/arm/missing.s b/gas/testsuite/gas/arm/missing.s new file mode 100644 index 00000000000..c3e293578b9 --- /dev/null +++ b/gas/testsuite/gas/arm/missing.s @@ -0,0 +1,2 @@ + bl + blx -- 2.30.2