blob: 22b47882691d535f52e618283673cbdf8e2fbf2b [file] [log] [blame]
Daniel Dunbar6c6424b2010-06-07 23:28:45 +00001// -emit-llvm, -flto, and -O4 all cause a switch to llvm-bc object files.
Daniel Dunbar80737ad2009-12-15 22:01:24 +00002// RUN: %clang -ccc-print-phases -c %s -flto 2> %t.log
Daniel Dunbar6c6424b2010-06-07 23:28:45 +00003// RUN: grep '2: compiler, {1}, lto-bc' %t.log
Daniel Dunbar80737ad2009-12-15 22:01:24 +00004// RUN: %clang -ccc-print-phases -c %s -O4 2> %t.log
Daniel Dunbar6c6424b2010-06-07 23:28:45 +00005// RUN: grep '2: compiler, {1}, lto-bc' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +00006
7// and -emit-llvm doesn't alter pipeline (unfortunately?).
Daniel Dunbar80737ad2009-12-15 22:01:24 +00008// RUN: %clang -ccc-print-phases %s -emit-llvm 2> %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00009// RUN: grep '0: input, ".*lto.c", c' %t.log
10// RUN: grep '1: preprocessor, {0}, cpp-output' %t.log
Daniel Dunbar6c6424b2010-06-07 23:28:45 +000011// RUN: grep '2: compiler, {1}, lto-bc' %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000012// RUN: grep '3: linker, {2}, image' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +000013
14// llvm-bc and llvm-ll outputs need to match regular suffixes
15// (unfortunately).
Daniel Dunbar80737ad2009-12-15 22:01:24 +000016// RUN: %clang %s -emit-llvm -save-temps -### 2> %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000017// RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log
18// RUN: grep '"-o" ".*lto\.o" .*".*lto\.i"' %t.log
19// RUN: grep '".*a.out" .*".*lto\.o"' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +000020
Daniel Dunbar80737ad2009-12-15 22:01:24 +000021// RUN: %clang %s -emit-llvm -S -### 2> %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000022// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +000023