summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/CompoundStmtScope.c4
-rw-r--r--clang/test/Parser/argument_redef.c5
-rw-r--r--clang/test/Parser/attributes.c4
-rw-r--r--clang/test/Parser/bad-control.c6
-rw-r--r--clang/test/Parser/cxx-reference.cpp13
-rw-r--r--clang/test/Parser/recovery-1.c9
6 files changed, 20 insertions, 21 deletions
diff --git a/clang/test/Parser/CompoundStmtScope.c b/clang/test/Parser/CompoundStmtScope.c
index 1e1aa79f0b3..d6a4730632c 100644
--- a/clang/test/Parser/CompoundStmtScope.c
+++ b/clang/test/Parser/CompoundStmtScope.c
@@ -1,8 +1,8 @@
-// RUN: not clang %s -fsyntax-only
+// RUN: clang -parse-ast-check %s
int foo() {
{
typedef float X;
}
- X Y;
+ X Y; // expected-error {{use of undeclared identifier}}
}
diff --git a/clang/test/Parser/argument_redef.c b/clang/test/Parser/argument_redef.c
index 6ca88d5ff36..c899ade447f 100644
--- a/clang/test/Parser/argument_redef.c
+++ b/clang/test/Parser/argument_redef.c
@@ -1,4 +1,5 @@
-/* RUN: not clang %s -fsyntax-only
+/* RUN: clang -parse-ast-check %s
*/
-int foo(int A) { int A; }
+int foo(int A) { int A; } /* expected-error {{redefinition of 'A'}} \
+ expected-error {{previous definition is here}} */
diff --git a/clang/test/Parser/attributes.c b/clang/test/Parser/attributes.c
index f619111208c..29e8c81f3b1 100644
--- a/clang/test/Parser/attributes.c
+++ b/clang/test/Parser/attributes.c
@@ -1,6 +1,6 @@
-// RUN: clang -fsyntax-only %s
+// RUN: clang -parse-ast-check %s
-static __inline void __attribute__((__always_inline__, __nodebug__))
+static __inline void __attribute__((__always_inline__, __nodebug__)) // expected-warning {{extension used}}
foo (void)
{
}
diff --git a/clang/test/Parser/bad-control.c b/clang/test/Parser/bad-control.c
index 60705e017f7..914393461a9 100644
--- a/clang/test/Parser/bad-control.c
+++ b/clang/test/Parser/bad-control.c
@@ -1,9 +1,9 @@
-/* RUN: clang -fsyntax-only %s 2>&1 | grep error: | wc -l | grep 2
+/* RUN: clang -parse-ast-check %s
*/
int foo() {
-break;
+ break; /* expected-error {{'break' statement not in loop or switch statement}} */
}
int foo2() {
-continue;
+ continue; /* expected-error {{'continue' statement not in loop statement}} */
}
diff --git a/clang/test/Parser/cxx-reference.cpp b/clang/test/Parser/cxx-reference.cpp
index b84b4eebe5a..aed0488ebf7 100644
--- a/clang/test/Parser/cxx-reference.cpp
+++ b/clang/test/Parser/cxx-reference.cpp
@@ -1,6 +1,5 @@
-// RUN: not clang -fsyntax-only %s &&
-// RUN: clang -fsyntax-only %s 2>&1 | grep "error: 'const' qualifier may not be applied to a reference" &&
-// RUN: clang -fsyntax-only %s 2>&1 | grep "error: 'volatile' qualifier may not be applied to a reference"
+// RUN: clang -parse-ast-check %s &&
+// XFAIL: *
extern char *bork;
char *& bar = bork;
@@ -13,7 +12,7 @@ typedef int & A;
void g(const A aref) {
}
-int & const X;
-int & volatile Y;
-int & const volatile Z;
-
+int & const X; // expected-error {{'const' qualifier may not be applied to a reference}}
+int & volatile Y; // expected-error {{'volatile' qualifier may not be applied to a reference}}
+int & const volatile Z; /* expected-error {{'const' qualifier may not be applied}} \
+ expected-error {{'volatile' qualifier may not be applied}} */
diff --git a/clang/test/Parser/recovery-1.c b/clang/test/Parser/recovery-1.c
index ed6c43c8e5f..a34651d3c7a 100644
--- a/clang/test/Parser/recovery-1.c
+++ b/clang/test/Parser/recovery-1.c
@@ -1,7 +1,6 @@
-// RUN: clang -fsyntax-only -fno-caret-diagnostics %s 2>&1 | grep error | wc -l | grep 2 &&
-// RUN: clang -fsyntax-only -fno-caret-diagnostics -pedantic %s 2>&1 | grep warning | wc -l | grep 1
+// RUN: clang -parse-ast-check %s
-char ((((*X x ] )))); // two errors (start pos and end pos).
-
-; // pedantic warning.
+char ((((*X x ] )))); /* expected-error {{expected ')'}} \
+ expected-error {{to match this '('}} */
+; // expected-warning {{ISO C does not allow an extra ';' outside of a function}}
OpenPOWER on IntegriCloud