diff options
author | Jan Beulich <jbeulich@novell.com> | 2005-04-25 06:43:46 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2005-04-25 06:43:46 +0000 |
commit | 02ddf1568180e41117d6d2804636e64775ac37b6 (patch) | |
tree | 4588484ed90e22025ecfedf8a3b007e67accab0f /gas/testsuite | |
parent | fc41e3d163065a3876e13f2f61579bb59c1accb5 (diff) | |
download | gdb-02ddf1568180e41117d6d2804636e64775ac37b6.zip gdb-02ddf1568180e41117d6d2804636e64775ac37b6.tar.gz gdb-02ddf1568180e41117d6d2804636e64775ac37b6.tar.bz2 |
gas/
2005-04-25 Jan Beulich <jbeulich@novell.com>
* macro.c (macro_expand_body): Replace locals indicator parameters
with actual macro_entry. New local variables macro_line and err.
Don't return when encountering an error, just record the fact.
Detect local symbol name colliding with parameter. Track line number
inside of macro expansion.
(do_formals): Move local variable name to wider scope. Check
parameter of the same name doesn't already exist. In MRI mode, also
check it doesn't collide with the argument count pseudo-parameter).
(define_macro): Add file and line number parameters. Remove local
variable namestr. New local variable error. Initialize macro_entry
members file, line, and name. Don't return when encountering an
error, just record the fact. Use %s in some diagnostics for read.c
to insert the macro name. Free macro_entry on error.
(macro_expand): Pass macro_entry to macro_epand_body. Don't return
when encountering an error, just record the fact.
(expand_irp): Don't return when encountering an error, just record
the fact.
* macro.h (macro_struct): New members name, file, and line.
(define_macro): Add file and line number parameters.
* read.c (s_macro): Pass file and line to define_macro. Tag warning
regarding pseudo-op redefinition with the file/line that macro
definition started at.
gas/testsuite/
2005-04-25 Jan Beulich <jbeulich@novell.com>
* gas/macros/badarg.s: Add tests for collisions between/among macro
parameters and local symbols.
* gas/macros/badarg.l: Adjust.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/macros/badarg.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/macros/badarg.s | 17 |
3 files changed, 26 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 1f0f7a2..887cd03 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-04-25 Jan Beulich <jbeulich@novell.com> + + * gas/macros/badarg.s: Add tests for collisions between/among macro + parameters and local symbols. + * gas/macros/badarg.l: Adjust. + 2005-04-20 Jan Beulich <jbeulich@novell.com> * gas/elf/struct.s: Adjust to not get into alignment issues. diff --git a/gas/testsuite/gas/macros/badarg.l b/gas/testsuite/gas/macros/badarg.l index 80e0670..602d3ce 100644 --- a/gas/testsuite/gas/macros/badarg.l +++ b/gas/testsuite/gas/macros/badarg.l @@ -5,3 +5,6 @@ .*:10: Error: .* .*:13: Error: .* .*:16: Error: .* +.*:19: Error: .* +.*:25: Error: .* +.*:30: Error: .* diff --git a/gas/testsuite/gas/macros/badarg.s b/gas/testsuite/gas/macros/badarg.s index d6d729b..3dec7ea 100644 --- a/gas/testsuite/gas/macros/badarg.s +++ b/gas/testsuite/gas/macros/badarg.s @@ -15,3 +15,20 @@ .macro m4,,arg2 .endm + + .macro m5,arg,arg + .endm + + .altmacro + + .macro m6,arg + local arg + .endm + + .macro m7 + local arg + local arg + .endm + + m6 + m7 |