aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-10-20 11:45:19 +0100
committerNick Clifton <nickc@redhat.com>2017-10-20 11:45:19 +0100
commit808811a36951c6bc2ee9d56124603d7ef88a019e (patch)
treeae4cdacbbf0fad18ed8625bc7d792787485145ab /gas/testsuite
parent36862fc052b7006c78024952c4024c60b8a2733f (diff)
downloadgdb-808811a36951c6bc2ee9d56124603d7ef88a019e.zip
gdb-808811a36951c6bc2ee9d56124603d7ef88a019e.tar.gz
gdb-808811a36951c6bc2ee9d56124603d7ef88a019e.tar.bz2
Improve handling of REPT pseudo op with a negative count.
PR 22324 * read.c (s_rept): Use size_t type for count parameter. (do_repeat): Change type of count parameter to size_t. Issue an error is the count parameter is negative. (do_repeat_with_expression): Likewise. * read.h: Update prototypes for do_repeat and do_repeat_with_expression. * doc/as.texinfo (Rept): Document that a zero count is allowed but negative counts are not. * config/tc-rx.c (rx_rept): Use size_t type for count parameter. * config/tc-tic54x.c (tic54x_loop): Cast count parameter to size_t type. * testsuite/gas/macros/end.s: Add a test using a negative repeat count. * testsuite/gas/macros/end.l: Add expected error message.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/macros/end.l1
-rw-r--r--gas/testsuite/gas/macros/end.s3
2 files changed, 4 insertions, 0 deletions
diff --git a/gas/testsuite/gas/macros/end.l b/gas/testsuite/gas/macros/end.l
index 1675ff8..ff5d452 100644
--- a/gas/testsuite/gas/macros/end.l
+++ b/gas/testsuite/gas/macros/end.l
@@ -1,3 +1,4 @@
.*: Assembler messages:
.*:1: Warning: \.endm .* \.macro
.*:2: Warning: \.endr .* (\.rept|\.irpc?).*(\.rept|\.irpc?).*(\.rept|\.irpc?)
+.*:3: Error: negative count for REPT - ignored
diff --git a/gas/testsuite/gas/macros/end.s b/gas/testsuite/gas/macros/end.s
index 3a136c6..300b055 100644
--- a/gas/testsuite/gas/macros/end.s
+++ b/gas/testsuite/gas/macros/end.s
@@ -1,2 +1,5 @@
.endm
.endr
+ .rept -1
+ .endr
+