Teresa Johnson | ecc8038 | 2015-12-07 20:40:36 +0000 | [diff] [blame] | 1 | // RUN: %clang -O2 %s -flto=thin -c -o %t.o |
Teresa Johnson | aff2232 | 2015-12-07 19:21:34 +0000 | [diff] [blame] | 2 | // RUN: llvm-lto -thinlto -o %t %t.o |
| 3 | |
| 4 | // -fthinlto_index should be passed to cc1 |
Teresa Johnson | ecc8038 | 2015-12-07 20:40:36 +0000 | [diff] [blame] | 5 | // RUN: %clang -O2 -o %t1.o -x ir %t.o -c -fthinlto-index=%t.thinlto.bc -### 2>&1 | FileCheck %s -check-prefix=CHECK-THINLTOBE-ACTION |
Teresa Johnson | aff2232 | 2015-12-07 19:21:34 +0000 | [diff] [blame] | 6 | // CHECK-THINLTOBE-ACTION: -fthinlto-index= |
| 7 | |
Teresa Johnson | 9e4321c | 2018-04-17 16:39:25 +0000 | [diff] [blame] | 8 | // -save-temps should be passed to cc1 |
| 9 | // 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 |
| 10 | // 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 |
| 11 | // 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 |
| 12 | // CHECK-SAVE-TEMPS-NOT: -emit-llvm-bc |
| 13 | // CHECK-SAVE-TEMPS-CWD: -save-temps=cwd |
| 14 | // CHECK-SAVE-TEMPS-OBJ: -save-temps=obj |
| 15 | // CHECK-SAVE-TEMPS-NOT: -emit-llvm-bc |
| 16 | |
Teresa Johnson | aff2232 | 2015-12-07 19:21:34 +0000 | [diff] [blame] | 17 | // Ensure clang driver gives the expected error for incorrect input type |
Teresa Johnson | ecc8038 | 2015-12-07 20:40:36 +0000 | [diff] [blame] | 18 | // RUN: not %clang -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-WARNING |
Teresa Johnson | aff2232 | 2015-12-07 19:21:34 +0000 | [diff] [blame] | 19 | // CHECK-WARNING: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-x ir' |