[cfe-commits] r158372 - in /cfe/trunk: lib/Parse/ParseStmt.cpp test/Parser/ms-inline-asm.c
Chad Rosier
mcrosier at apple.com
Tue Jun 12 13:30:26 PDT 2012
Author: mcrosier
Date: Tue Jun 12 15:30:26 2012
New Revision: 158372
URL: http://llvm.org/viewvc/llvm-project?rev=158372&view=rev
Log:
[ms-inline-asm] The __asm keyword is a statement separator, so multiple asm
statements are allowed on the same line.
Modified:
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/test/Parser/ms-inline-asm.c
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=158372&r1=158371&r2=158372&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Jun 12 15:30:26 2012
@@ -1710,6 +1710,11 @@
if (Tok.is(tok::eof))
break;
+ // The asm keyword is a statement separator, so multiple asm statements
+ // are allowed.
+ if (!InAsmComment && Tok.is(tok::kw_asm))
+ break;
+
if (!InAsmComment && Tok.is(tok::semi)) {
// A semicolon in an asm is the start of a comment.
InAsmComment = true;
Modified: cfe/trunk/test/Parser/ms-inline-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/ms-inline-asm.c?rev=158372&r1=158371&r2=158372&view=diff
==============================================================================
--- cfe/trunk/test/Parser/ms-inline-asm.c (original)
+++ cfe/trunk/test/Parser/ms-inline-asm.c Tue Jun 12 15:30:26 2012
@@ -27,6 +27,12 @@
pop ebx
}
}
+void t8() {
+ __asm nop __asm nop __asm nop
+}
+void t9() {
+ __asm nop __asm nop ; __asm nop
+}
int t_fail() { // expected-note {{to match this}}
__asm
__asm { // expected-error 3 {{expected}} expected-note {{to match this}}
More information about the cfe-commits
mailing list