2009-03-14 01:57:10 +08:00
|
|
|
// Basic compilation for various types of files.
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// BASIC: 0: input, "{{.*}}phases.c", c
|
|
|
|
// BASIC: 1: preprocessor, {0}, cpp-output
|
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
|
|
|
// BASIC: 2: compiler, {1}, ir
|
|
|
|
// BASIC: 3: backend, {2}, assembler
|
|
|
|
// BASIC: 4: assembler, {3}, object
|
|
|
|
// BASIC: 5: input, "{{.*}}phases.c", objective-c
|
|
|
|
// BASIC: 6: preprocessor, {5}, objective-c-cpp-output
|
|
|
|
// BASIC: 7: compiler, {6}, ir
|
|
|
|
// BASIC: 8: backend, {7}, assembler
|
|
|
|
// BASIC: 9: assembler, {8}, object
|
|
|
|
// BASIC: 10: input, "{{.*}}phases.c", c++
|
|
|
|
// BASIC: 11: preprocessor, {10}, c++-cpp-output
|
|
|
|
// BASIC: 12: compiler, {11}, ir
|
|
|
|
// BASIC: 13: backend, {12}, assembler
|
|
|
|
// BASIC: 14: assembler, {13}, object
|
|
|
|
// BASIC: 15: input, "{{.*}}phases.c", assembler
|
2009-10-27 02:07:30 +08:00
|
|
|
// BASIC: 16: assembler, {15}, object
|
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
|
|
|
// BASIC: 17: input, "{{.*}}phases.c", assembler-with-cpp
|
|
|
|
// BASIC: 18: preprocessor, {17}, assembler
|
|
|
|
// BASIC: 19: assembler, {18}, object
|
|
|
|
// BASIC: 20: input, "{{.*}}phases.c", c
|
|
|
|
// BASIC: 21: preprocessor, {20}, cpp-output
|
|
|
|
// BASIC: 22: compiler, {21}, ir
|
|
|
|
// BASIC: 23: backend, {22}, assembler
|
|
|
|
// BASIC: 24: assembler, {23}, object
|
|
|
|
// BASIC: 25: linker, {4, 9, 14, 16, 19, 24}, image
|
2009-03-14 01:57:10 +08:00
|
|
|
|
2009-03-14 04:45:03 +08:00
|
|
|
// Universal linked image.
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// ULI: 0: input, "{{.*}}phases.c", c
|
|
|
|
// ULI: 1: preprocessor, {0}, cpp-output
|
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
|
|
|
// ULI: 2: compiler, {1}, ir
|
|
|
|
// ULI: 3: backend, {2}, assembler
|
|
|
|
// ULI: 4: assembler, {3}, object
|
|
|
|
// ULI: 5: linker, {4}, image
|
|
|
|
// ULI: 6: bind-arch, "ppc", {5}, image
|
|
|
|
// ULI: 7: bind-arch, "i386", {5}, image
|
|
|
|
// ULI: 8: lipo, {6, 7}, image
|
2009-03-14 04:45:03 +08:00
|
|
|
|
|
|
|
// Universal object file.
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// UOF: 0: input, "{{.*}}phases.c", c
|
|
|
|
// UOF: 1: preprocessor, {0}, cpp-output
|
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
|
|
|
// UOF: 2: compiler, {1}, ir
|
|
|
|
// UOF: 3: backend, {2}, assembler
|
|
|
|
// UOF: 4: assembler, {3}, object
|
|
|
|
// UOF: 5: bind-arch, "ppc", {4}, object
|
|
|
|
// UOF: 6: bind-arch, "i386", {4}, object
|
|
|
|
// UOF: 7: lipo, {5, 6}, object
|
2009-03-14 04:45:03 +08:00
|
|
|
|
2009-03-18 05:29:52 +08:00
|
|
|
// Arch defaulting
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// ARCH1: 2: bind-arch, "i386", {1}, object
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// ARCH2: 2: bind-arch, "x86_64", {1}, object
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// ARCH3: 2: bind-arch, "x86_64", {1}, object
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// ARCH4: 2: bind-arch, "i386", {1}, object
|
2009-03-18 05:29:52 +08:00
|
|
|
|
2009-03-18 07:26:35 +08:00
|
|
|
// Analyzer
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// ANALYZE: 0: input, "{{.*}}phases.c", c
|
|
|
|
// ANALYZE: 1: preprocessor, {0}, cpp-output
|
|
|
|
// ANALYZE: 2: analyzer, {1}, plist
|
2009-03-18 07:26:35 +08:00
|
|
|
|
|
|
|
// Precompiler
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// PCH: 0: input, "{{.*}}phases.c", c-header
|
|
|
|
// PCH: 1: preprocessor, {0}, c-header-cpp-output
|
|
|
|
// PCH: 2: precompiler, {1}, precompiled-header
|
2009-03-18 07:26:35 +08:00
|
|
|
|
2009-03-21 07:39:23 +08:00
|
|
|
// Darwin overrides the handling for .s
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: touch %t.s
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// DARWIN1: 0: input, "{{.*}}.s", assembler
|
|
|
|
// DARWIN1: 1: assembler, {0}, object
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s
|
2009-10-27 02:07:30 +08:00
|
|
|
// DARWIN2: 0: input, "{{.*}}.s", assembler-with-cpp
|
|
|
|
// DARWIN2: 1: preprocessor, {0}, assembler
|
|
|
|
// DARWIN2: 2: assembler, {1}, object
|
2009-03-21 07:39:23 +08:00
|
|
|
|