Module: gas-preprocessor
Branch: master
Commit: 72887b9b99669f9c3ef416667415af8009d4d38f

Author:    Janne Grunau <[email protected]>
Committer: Janne Grunau <[email protected]>
Date:      Tue Aug 12 17:53:23 2014 +0200

allow a comma between macro name and first macro parameter

Both gas and llvm's integrated assembler accept it.

---

 gas-preprocessor.pl |    2 +-
 test.S              |    9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index 3020401..fbf0853 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -402,7 +402,7 @@ sub parse_line {
     } elsif ($macro_level == 0) {
         expand_macros($line);
     } else {
-        if ($line =~ /\.macro\s+([\d\w\.]+)\s*(.*)/) {
+        if ($line =~ /\.macro\s+([\d\w\.]+)\s*,?\s*(.*)/) {
             $current_macro = $1;
 
             # commas in the argument list are optional, so only use whitespace 
as the separator
diff --git a/test.S b/test.S
index 47d39c2..acf59e9 100644
--- a/test.S
+++ b/test.S
@@ -59,6 +59,12 @@ m 0
     mov r1, #\second
     mov r1, #\third
 .endm
+# test for comma between macro name and first parameter
+.macro argtest3, first, second, third
+    mov r0, #\first
+    mov r0, #\second
+    mov r0, #\third
+.endm
 
 argtest1 1, 2, 3
 argtest1 1 2 3
@@ -66,6 +72,9 @@ argtest2 1, 2, 3
 argtest2 1 2 3
 argtest1 1 2 3 + 1
 argtest2 1 2 < 1 3
+argtest3 1, 2, 3
+argtest3 1 2 3
+argtest3 1 2 6 / 2
 
 .irpc i, 0123
     .irpc j, 0123

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to