[cfe-commits] r39681 - in /cfe/cfe/trunk/test/Parser: CompoundStmtScope.c argument_redef.c attributes.c bad-control.c cxx-reference.cpp recovery-1.c

bwendlin at cs.uiuc.edu bwendlin at cs.uiuc.edu
Wed Jul 11 09:47:05 PDT 2007


Author: bwendlin
Date: Wed Jul 11 11:47:05 2007
New Revision: 39681

URL: http://llvm.org/viewvc/llvm-project?rev=39681&view=rev
Log:
Submitted by: Bill Wendling

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

Modified:
    cfe/cfe/trunk/test/Parser/CompoundStmtScope.c
    cfe/cfe/trunk/test/Parser/argument_redef.c
    cfe/cfe/trunk/test/Parser/attributes.c
    cfe/cfe/trunk/test/Parser/bad-control.c
    cfe/cfe/trunk/test/Parser/cxx-reference.cpp
    cfe/cfe/trunk/test/Parser/recovery-1.c

Modified: cfe/cfe/trunk/test/Parser/CompoundStmtScope.c
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Parser/CompoundStmtScope.c?rev=39681&r1=39680&r2=39681&view=diff

==============================================================================
--- cfe/cfe/trunk/test/Parser/CompoundStmtScope.c (original)
+++ cfe/cfe/trunk/test/Parser/CompoundStmtScope.c Wed Jul 11 11:47:05 2007
@@ -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}}
 }

Modified: cfe/cfe/trunk/test/Parser/argument_redef.c
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Parser/argument_redef.c?rev=39681&r1=39680&r2=39681&view=diff

==============================================================================
--- cfe/cfe/trunk/test/Parser/argument_redef.c (original)
+++ cfe/cfe/trunk/test/Parser/argument_redef.c Wed Jul 11 11:47:05 2007
@@ -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}} */

Modified: cfe/cfe/trunk/test/Parser/attributes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Parser/attributes.c?rev=39681&r1=39680&r2=39681&view=diff

==============================================================================
--- cfe/cfe/trunk/test/Parser/attributes.c (original)
+++ cfe/cfe/trunk/test/Parser/attributes.c Wed Jul 11 11:47:05 2007
@@ -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)
 {
 }

Modified: cfe/cfe/trunk/test/Parser/bad-control.c
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Parser/bad-control.c?rev=39681&r1=39680&r2=39681&view=diff

==============================================================================
--- cfe/cfe/trunk/test/Parser/bad-control.c (original)
+++ cfe/cfe/trunk/test/Parser/bad-control.c Wed Jul 11 11:47:05 2007
@@ -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}} */
 }

Modified: cfe/cfe/trunk/test/Parser/cxx-reference.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Parser/cxx-reference.cpp?rev=39681&r1=39680&r2=39681&view=diff

==============================================================================
--- cfe/cfe/trunk/test/Parser/cxx-reference.cpp (original)
+++ cfe/cfe/trunk/test/Parser/cxx-reference.cpp Wed Jul 11 11:47:05 2007
@@ -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 @@
 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}} */

Modified: cfe/cfe/trunk/test/Parser/recovery-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Parser/recovery-1.c?rev=39681&r1=39680&r2=39681&view=diff

==============================================================================
--- cfe/cfe/trunk/test/Parser/recovery-1.c (original)
+++ cfe/cfe/trunk/test/Parser/recovery-1.c Wed Jul 11 11:47:05 2007
@@ -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}}





More information about the cfe-commits mailing list