[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / thinlto_backend.c
blob64f0a7bf6785b2cfb160ceee07024072cdbef5f1
1 // XFAIL: aix
3 // RUN: %clang -O2 %s -flto=thin -c -o %t.o
4 // RUN: llvm-lto -thinlto -o %t %t.o
6 // -fthinlto_index should be passed to cc1
7 // RUN: %clang -O2 -o %t1.o -x ir %t.o -c -fthinlto-index=%t.thinlto.bc -### \
8 // RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-THINLTOBE-ACTION
9 // CHECK-THINLTOBE-ACTION: -fthinlto-index=
10 // CHECK-THINLTOBE-ACTION-SAME: {{"?-x"? "?ir"?}}
12 // Check that this also works without -x ir.
13 // RUN: %clang -O2 -o %t1.o %t.o -c -fthinlto-index=%t.thinlto.bc -### 2>&1 \
14 // RUN: | FileCheck %s -check-prefix=CHECK-THINLTOBE-ACTION
16 // -save-temps should be passed to cc1
17 // 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-CWD
18 // 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-CWD
19 // 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-OBJ
20 // CHECK-SAVE-TEMPS-NOT: -emit-llvm-bc
21 // CHECK-SAVE-TEMPS-CWD: -save-temps=cwd
22 // CHECK-SAVE-TEMPS-OBJ: -save-temps=obj
23 // CHECK-SAVE-TEMPS-NOT: -emit-llvm-bc
25 // Ensure clang driver gives the expected error for incorrect input type
26 // RUN: not %clang -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 \
27 // RUN: | FileCheck %s -check-prefix=CHECK-WARNING
28 // CHECK-WARNING: error: option '-fthinlto-index={{.*}}' requires input to be LLVM bitcode