blob: 01ef2ebc2e03f0bf7523939befdb75d3666f1e80 [file] [log] [blame]
Daniel Dunbar337a6272009-03-24 20:17:30 +00001// -emit-llvm, -flto, and -O4 all cause a switch to llvm-bc object
2// files.
3// RUN: clang -ccc-print-phases -c %s -flto 2> %t.log &&
4// RUN: grep '2: compiler, {1}, llvm-bc' %t.log &&
5// RUN: clang -ccc-print-phases -c %s -O4 2> %t.log &&
6// RUN: grep '2: compiler, {1}, llvm-bc' %t.log &&
7
8// and -emit-llvm doesn't alter pipeline (unfortunately?).
9// RUN: clang -ccc-print-phases %s -emit-llvm 2> %t.log &&
10// RUN: grep '0: input, ".*lto.c", c' %t.log &&
11// RUN: grep '1: preprocessor, {0}, cpp-output' %t.log &&
12// RUN: grep '2: compiler, {1}, llvm-bc' %t.log &&
13// RUN: grep '3: linker, {2}, image' %t.log &&
14
15// llvm-bc and llvm-ll outputs need to match regular suffixes
16// (unfortunately).
17// RUN: clang %s -emit-llvm -save-temps -### 2> %t.log &&
18// RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log &&
19// RUN: grep '"-o" ".*lto\.o" .*".*lto\.i"' %t.log &&
20// RUN: grep '".*a.out" .*".*lto\.o"' %t.log &&
21
22// RUN: clang %s -emit-llvm -S -### 2> %t.log &&
23// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log &&
24
25// RUN: true