aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Parse/ParseStmt.cpp12
-rw-r--r--test/Parser/asm.c5
2 files changed, 10 insertions, 7 deletions
diff --git a/Parse/ParseStmt.cpp b/Parse/ParseStmt.cpp
index 8d5be6868c..6f871da118 100644
--- a/Parse/ParseStmt.cpp
+++ b/Parse/ParseStmt.cpp
@@ -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();
}
}
diff --git a/test/Parser/asm.c b/test/Parser/asm.c
new file mode 100644
index 0000000000..a09b545a8e
--- /dev/null
+++ b/test/Parser/asm.c
@@ -0,0 +1,5 @@
+// RUN: clang -fsyntax-only -verify %s
+
+void f1() {
+ asm ("ret" : : :); // expected-error {{expected string literal}}
+}