brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.2 KiB · a85f953 Raw
123 lines · c
1// -flto causes a switch to llvm-bc object files.2// RUN: %clang -ccc-print-phases -c %s -flto 2> %t3// RUN: FileCheck -check-prefix=CHECK-COMPILE-ACTIONS < %t %s4//5// CHECK-COMPILE-ACTIONS: 2: compiler, {1}, ir6// CHECK-COMPILE-ACTIONS: 3: backend, {2}, lto-bc7 8// RUN: %clang -ccc-print-phases %if target={{.*-windows-msvc.*}} %{ -fuse-ld=lld %} -flto %s 2> %t9// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-ACTIONS < %t %s10//11// CHECK-COMPILELINK-ACTIONS: 0: input, "{{.*}}lto.c", c12// CHECK-COMPILELINK-ACTIONS: 1: preprocessor, {0}, cpp-output13// CHECK-COMPILELINK-ACTIONS: 2: compiler, {1}, ir14// CHECK-COMPILELINK-ACTIONS: 3: backend, {2}, lto-bc15// CHECK-COMPILELINK-ACTIONS: 4: linker, {3}, image16 17// llvm-bc and llvm-ll outputs need to match regular suffixes18// (unfortunately).19// RUN: %clang --target=x86_64-linux-gnu %s -flto -save-temps -### 2> %t20// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-SUFFIXES < %t %s21//22// CHECK-COMPILELINK-SUFFIXES: "-o" "{{.*}}lto.i" "-x" "c" "{{.*}}lto.c"23// CHECK-COMPILELINK-SUFFIXES: "-o" "{{.*}}lto.bc" {{.*}}"{{.*}}lto.i"24// CHECK-COMPILELINK-SUFFIXES: "-o" "{{.*}}lto.o" {{.*}}"{{.*}}lto.bc"25// CHECK-COMPILELINK-SUFFIXES: "{{.*}}a.{{(out|exe)}}" {{.*}}"{{.*}}lto.o"26 27// RUN: %clang --target=x86_64-linux-gnu %s -flto -S -### 2> %t28// RUN: FileCheck -check-prefix=CHECK-COMPILE-SUFFIXES < %t %s29//30// CHECK-COMPILE-SUFFIXES: "-o" "{{.*}}lto.s" "-x" "c" "{{.*}}lto.c"31 32// RUN: not %clang %s -emit-llvm 2>&1 | FileCheck --check-prefix=LLVM-LINK %s33// LLVM-LINK: -emit-llvm cannot be used when linking34 35/// With ld.bfd or gold, link against LLVMgold.36// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \37// RUN:   -fuse-ld=bfd -flto=thin -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s38// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \39// RUN:   -fuse-ld=gold -flto=full -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s40// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \41// RUN:   -fuse-ld=gold -fno-lto -flto -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s42// LLVMGOLD: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}"43 44/// lld does not need LLVMgold.45// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \46// RUN:   -fuse-ld=lld -flto -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s47// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \48// RUN:   -fuse-ld=gold -flto -fno-lto -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s49// NO-LLVMGOLD-NOT: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}"50 51// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \52// RUN:   -fuse-ld=lld -flto -O -### 2>&1 | FileCheck --check-prefix=O1 %s53// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \54// RUN:   -fuse-ld=lld -flto -O1 -### 2>&1 | FileCheck --check-prefix=O1 %s55// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \56// RUN:   -fuse-ld=lld -flto -Og -### 2>&1 | FileCheck --check-prefix=O1 %s57// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \58// RUN:   -fuse-ld=lld -flto -O2 -### 2>&1 | FileCheck --check-prefix=O2 %s59// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \60// RUN:   -fuse-ld=lld -flto -Os -### 2>&1 | FileCheck --check-prefix=O2 %s61// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \62// RUN:   -fuse-ld=lld -flto -Oz -### 2>&1 | FileCheck --check-prefix=O2 %s63// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \64// RUN:   -fuse-ld=lld -flto -O3 -### 2>&1 | FileCheck --check-prefix=O3 %s65// RUN: %clang --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/basic_cross_linux_tree %s \66// RUN:   -fuse-ld=lld -flto -Ofast -### 2>&1 | FileCheck --check-prefix=O3 %s67 68// O1: -plugin-opt=O169// O2: -plugin-opt=O270// O3: -plugin-opt=O371 72// -flto passes along an explicit debugger tuning argument.73// RUN: %clang --target=x86_64-unknown-linux -### %s -flto -glldb 2> %t74// RUN: FileCheck -check-prefix=CHECK-TUNING-LLDB < %t %s75// RUN: %clang --target=x86_64-unknown-linux -### %s -flto -g 2> %t76// RUN: FileCheck -check-prefix=CHECK-NO-TUNING < %t %s77//78// CHECK-TUNING-LLDB:   "-plugin-opt=-debugger-tune=lldb"79// CHECK-NO-TUNING-NOT: "-plugin-opt=-debugger-tune80//81// -flto=auto and -flto=jobserver pass along -flto=full82// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=auto 2>&1 | FileCheck --check-prefix=FLTO-AUTO %s83// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=jobserver 2>&1 | FileCheck --check-prefix=FLTO-JOBSERVER %s84//85// FLTO-AUTO: -flto=full86// FLTO-JOBSERVER: -flto=full87//88 89// Pass the last -flto argument.90// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=thin -flto 2>&1 | \91// RUN: FileCheck --check-prefix=FLTO-FULL %s92// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=thin -flto=full \93// RUN: 2>&1 | FileCheck --check-prefix=FLTO-FULL %s94// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=full -flto=thin  \95// RUN: 2>&1 | FileCheck --check-prefix=FLTO-THIN %s96// RUN: %clang --target=x86_64-unknown-linux -### %s -flto -flto=thin 2>&1 | \97// RUN: FileCheck --check-prefix=FLTO-THIN %s98//99// FLTO-FULL-NOT: -flto=thin100// FLTO-FULL: -flto=full101// FLTO-FULL-NOT: -flto=thin102//103// FLTO-THIN-NOT: -flto=full104// FLTO-THIN-NOT: "-flto"105// FLTO-THIN: -flto=thin106// FLTO-THIN-NOT: "-flto"107// FLTO-THIN-NOT: -flto=full108 109// -flto passes along an explicit GlobalISel flag.110// RUN: %clang --target=riscv64-linux-gnu -### %s -flto -fglobal-isel 2> %t111// RUN: FileCheck --check-prefix=CHECK-GISEL < %t %s112// RUN: %clang --target=aarch64-linux-gnu -### %s -flto -fno-global-isel 2> %t113// RUN: FileCheck --check-prefix=CHECK-DISABLE-GISEL < %t %s114//115// CHECK-GISEL:         "-plugin-opt=-global-isel=1"116// CHECK-DISABLE-GISEL: "-plugin-opt=-global-isel=0"117 118// -flto passes -time-passes when -ftime-report is passed119// RUN: %clang --target=x86_64-unknown-linux-gnu -### %s -flto -ftime-report 2> %t120// RUN: FileCheck --check-prefix=CHECK-TIME-REPORT < %t %s121 122// CHECK-TIME-REPORT: "-plugin-opt=-time-passes"123