Also add test cases that show that macros can use commas
or omit them.
---
gas-preprocessor.pl | 2 +-
test.S | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 24977a7..5498b7c 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -497,7 +497,7 @@ sub expand_macros {
my $comma_sep_required = 0;
foreach (@arglist) {
# allow arithmetic/shift operators in macro arguments
- $_ =~ s/\s*(\+|-|\*|\/|<<|>>)\s*/$1/g;
+ $_ =~ s/\s*(\+|-|\*|\/|<<|>>|<|>)\s*/$1/g;
my @whitespace_split = split(/\s+/, $_);
if (!@whitespace_split) {
diff --git a/test.S b/test.S
index f8372d5..f6ec894 100644
--- a/test.S
+++ b/test.S
@@ -48,3 +48,21 @@ m 0
.if 2 > 1
outer
.endif
+
+.macro argtest1 first, second, third
+ mov r0, #\first
+ mov r0, #\second
+ mov r0, #\third
+.endm
+.macro argtest2 first second third
+ mov r1, #\first
+ mov r1, #\second
+ mov r1, #\third
+.endm
+
+argtest1 1, 2, 3
+argtest1 1 2 3
+argtest2 1, 2, 3
+argtest2 1 2 3
+argtest1 1 2 3 + 1
+argtest2 1 2 < 1 3
--
1.8.5.2 (Apple Git-48)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel