GCC fails if there is a trailing colon but no clobbers.

llvm-svn: 44265
This commit is contained in:
Anders Carlsson 2007-11-21 23:27:34 +00:00
parent 738fa17c4e
commit 091a059c55
2 changed files with 10 additions and 7 deletions

View File

@ -957,14 +957,12 @@ Parser::StmtResult Parser::ParseAsmStatement() {
if (Tok.is(tok::colon)) {
ConsumeToken();
if (isTokenStringLiteral()) {
// Parse the asm-string list for clobbers.
while (1) {
ParseAsmStringLiteral();
// Parse the asm-string list for clobbers.
while (1) {
ParseAsmStringLiteral();
if (Tok.isNot(tok::comma)) break;
ConsumeToken();
}
if (Tok.isNot(tok::comma)) break;
ConsumeToken();
}
}

5
clang/test/Parser/asm.c Normal file
View File

@ -0,0 +1,5 @@
// RUN: clang -fsyntax-only -verify %s
void f1() {
asm ("ret" : : :); // expected-error {{expected string literal}}
}