Submitted by: Bill Wendling

- Converted to use the -parse-ast-check flag.

llvm-svn: 39681
This commit is contained in:
Bill Wendling 2007-06-27 04:30:12 +00:00
parent ff1d2c81ba
commit eb2def66be
6 changed files with 20 additions and 21 deletions

View File

@ -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}}
}

View File

@ -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}} */

View File

@ -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)
{
}

View File

@ -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}} */
}

View File

@ -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}} */

View File

@ -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}}