enum ProgActions {
EmitLLVM, // Emit a .ll file.
- ParseASTPrint, // Parse ASTs and print them.
- ParseASTDump, // Parse ASTs and dump them.
- ParseASTView, // Parse ASTs and view them in Graphviz.
- BuildAST, // Parse ASTs.
+ ASTPrint, // Parse ASTs and print them.
+ ASTDump, // Parse ASTs and dump them.
+ ASTView, // Parse ASTs and view them in Graphviz.
ParseCFGDump, // Parse ASTS. Build CFGs. Print CFGs.
ParseCFGView, // Parse ASTS. Build CFGs. View CFGs.
AnalysisLiveVariables, // Print results of live-variable analysis.
"Run parser and perform semantic analysis"),
clEnumValN(ParsePrintCallbacks, "parse-print-callbacks",
"Run parser and print each callback invoked"),
- clEnumValN(BuildAST, "parse-ast",
- "Run parser and build ASTs"),
- clEnumValN(ParseASTPrint, "parse-ast-print",
- "Run parser, build ASTs, then print ASTs"),
- clEnumValN(ParseASTDump, "parse-ast-dump",
- "Run parser, build ASTs, then dump them"),
- clEnumValN(ParseASTView, "parse-ast-view",
- "Run parser, build ASTs, and view them with GraphViz."),
+ clEnumValN(ASTPrint, "ast-print",
+ "Build ASTs and then pretty-print them"),
+ clEnumValN(ASTDump, "ast-dump",
+ "Build ASTs and then debug dump them"),
+ clEnumValN(ASTView, "parse-ast-view",
+ "Build ASTs and view them with GraphViz."),
clEnumValN(ParseCFGDump, "dump-cfg",
"Run parser, then build and print CFGs."),
clEnumValN(ParseCFGView, "view-cfg",
break;
case ParseSyntaxOnly: // -fsyntax-only
- case BuildAST:
Consumer = new ASTConsumer();
break;
- case ParseASTPrint:
+ case ASTPrint:
Consumer = CreateASTPrinter();
break;
- case ParseASTDump:
+ case ASTDump:
Consumer = CreateASTDumper();
break;
- case ParseASTView:
+ case ASTView:
Consumer = CreateASTViewer();
break;
RUN: clang -E %s | grep foo &&
RUN: clang -E %s | not grep abc &&
RUN: clang -E %s | not grep xyz &&
- RUN: clang -parse-ast -verify %s
+ RUN: clang -fsyntax-only -verify %s
*/
// This is a simple comment, /*/ does not end a comment, the trailing */ does.
-/* RUN: clang -parse-ast -verify %s
+/* RUN: clang -fsyntax-only -verify %s
*/
int x = 000000080; /* expected-error {{invalid digit}} */
-// RUN: clang -parse-ast -verify -std=c++0x %s 2>&1
+// RUN: clang -fsyntax-only -verify -std=c++0x %s 2>&1
int static_assert; /* expected-error {{expected identifier or '('}}} */
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int foo() {
{
-/* RUN: clang -parse-ast -verify %s
+/* RUN: clang -fsyntax-only -verify %s
*/
int foo(int A) { /* expected-error {{previous definition is here}} */
-// RUN: clang -parse-ast -verify %s -pedantic
+// RUN: clang -fsyntax-only -verify %s -pedantic
static __inline void __attribute__((__always_inline__, __nodebug__)) // expected-warning {{extension used}}
foo (void)
-/* RUN: clang -parse-ast -verify %s
+/* RUN: clang -fsyntax-only -verify %s
*/
int foo() {
break; /* expected-error {{'break' statement not in loop or switch statement}} */
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
struct foo { int a; };
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
extern int funcInt(int);
extern float funcFloat(float);
-// RUN: clang -parse-ast-print %s
+// RUN: clang -ast-print %s
#include <stddef.h>
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
struct foo {
int a;
};
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int main() {
char *s;
s = (char []){"whatever"};
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
extern char *bork;
char *& bar = bork;
-/* RUN: clang %s -parse-ast-print
+/* RUN: clang %s -ast-print
*/
void foo() {
-/* RUN: clang -parse-ast -verify %s
+/* RUN: clang -fsyntax-only -verify %s
*/
void foo() {
-// RUN: clang -parse-ast -verify --std=c90 %s
+// RUN: clang -fsyntax-only -verify --std=c90 %s
int f (int z)
{
-// RUN: clang -parse-ast -verify --std=c99 %s
+// RUN: clang -fsyntax-only -verify --std=c99 %s
int f (int z)
{
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
_Complex double X;
void test1(int c) {
X = 5;
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
typedef __attribute__(( ocu_vector_type(2) )) float float2;
typedef __attribute__(( ocu_vector_type(3) )) float float3;
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
void f (int p[]) { p++; }
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int *test1(int *a) { return a + 1; }
int *test2(int *a) { return 1 + a; }
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int test() {
void *vp;
// RUN: clang -fsyntax-only -fno-caret-diagnostics -pedantic %s 2>&1 | grep warning | wc -l | grep 1
-// RUN: clang -parse-ast -verify -pedantic %s
+// RUN: clang -fsyntax-only -verify -pedantic %s
char (((( /* expected-error {{to match this '('}} */
*X x ] )))); /* expected-error {{expected ')'}} */
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
typedef int TInt;
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
typedef int x;
int f3(y, x,
-// RUN: clang %s -parse-ast -verify
+// RUN: clang %s -fsyntax-only -verify
void bar (void *);
void f11 (z) // expected-error {{may not have 'void' type}}
-// RUN: clang -parse-ast -verify -pedantic %s
+// RUN: clang -fsyntax-only -verify -pedantic %s
struct s;
struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}}
-// RUN: clang -parse-ast -verify -pedantic %s
+// RUN: clang -fsyntax-only -verify -pedantic %s
extern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}}
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
void *test1(void) { return 0; }
-/* RUN: clang %s -std=c89 -pedantic -parse-ast -verify
+/* RUN: clang %s -std=c89 -pedantic -fsyntax-only -verify
*/
void test1() {
{
#define CFSTR __builtin___CFStringMakeConstantString
-// RUN: clang %s -parse-ast -verify
+// RUN: clang %s -fsyntax-only -verify
void f() {
CFSTR("\242"); // expected-warning { CFString literal contains non-ASCII character }
CFSTR("\0"); // expected-warning { CFString literal contains NUL character }
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int test(char *C) { // nothing here should warn.
return C != ((void*)0);
-// RUN: clang %s -parse-ast -verify
+// RUN: clang %s -fsyntax-only -verify
typedef union <anonymous> __mbstate_t; // expected-error: {{expected identifier or}}
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
void f5 (int z) {
if (z)
-// RUN: clang %s -parse-ast -verify -pedantic
+// RUN: clang %s -fsyntax-only -verify -pedantic
enum e {A,
B = 42LL << 32, // expected-warning {{ISO C restricts enumerator values to range of 'int'}}
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int foo(float x, float y) {
return x == y; // expected-warning {{comparing floating point with ==}}
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
// Check C99 6.8.5p3
void b1 (void) { for (void (*f) (void);;); }
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
#include <stdio.h>
#include <stdarg.h>
-// RUN: clang %s -parse-ast -verify
+// RUN: clang %s -fsyntax-only -verify
id obj; // expected-error{{expected '=', ',', ';', 'asm', or '__attribute__' after declarator}}
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
void f1(int a) {
if (a); // expected-warning {{if statement has empty body}}
-/* RUN: clang -parse-ast %s -std=c89 &&
- * RUN: not clang -parse-ast %s -std=c99 -pedantic-errors
+/* RUN: clang -fsyntax-only %s -std=c89 &&
+ * RUN: not clang -fsyntax-only %s -std=c99 -pedantic-errors
*/
int A() {
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int* ret_local() {
-// RUN: clang %s -parse-ast
+// RUN: clang %s -fsyntax-only
#import <Foundation/NSObject.h>
struct D {
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
void f (int z) {
switch(z) {
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
void f (int z) {
while (z) {
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
-// RUN: clang -parse-ast -verify %s
+// RUN: clang -fsyntax-only -verify %s
int foo(int X, int Y);
-/* RUN: clang -parse-ast %s 2>&1 | grep '6 diagnostics'
+/* RUN: clang -fsyntax-only %s 2>&1 | grep '6 diagnostics'
*/
typedef void Void;