40 lines · c
1// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t2// RUN: echo 'END' >> %t3// RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s4 5// EMIT-AST-PHASES: 0: input,6// EMIT-AST-PHASES: , c7// EMIT-AST-PHASES: 1: preprocessor, {0}, cpp-output8// EMIT-AST-PHASES: 2: compiler, {1}, ast9// EMIT-AST-PHASES-NOT: 3:10// EMIT-AST-PHASES: END11 12// RUN: touch %t.ast13// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t14// RUN: echo 'END' >> %t15// RUN: FileCheck -check-prefix COMPILE-AST-PHASES -input-file %t %s16 17// COMPILE-AST-PHASES: 0: input,18// COMPILE-AST-PHASES: , ast19// COMPILE-AST-PHASES: 1: compiler, {0}, ir20// COMPILE-AST-PHASES: 2: backend, {1}, assembler21// COMPILE-AST-PHASES: 3: assembler, {2}, object22// COMPILE-AST-PHASES-NOT: 4:23// COMPILE-AST-PHASES: END24 25// FIXME: There is a problem with compiling AST's in that the input language is26// not available for use by other tools (for example, to automatically add27// -lstdc++). We may need -x [objective-]c++-ast and all that goodness. :(28 29// Also check clang-cl since the driver is slightly different30// RUN: %clang_cl -ccc-print-phases -emit-ast -- %s 2> %t31// RUN: echo 'END' >> %t32// RUN: FileCheck -check-prefix EMIT-AST-PHASES-CLANGCL -input-file %t %s33 34// EMIT-AST-PHASES-CLANGCL: 0: input,35// EMIT-AST-PHASES-CLANGCL: , c36// EMIT-AST-PHASES-CLANGCL: 1: preprocessor, {0}, cpp-output37// EMIT-AST-PHASES-CLANGCL: 2: compiler, {1}, ast38// EMIT-AST-PHASES-CLANGCL-NOT: 3:39// EMIT-AST-PHASES-CLANGCL: END40