27 lines · c
1// RUN: %clang -O2 %s -flto=thin -c -o %t.o2// RUN: llvm-lto -thinlto -o %t %t.o3 4// -fthinlto_index should be passed to cc15// RUN: %clang -O2 -o %t1.o -x ir %t.o -c -fthinlto-index=%t.thinlto.bc -### \6// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-THINLTOBE-ACTION7// CHECK-THINLTOBE-ACTION: -fthinlto-index=8// CHECK-THINLTOBE-ACTION-SAME: {{"?-x"? "?ir"?}}9 10// Check that this also works without -x ir.11// RUN: %clang -O2 -o %t1.o %t.o -c -fthinlto-index=%t.thinlto.bc -### 2>&1 \12// RUN: | FileCheck %s -check-prefix=CHECK-THINLTOBE-ACTION13 14// -save-temps should be passed to cc115// RUN: %clang -O2 -o %t1.o -x ir %t.o -c -fthinlto-index=%t.thinlto.bc -save-temps -### 2>&1 | FileCheck %s -check-prefix=CHECK-SAVE-TEMPS -check-prefix=CHECK-SAVE-TEMPS-CWD16// RUN: %clang -O2 -o %t1.o -x ir %t.o -c -fthinlto-index=%t.thinlto.bc -save-temps=cwd -### 2>&1 | FileCheck %s -check-prefix=CHECK-SAVE-TEMPS -check-prefix=CHECK-SAVE-TEMPS-CWD17// RUN: %clang -O2 -o %t1.o -x ir %t.o -c -fthinlto-index=%t.thinlto.bc -save-temps=obj -### 2>&1 | FileCheck %s -check-prefix=CHECK-SAVE-TEMPS -check-prefix=CHECK-SAVE-TEMPS-OBJ18// CHECK-SAVE-TEMPS-NOT: -emit-llvm-bc19// CHECK-SAVE-TEMPS-CWD: -save-temps=cwd20// CHECK-SAVE-TEMPS-OBJ: -save-temps=obj21// CHECK-SAVE-TEMPS-NOT: -emit-llvm-bc22 23// Ensure clang driver gives the expected error for incorrect input type24// RUN: not %clang -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 \25// RUN: | FileCheck %s -check-prefix=CHECK-WARNING26// CHECK-WARNING: error: option '-fthinlto-index={{.*}}' requires input to be LLVM bitcode27