From bd03da308991692d9e3f7c60135f811f11f65e49 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Thu, 3 Sep 2009 16:32:42 +0000 Subject: [PATCH] * config/tc-bfin.c (md_assemble): Bump line counters if there is EOL in the instruction. testsuite/ * gas/bfin/line_number.l, gas/bfin/line_number.s: New test. * gas/bfin/bfin.exp: Add the new test. --- gas/ChangeLog | 5 +++++ gas/config/tc-bfin.c | 4 ++++ gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/bfin/bfin.exp | 1 + gas/testsuite/gas/bfin/line_number.l | 3 +++ gas/testsuite/gas/bfin/line_number.s | 4 ++++ 6 files changed, 22 insertions(+) create mode 100644 gas/testsuite/gas/bfin/line_number.l create mode 100644 gas/testsuite/gas/bfin/line_number.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 8ea492817cd..254a5fb2bde 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2009-09-03 Jie Zhang + + * config/tc-bfin.c (md_assemble): Bump line counters if there is + EOL in the instruction. + 2009-09-03 Jie Zhang * config/bfin-defs.h (IS_GENREG): Define. diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c index 958f63da25f..4a02b6915e4 100644 --- a/gas/config/tc-bfin.c +++ b/gas/config/tc-bfin.c @@ -712,6 +712,10 @@ md_assemble (char *line) #ifdef OBJ_ELF dwarf2_emit_insn (insn_size); #endif + + while (*line++ != '\0') + if (*line == '\n') + bump_line_counters (); } /* Parse one line of instructions, and generate opcode for it. diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 0c8b3e44dbd..90b55157547 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-09-03 Jie Zhang + + * gas/bfin/line_number.l, gas/bfin/line_number.s: New test. + * gas/bfin/bfin.exp: Add the new test. + 2009-09-03 Jie Zhang * gas/bfin/expected_move_errors.s, diff --git a/gas/testsuite/gas/bfin/bfin.exp b/gas/testsuite/gas/bfin/bfin.exp index 59eed655ea9..7a70a4c29b0 100644 --- a/gas/testsuite/gas/bfin/bfin.exp +++ b/gas/testsuite/gas/bfin/bfin.exp @@ -17,6 +17,7 @@ if [istarget bfin*-*-*] { run_dump_test "flow" run_dump_test "flow2" run_list_test "invalid_arith_mode" "" + run_list_test "line_number" "" run_dump_test "load" run_dump_test "logical" run_dump_test "logical2" diff --git a/gas/testsuite/gas/bfin/line_number.l b/gas/testsuite/gas/bfin/line_number.l new file mode 100644 index 00000000000..964d809ad6a --- /dev/null +++ b/gas/testsuite/gas/bfin/line_number.l @@ -0,0 +1,3 @@ +.*: Assembler messages: +.*:4: Error: syntax error. Input text was illegal. +.*:4: Error: diff --git a/gas/testsuite/gas/bfin/line_number.s b/gas/testsuite/gas/bfin/line_number.s new file mode 100644 index 00000000000..a5e47d34828 --- /dev/null +++ b/gas/testsuite/gas/bfin/line_number.s @@ -0,0 +1,4 @@ + R1 = ROT R0 BY 0 || + R3 = [SP+12] || + nop; + ILLEGAL; -- 2.30.2