summaryrefslogtreecommitdiff
path: root/clang/test/Driver/lto.c
diff options
context:
space:
mode:
authorZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
committerZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
commit222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch)
tree7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/test/Driver/lto.c
parent3d206f03985b50beacae843d880bccdc91a9f424 (diff)
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/test/Driver/lto.c')
-rw-r--r--clang/test/Driver/lto.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/Driver/lto.c b/clang/test/Driver/lto.c
new file mode 100644
index 0000000..22b4788
--- /dev/null
+++ b/clang/test/Driver/lto.c
@@ -0,0 +1,23 @@
+// -emit-llvm, -flto, and -O4 all cause 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: %clang -ccc-print-phases -c %s -O4 2> %t.log
+// RUN: grep '2: compiler, {1}, lto-bc' %t.log
+
+// and -emit-llvm doesn't alter pipeline (unfortunately?).
+// RUN: %clang -ccc-print-phases %s -emit-llvm 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
+
+// llvm-bc and llvm-ll outputs need to match regular suffixes
+// (unfortunately).
+// RUN: %clang %s -emit-llvm -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 '".*a.out" .*".*lto\.o"' %t.log
+
+// RUN: %clang %s -emit-llvm -S -### 2> %t.log
+// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
+