forked from OSchip/llvm-project
Fix PR7673 by allowing an empty clobbers section in an ASM statement.
llvm-svn: 109087
This commit is contained in:
parent
96f2e9e418
commit
3c31aa3a44
|
@ -1367,17 +1367,19 @@ Parser::OwningStmtResult Parser::ParseAsmStatement(bool &msAsm) {
|
|||
if (!AteExtraColon)
|
||||
ConsumeToken();
|
||||
|
||||
// Parse the asm-string list for clobbers.
|
||||
while (1) {
|
||||
OwningExprResult Clobber(ParseAsmStringLiteral());
|
||||
// Parse the asm-string list for clobbers if present.
|
||||
if (Tok.isNot(tok::r_paren)) {
|
||||
while (1) {
|
||||
OwningExprResult Clobber(ParseAsmStringLiteral());
|
||||
|
||||
if (Clobber.isInvalid())
|
||||
break;
|
||||
if (Clobber.isInvalid())
|
||||
break;
|
||||
|
||||
Clobbers.push_back(Clobber.release());
|
||||
Clobbers.push_back(Clobber.release());
|
||||
|
||||
if (Tok.isNot(tok::comma)) break;
|
||||
ConsumeToken();
|
||||
if (Tok.isNot(tok::comma)) break;
|
||||
ConsumeToken();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
void f1() {
|
||||
asm ("ret" : : :); // expected-error {{expected string literal}}
|
||||
// PR7673: Some versions of GCC support an empty clobbers section.
|
||||
asm ("ret" : : :);
|
||||
}
|
||||
|
||||
void f2() {
|
||||
|
|
Loading…
Reference in New Issue