2012-01-20 22:01:23 +00:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t
|
2009-11-08 01:45:36 +00:00
|
|
|
// RUN: echo 'END' >> %t
|
|
|
|
// RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s
|
2009-09-01 16:57:46 +00: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-20 23:35:52 +00:00
|
|
|
// EMIT-AST-PHASES: END
|
2009-09-01 16:57:46 +00:00
|
|
|
|
2009-11-08 01:45:36 +00:00
|
|
|
// RUN: touch %t.ast
|
2012-01-20 22:01:23 +00:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t
|
2009-11-08 01:45:36 +00:00
|
|
|
// RUN: echo 'END' >> %t
|
2009-09-01 16:57:46 +00: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 07:00:00 +00: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-20 23:35:52 +00:00
|
|
|
// COMPILE-AST-PHASES: END
|
2009-09-01 16:57:46 +00:00
|
|
|
|
|
|
|
// FIXME: There is a problem with compiling AST's in that the input language is
|
2011-04-15 05:22:18 +00:00
|
|
|
// not available for use by other tools (for example, to automatically add
|
2009-09-01 16:57:46 +00:00
|
|
|
// -lstdc++). We may need -x [objective-]c++-ast and all that goodness. :(
|
2022-06-27 09:27:38 +02:00
|
|
|
|
|
|
|
// Also check clang-cl since the driver is slightly different
|
|
|
|
// RUN: %clang_cl -ccc-print-phases -emit-ast -- %s 2> %t
|
|
|
|
// RUN: echo 'END' >> %t
|
|
|
|
// RUN: FileCheck -check-prefix EMIT-AST-PHASES-CLANGCL -input-file %t %s
|
|
|
|
|
|
|
|
// EMIT-AST-PHASES-CLANGCL: 0: input,
|
|
|
|
// EMIT-AST-PHASES-CLANGCL: , c
|
|
|
|
// EMIT-AST-PHASES-CLANGCL: 1: preprocessor, {0}, cpp-output
|
|
|
|
// EMIT-AST-PHASES-CLANGCL: 2: compiler, {1}, ast
|
|
|
|
// EMIT-AST-PHASES-CLANGCL-NOT: 3:
|
|
|
|
// EMIT-AST-PHASES-CLANGCL: END
|