]> granicus.if.org Git - clang/commitdiff
[ms-inline-asm] The __asm keyword is a statement separator, so multiple asm
authorChad Rosier <mcrosier@apple.com>
Tue, 12 Jun 2012 20:30:26 +0000 (20:30 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 12 Jun 2012 20:30:26 +0000 (20:30 +0000)
statements are allowed on the same line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158372 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmt.cpp
test/Parser/ms-inline-asm.c

index dd5ccc2f5df33e3740c4e6b80b3def55c0fb1b48..af7d538adb5d18fea35d9d1eadccaea064ad7297 100644 (file)
@@ -1710,6 +1710,11 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
       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;
index 3a1efb0984d6c63a6b23e10d9d15858566b9b639..1c8c881dec362efcafdb4555101f5aea847f854a 100644 (file)
@@ -27,6 +27,12 @@ int t7() {
     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}}