1 // -flto causes a switch to llvm-bc object files. 2 // RUN: %clang -ccc-print-phases -c %s -flto 2> %t.log 3 // RUN: grep '2: compiler, {1}, ir' %t.log 4 // RUN: grep '3: backend, {2}, lto-bc' %t.log 5 6 // RUN: %clang -ccc-print-phases %s -flto 2> %t.log 7 // RUN: grep '0: input, ".*lto.c", c' %t.log 8 // RUN: grep '1: preprocessor, {0}, cpp-output' %t.log 9 // RUN: grep '2: compiler, {1}, ir' %t.log 10 // RUN: grep '3: backend, {2}, lto-bc' %t.log 11 // RUN: grep '4: linker, {3}, image' %t.log 12 13 // llvm-bc and llvm-ll outputs need to match regular suffixes 14 // (unfortunately). 15 // RUN: %clang %s -flto -save-temps -### 2> %t.log 16 // RUN: grep '"-o" ".*lto\.i" "-x" "c" ".*lto\.c"' %t.log 17 // RUN: grep '"-o" ".*lto\.bc" .*".*lto\.i"' %t.log 18 // RUN: grep '"-o" ".*lto\.o" .*".*lto\.bc"' %t.log 19 // RUN: grep '".*a\.\(out\|exe\)" .*".*lto\.o"' %t.log 20 21 // RUN: %clang %s -flto -S -### 2> %t.log 22 // RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log 23 24 // RUN: not %clang %s -emit-llvm 2>&1 | FileCheck --check-prefix=LLVM-LINK %s 25 // LLVM-LINK: -emit-llvm cannot be used when linking 26