[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Driver / fat-lto-objects.c
blob887c33fa76d71f50ee66f2501b54ea0649185b42
1 // RUN: %clang --target=x86_64-unknown-linux-gnu -flto -ffat-lto-objects -### %s -c 2>&1 | FileCheck %s -check-prefix=CHECK-CC
2 // CHECK-CC: -cc1
3 // CHECK-CC-SAME: -emit-obj
4 // CHECK-CC-SAME: -ffat-lto-objects
6 /// Without -flto -S will just emit normal ASM, so we don't expect -emit-{llvm,obj} or -ffat-lto-objects to be passed to cc1.
7 // RUN: %clang --target=x86_64-unknown-linux-gnu -ffat-lto-objects -### %s -S 2>&1 | FileCheck %s -check-prefix=CHECK-CC-S
8 // CHECK-CC-S: -cc1
9 // CHECK-CC-S: -S
10 // CHECK-CC-S-NOT: -emit-obj
11 // CHECK-CC-S-NOT: -emit-llvm
12 // CHECK-CC-S-NOT: -ffat-lto-objects
14 /// When LTO is enabled, we expect LLVM IR output and -ffat-lto-objects to be passed to cc1.
15 // RUN: %clang --target=x86_64-unknown-linux-gnu -flto -ffat-lto-objects -### %s -S 2>&1 | FileCheck %s -check-prefix=CHECK-CC-S-LTO
16 // RUN: %clang --target=x86_64-unknown-linux-gnu -flto -ffat-lto-objects -### %s -S -emit-llvm 2>&1 | FileCheck %s -check-prefix=CHECK-CC-S-LTO
17 // CHECK-CC-S-LTO: -cc1
18 // CHECK-CC-S-LTO-SAME: -emit-llvm
19 // CHECK-CC-S-LTO-SAME: -ffat-lto-objects
21 /// Make sure we don't have a warning for -ffat-lto-objects being unused
22 // RUN: %clang --target=x86_64-unknown-linux-gnu -ffat-lto-objects -fdriver-only -Werror -v %s -c 2>&1 | FileCheck %s -check-prefix=CHECK-CC-NOLTO
23 // CHECK-CC-NOLTO: -cc1
24 // CHECK-CC-NOLTO-SAME: -emit-obj
25 // CHECK-CC-NOLTO-NOT: -ffat-lto-objects
27 /// We need to pass an additional flag (--fat-lto-objects) to lld when linking w/ -flto -ffat-lto-objects
28 /// But it should not be there when LTO is disabled w/ -fno-lto
29 // RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \
30 // RUN: -fuse-ld=lld -flto -ffat-lto-objects -### 2>&1 | FileCheck --check-prefix=LTO %s
31 // RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \
32 // RUN: -fuse-ld=lld -fno-lto -ffat-lto-objects -### 2>&1 | FileCheck --check-prefix=NOLTO %s
33 // LTO: "--fat-lto-objects"
34 // NOLTO-NOT: "--fat-lto-objects"