[cfe-commits] r44265 - in /cfe/trunk: Parse/ParseStmt.cpp test/Parser/asm.c
Anders Carlsson
andersca at mac.com
Wed Nov 21 15:27:34 PST 2007
Author: andersca
Date: Wed Nov 21 17:27:34 2007
New Revision: 44265
URL: http://llvm.org/viewvc/llvm-project?rev=44265&view=rev
Log:
GCC fails if there is a trailing colon but no clobbers.
Added:
cfe/trunk/test/Parser/asm.c
Modified:
cfe/trunk/Parse/ParseStmt.cpp
Modified: cfe/trunk/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseStmt.cpp?rev=44265&r1=44264&r2=44265&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/Parse/ParseStmt.cpp Wed Nov 21 17:27:34 2007
@@ -957,14 +957,12 @@
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();
}
}
Added: cfe/trunk/test/Parser/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/asm.c?rev=44265&view=auto
==============================================================================
--- cfe/trunk/test/Parser/asm.c (added)
+++ cfe/trunk/test/Parser/asm.c Wed Nov 21 17:27:34 2007
@@ -0,0 +1,5 @@
+// RUN: clang -fsyntax-only -verify %s
+
+void f1() {
+ asm ("ret" : : :); // expected-error {{expected string literal}}
+}
More information about the cfe-commits
mailing list