blob: 91524bf78b1d688324c1f3bae28435b45798e08d [file] [log] [blame]
Rafael Espindola3b0f62b2013-08-23 21:49:00 +00001// -flto causes 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 Dunbar337a6272009-03-24 20:17:30 +00004
Shuxin Yang378945b2013-08-14 19:45:49 +00005// RUN: %clang -ccc-print-phases %s -flto 2> %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00006// RUN: grep '0: input, ".*lto.c", c' %t.log
7// RUN: grep '1: preprocessor, {0}, cpp-output' %t.log
Daniel Dunbar6c6424b2010-06-07 23:28:45 +00008// RUN: grep '2: compiler, {1}, lto-bc' %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00009// RUN: grep '3: linker, {2}, image' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +000010
11// llvm-bc and llvm-ll outputs need to match regular suffixes
12// (unfortunately).
Shuxin Yang378945b2013-08-14 19:45:49 +000013// RUN: %clang %s -flto -save-temps -### 2> %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000014// RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log
15// RUN: grep '"-o" ".*lto\.o" .*".*lto\.i"' %t.log
16// RUN: grep '".*a.out" .*".*lto\.o"' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +000017
Shuxin Yang378945b2013-08-14 19:45:49 +000018// RUN: %clang %s -flto -S -### 2> %t.log
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000019// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
Daniel Dunbar337a6272009-03-24 20:17:30 +000020
Rafael Espindola6db90882013-08-25 14:27:09 +000021// RUN: not %clang %s -emit-llvm 2>&1 | FileCheck --check-prefix=LLVM-LINK %s
22// LLVM-LINK: -emit-llvm cannot be used when linking