minix/external/bsd/llvm/dist/clang/test/Driver/ast.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

26 lines
1,018 B
C

// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t
// RUN: echo 'END' >> %t
// RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s
// EMIT-AST-PHASES: 0: input,
// EMIT-AST-PHASES: , c
// EMIT-AST-PHASES: 1: preprocessor, {0}, cpp-output
// EMIT-AST-PHASES: 2: compiler, {1}, ast
// EMIT-AST-PHASES-NOT: 3:
// EMIT-AST-PHASES: END
// RUN: touch %t.ast
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t
// RUN: echo 'END' >> %t
// RUN: FileCheck -check-prefix COMPILE-AST-PHASES -input-file %t %s
// COMPILE-AST-PHASES: 0: input,
// COMPILE-AST-PHASES: , ast
// COMPILE-AST-PHASES: 1: compiler, {0}, assembler
// COMPILE-AST-PHASES: 2: assembler, {1}, object
// COMPILE-AST-PHASES-NOT: 3:
// COMPILE-AST-PHASES: END
// FIXME: There is a problem with compiling AST's in that the input language is
// not available for use by other tools (for example, to automatically add
// -lstdc++). We may need -x [objective-]c++-ast and all that goodness. :(