2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: echo 'END' >> %t
|
|
|
|
// RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s
|
2009-09-02 00:57:46 +08:00
|
|
|
|
|
|
|
// 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:
|
2009-09-21 07:35:52 +08:00
|
|
|
// EMIT-AST-PHASES: END
|
2009-09-02 00:57:46 +08:00
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: touch %t.ast
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: echo 'END' >> %t
|
2009-09-02 00:57:46 +08:00
|
|
|
// RUN: FileCheck -check-prefix COMPILE-AST-PHASES -input-file %t %s
|
|
|
|
|
|
|
|
// COMPILE-AST-PHASES: 0: input,
|
|
|
|
// COMPILE-AST-PHASES: , ast
|
Reapply "Change -save-temps to emit unoptimized bitcode files."
This reapplies r224503 along with a fix for compiling Fortran by having the
clang driver invoke gcc (see r224546, where it was reverted). I have added
a testcase for that as well.
Original commit message:
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.
This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.
Based in part on a patch by Steven Wu.
rdar://problem/18909437
llvm-svn: 224688
2014-12-21 15:00:00 +08:00
|
|
|
// COMPILE-AST-PHASES: 1: compiler, {0}, ir
|
|
|
|
// COMPILE-AST-PHASES: 2: backend, {1}, assembler
|
|
|
|
// COMPILE-AST-PHASES: 3: assembler, {2}, object
|
|
|
|
// COMPILE-AST-PHASES-NOT: 4:
|
2009-09-21 07:35:52 +08:00
|
|
|
// COMPILE-AST-PHASES: END
|
2009-09-02 00:57:46 +08:00
|
|
|
|
|
|
|
// FIXME: There is a problem with compiling AST's in that the input language is
|
2011-04-15 13:22:18 +08:00
|
|
|
// not available for use by other tools (for example, to automatically add
|
2009-09-02 00:57:46 +08:00
|
|
|
// -lstdc++). We may need -x [objective-]c++-ast and all that goodness. :(
|