blob: 79eaa836b5c45daa630109235baa92b8cfdd04d8 [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.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00003// 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
Daniel Dunbar337a6272009-03-24 20:17:30 +00007
8// and -emit-llvm doesn't alter pipeline (unfortunately?).
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00009// 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
Daniel Dunbar337a6272009-03-24 20:17:30 +000014
15// llvm-bc and llvm-ll outputs need to match regular suffixes
16// (unfortunately).
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000017// 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
Daniel Dunbar337a6272009-03-24 20:17:30 +000021
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000022// RUN: clang %s -emit-llvm -S -### 2> %t.log
23// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +000024
25// RUN: true