[X86][MS]Adjacent comments within multi-line inline assembly statement

Allowing adjacent comments within MS inline assembly multi-line statement

Differential Revision: https://reviews.llvm.org/D28989

llvm-svn: 294120
This commit is contained in:
Coby Tayree 2017-02-05 10:23:06 +00:00
parent 7a3eb290ef
commit c0fb36f442
2 changed files with 11 additions and 0 deletions

View File

@ -457,6 +457,11 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
break; break;
LineNo = SrcMgr.getLineNumber(ExpLoc.first, ExpLoc.second); LineNo = SrcMgr.getLineNumber(ExpLoc.first, ExpLoc.second);
SkippedStartOfLine = Tok.isAtStartOfLine(); SkippedStartOfLine = Tok.isAtStartOfLine();
} else if (Tok.is(tok::semi)) {
// A multi-line asm-statement, where next line is a comment
InAsmComment = true;
FID = ExpLoc.first;
LineNo = SrcMgr.getLineNumber(FID, ExpLoc.second);
} }
} else if (!InAsmComment && Tok.is(tok::r_brace)) { } else if (!InAsmComment && Tok.is(tok::r_brace)) {
// In MSVC mode, braces only participate in brace matching and // In MSVC mode, braces only participate in brace matching and

View File

@ -55,9 +55,15 @@ void t7() {
} }
} }
__asm {} __asm {}
__asm {
;
; label
mov eax, ebx
}
// CHECK: t7 // CHECK: t7
// CHECK: call void asm sideeffect inteldialect "int $$0x2cU", "~{dirflag},~{fpsr},~{flags}"() // CHECK: call void asm sideeffect inteldialect "int $$0x2cU", "~{dirflag},~{fpsr},~{flags}"()
// CHECK: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"() // CHECK: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"()
// CHECK: call void asm sideeffect inteldialect "mov eax, ebx", "~{eax},~{dirflag},~{fpsr},~{flags}"()
} }
int t8() { int t8() {