summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/lto.c
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-12-21 07:00:00 +0000
committerBob Wilson <bob.wilson@apple.com>2014-12-21 07:00:00 +0000
commit23a55f1eeeb15ef6b8002e98e90cd025d53c97f2 (patch)
tree34f5c8b767fd4d89c2ec05f808c340cce7e7bb25 /clang/test/Driver/lto.c
parent01dcd8a31dc03ff556fa9a0a602968c47eca99e6 (diff)
downloadbcm5719-llvm-23a55f1eeeb15ef6b8002e98e90cd025d53c97f2.tar.gz
bcm5719-llvm-23a55f1eeeb15ef6b8002e98e90cd025d53c97f2.zip
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
Diffstat (limited to 'clang/test/Driver/lto.c')
-rw-r--r--clang/test/Driver/lto.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/test/Driver/lto.c b/clang/test/Driver/lto.c
index 91524bf78b1..ec6b3f1162d 100644
--- a/clang/test/Driver/lto.c
+++ b/clang/test/Driver/lto.c
@@ -1,18 +1,21 @@
// -flto causes a switch to llvm-bc object files.
// RUN: %clang -ccc-print-phases -c %s -flto 2> %t.log
-// RUN: grep '2: compiler, {1}, lto-bc' %t.log
+// RUN: grep '2: compiler, {1}, ir' %t.log
+// RUN: grep '3: backend, {2}, lto-bc' %t.log
// RUN: %clang -ccc-print-phases %s -flto 2> %t.log
// RUN: grep '0: input, ".*lto.c", c' %t.log
// RUN: grep '1: preprocessor, {0}, cpp-output' %t.log
-// RUN: grep '2: compiler, {1}, lto-bc' %t.log
-// RUN: grep '3: linker, {2}, image' %t.log
+// RUN: grep '2: compiler, {1}, ir' %t.log
+// RUN: grep '3: backend, {2}, lto-bc' %t.log
+// RUN: grep '4: linker, {3}, image' %t.log
// llvm-bc and llvm-ll outputs need to match regular suffixes
// (unfortunately).
// RUN: %clang %s -flto -save-temps -### 2> %t.log
// RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log
-// RUN: grep '"-o" ".*lto\.o" .*".*lto\.i"' %t.log
+// RUN: grep '"-o" ".*lto\.bc" .*".*lto\.i"' %t.log
+// RUN: grep '"-o" ".*lto\.o" .*".*lto\.bc"' %t.log
// RUN: grep '".*a.out" .*".*lto\.o"' %t.log
// RUN: %clang %s -flto -S -### 2> %t.log
OpenPOWER on IntegriCloud