summaryrefslogtreecommitdiff
path: root/clang/test/Driver/lto.c
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
committerCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
commitbe1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch)
tree1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/Driver/lto.c
parentc4626a62754862d20b41e8a46a3574264ea80e6d (diff)
parentf1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff)
Merge branch 'master' of ssh://bitbucket.org/czan/honours
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
+