<div dir="ltr">On Wed, Jun 11, 2014 at 6:15 PM, Saleem Abdulrasool <span dir="ltr"><<a href="mailto:compnerd@compnerd.org" target="_blank">compnerd@compnerd.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="">On Wed, Jun 11, 2014 at 12:25 PM, Janne Grunau <span dir="ltr"><<a href="mailto:j@jannau.net" target="_blank">j@jannau.net</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Fixes macros with varargs if the macro instantiation has a trailing comment.<br></div></blockquote><div><br></div></div><div>LGTM</div></div></div></div></blockquote><div><br></div><div>Committed as SVN r211219.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span style="color:rgb(80,0,80)"> </span></div>
<div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
---<br>
</div>adds a macro to test out of order arguments with varargs and trailing<br>
trailing comment<br>
<br>
I missed the comma between the macro arguments in ifcc2 and ifcc3 so it<br>
looked as if they testing exactly the same<br>
<br>
<br>
 lib/MC/MCParser/AsmLexer.cpp |  4 ++--<br>
 test/MC/AsmParser/vararg.s   | 10 ++++++++++<br>
 2 files changed, 12 insertions(+), 2 deletions(-)<br>
<div><br>
diff --git a/lib/MC/MCParser/AsmLexer.cpp b/lib/MC/MCParser/AsmLexer.cpp<br>
index bca516e..7991ef5 100644<br>
--- a/lib/MC/MCParser/AsmLexer.cpp<br>
+++ b/lib/MC/MCParser/AsmLexer.cpp<br>
@@ -201,8 +201,8 @@ AsmToken AsmLexer::LexLineComment() {<br>
     CurChar = getNextChar();<br>
<br>
   if (CurChar == EOF)<br>
-    return AsmToken(AsmToken::Eof, StringRef(CurPtr, 0));<br>
-  return AsmToken(AsmToken::EndOfStatement, StringRef(CurPtr, 0));<br>
+    return AsmToken(AsmToken::Eof, StringRef(TokStart, 0));<br>
+  return AsmToken(AsmToken::EndOfStatement, StringRef(TokStart, 0));<br>
 }<br>
<br>
 static void SkipIgnoredIntegerSuffix(const char *&CurPtr) {<br>
diff --git a/test/MC/AsmParser/vararg.s b/test/MC/AsmParser/vararg.s<br>
</div>index b27668e..e3236b0 100644<br>
--- a/test/MC/AsmParser/vararg.s<br>
+++ b/test/MC/AsmParser/vararg.s<br>
@@ -17,6 +17,12 @@<br>
 .endif<br>
 .endm<br>
<br>
+.macro ifcc4 arg0, arg1:vararg<br>
+.if cc<br>
+            movl \arg1, \arg0<br>
+.endif<br>
+.endm<br>
+<br>
 .text<br>
<br>
 // CHECK: movl %esp, %ebp<br>
@@ -25,6 +31,8 @@<br>
 // CHECK: movl %ecx, %ebx<br>
 // CHECK: movl %ecx, %eax<br>
 // CHECK: movl %eax, %ecx<br>
+// CHECK: movl %ecx, %eax<br>
+// CHECK: movl %eax, %ecx<br>
 .set cc,1<br>
   ifcc  movl    %esp, %ebp<br>
         subl $0, %esp<br>
@@ -33,6 +41,8 @@<br>
   ifcc2 %ecx, %ebx<br>
   ifcc3 %ecx %eax<br>
   ifcc3 %eax, %ecx<br>
+  ifcc4 %eax %ecx  ## test<br>
+  ifcc4 %ecx, %eax ## test<br>
<div><div><br>
 // CHECK-NOT movl<br>
 // CHECK: subl $1, %esp<br>
</div></div><span><font color="#888888">--<br>
2.0.0<br>
<br>
</font></span></blockquote></div></div></div><br><br clear="all"><div class=""><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>