Emit warnings if we are returning a reference to a local temporary.
[clang.git] / test / Driver / lto.c
blob22b47882691d535f52e618283673cbdf8e2fbf2b
1 // -emit-llvm, -flto, and -O4 all cause 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}, lto-bc' %t.log
4 // RUN: %clang -ccc-print-phases -c %s -O4 2> %t.log
5 // RUN: grep '2: compiler, {1}, lto-bc' %t.log
7 // and -emit-llvm doesn't alter pipeline (unfortunately?).
8 // RUN: %clang -ccc-print-phases %s -emit-llvm 2> %t.log
9 // RUN: grep '0: input, ".*lto.c", c' %t.log
10 // RUN: grep '1: preprocessor, {0}, cpp-output' %t.log
11 // RUN: grep '2: compiler, {1}, lto-bc' %t.log
12 // RUN: grep '3: linker, {2}, image' %t.log
14 // llvm-bc and llvm-ll outputs need to match regular suffixes
15 // (unfortunately).
16 // RUN: %clang %s -emit-llvm -save-temps -### 2> %t.log
17 // 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
21 // RUN: %clang %s -emit-llvm -S -### 2> %t.log
22 // RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log