summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-06-18 20:57:32 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-06-18 20:57:32 +0000
commit71ede29e9c9ee27aed70a5b9030ac78ec7072305 (patch)
tree8f8e79009a48268bf6c5cbb11dddfeb55b669f6a /llvm
parent763e2cb6e548b2a0af8a5810f8bebca0f8bc1e41 (diff)
downloadbcm5719-llvm-71ede29e9c9ee27aed70a5b9030ac78ec7072305.tar.gz
bcm5719-llvm-71ede29e9c9ee27aed70a5b9030ac78ec7072305.zip
MC: do not add comment string to the AsmToken in AsmLexer::LexLineComment
Fixes macros with varargs if the macro instantiation has a trailing comment. Patch by Janne Grunau! llvm-svn: 211219
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/MC/MCParser/AsmLexer.cpp4
-rw-r--r--llvm/test/MC/AsmParser/vararg.s10
2 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCParser/AsmLexer.cpp b/llvm/lib/MC/MCParser/AsmLexer.cpp
index bca516eca02..7991ef5fe09 100644
--- a/llvm/lib/MC/MCParser/AsmLexer.cpp
+++ b/llvm/lib/MC/MCParser/AsmLexer.cpp
@@ -201,8 +201,8 @@ AsmToken AsmLexer::LexLineComment() {
CurChar = getNextChar();
if (CurChar == EOF)
- return AsmToken(AsmToken::Eof, StringRef(CurPtr, 0));
- return AsmToken(AsmToken::EndOfStatement, StringRef(CurPtr, 0));
+ return AsmToken(AsmToken::Eof, StringRef(TokStart, 0));
+ return AsmToken(AsmToken::EndOfStatement, StringRef(TokStart, 0));
}
static void SkipIgnoredIntegerSuffix(const char *&CurPtr) {
diff --git a/llvm/test/MC/AsmParser/vararg.s b/llvm/test/MC/AsmParser/vararg.s
index b27668ea337..e3236b072d1 100644
--- a/llvm/test/MC/AsmParser/vararg.s
+++ b/llvm/test/MC/AsmParser/vararg.s
@@ -17,6 +17,12 @@
.endif
.endm
+.macro ifcc4 arg0, arg1:vararg
+.if cc
+ movl \arg1, \arg0
+.endif
+.endm
+
.text
// CHECK: movl %esp, %ebp
@@ -25,6 +31,8 @@
// CHECK: movl %ecx, %ebx
// CHECK: movl %ecx, %eax
// CHECK: movl %eax, %ecx
+// CHECK: movl %ecx, %eax
+// CHECK: movl %eax, %ecx
.set cc,1
ifcc movl %esp, %ebp
subl $0, %esp
@@ -33,6 +41,8 @@
ifcc2 %ecx, %ebx
ifcc3 %ecx %eax
ifcc3 %eax, %ecx
+ ifcc4 %eax %ecx ## test
+ ifcc4 %ecx, %eax ## test
// CHECK-NOT movl
// CHECK: subl $1, %esp
OpenPOWER on IntegriCloud