57 lines · c
1// RUN: %clang --target=x86_64-unknown-linux-gnu -flto -ffat-lto-objects -### %s -c 2>&1 | FileCheck %s -check-prefix=CHECK-CC2// CHECK-CC: -cc13// CHECK-CC-SAME: -emit-obj4// CHECK-CC-SAME: -ffat-lto-objects5 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-S8// CHECK-CC-S: -cc19// CHECK-CC-S: -S10// CHECK-CC-S-NOT: -emit-obj11// CHECK-CC-S-NOT: -emit-llvm12// CHECK-CC-S-NOT: -ffat-lto-objects13 14/// When fat LTO is enabled with -S, we expect asm 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-LTO16// CHECK-CC-S-LTO: -cc117// CHECK-CC-S-NOT: -emit-llvm18// CHECK-CC-S-LTO-SAME: -ffat-lto-objects19 20/// When fat LTO is enabled with -S and -emit-llvm, we expect IR output and -ffat-lto-objects to be passed to cc1.21// 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-EL-LTO22// CHECK-CC-S-EL-LTO: -cc123// CHECK-CC-S-EL-LTO-SAME: -emit-llvm24// CHECK-CC-S-EL-LTO-SAME: -ffat-lto-objects25 26/// When fat LTO is enabled without -S we expect native object output and -ffat-lto-object to be passed to cc1.27// RUN: %clang --target=x86_64-unknown-linux-gnu -flto -ffat-lto-objects -### %s -c 2>&1 | FileCheck %s -check-prefix=CHECK-CC-C-LTO28// CHECK-CC-C-LTO: -cc129// CHECK-CC-C-LTO-SAME: -emit-obj30// CHECK-CC-C-LTO-SAME: -ffat-lto-objects31 32/// When fat LTO is enabled with -c and -emit-llvm we expect bitcode output and -ffat-lto-object to be passed to cc1.33// RUN: %clang --target=x86_64-unknown-linux-gnu -flto -ffat-lto-objects -### %s -c -emit-llvm 2>&1 | FileCheck %s -check-prefix=CHECK-CC-C-EL-LTO34// CHECK-CC-C-EL-LTO: -cc135// CHECK-CC-C-EL-LTO-SAME: -emit-llvm-bc36// CHECK-CC-C-EL-LTO-SAME: -ffat-lto-objects37 38/// Make sure we don't have a warning for -ffat-lto-objects being unused39// 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-NOLTO40// CHECK-CC-NOLTO: -cc141// CHECK-CC-NOLTO-SAME: -emit-obj42// CHECK-CC-NOLTO-NOT: -ffat-lto-objects43 44// RUN: %clang --target=x86_64-unknown-linux-gnu -flto -ffat-lto-objects -fno-fat-lto-objects -### %s -c 2>&1 | FileCheck %s -check-prefix=CHECK-CC-NOLTO45 46/// We need to pass an additional flag (--fat-lto-objects) to lld when linking w/ -flto -ffat-lto-objects47/// But it should not be there when LTO is disabled w/ -fno-lto48// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \49// RUN: -fuse-ld=lld -flto -ffat-lto-objects -### 2>&1 | FileCheck --check-prefix=LTO %s50// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \51// RUN: -fuse-ld=lld -fno-lto -ffat-lto-objects -### 2>&1 | FileCheck --check-prefix=NOLTO %s52// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \53// RUN: -fuse-ld=lld --ld-path=%S/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/lld-wrapper \54// RUN: -flto -ffat-lto-objects -### 2>&1 | FileCheck --check-prefix=LTO %s55// LTO: "--fat-lto-objects"56// NOLTO-NOT: "--fat-lto-objects"57