aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/Parser.cpp3
-rw-r--r--test/Parser/asm.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 936604e870..2296f57afc 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -328,6 +328,7 @@ Parser::DeclTy *Parser::ParseExternalDeclaration() {
if (!Result.isInvalid)
return Actions.ActOnFileScopeAsmDecl(Tok.getLocation(), Result.Val);
+ return 0;
}
case tok::at:
// @ is not a legal token unless objc is enabled, no need to check.
@@ -653,7 +654,7 @@ Parser::ExprResult Parser::ParseSimpleAsm() {
if (Tok.isNot(tok::l_paren)) {
Diag(Tok, diag::err_expected_lparen_after, "asm");
- return 0;
+ return true;
}
ConsumeParen();
diff --git a/test/Parser/asm.c b/test/Parser/asm.c
index 6a19acaaed..c23d31a724 100644
--- a/test/Parser/asm.c
+++ b/test/Parser/asm.c
@@ -8,3 +8,8 @@ void f2() {
asm("foo" : "=r" (a)); // expected-error {{use of undeclared identifier 'a'}}
asm("foo" : : "r" (b)); // expected-error {{use of undeclared identifier 'b'}}
}
+
+
+// rdar://5952468
+__asm ; // expected-error {{expected '(' after 'asm'}}
+