49 lines · c
1// Check that ld gets "-lto_library".2 3// RUN: mkdir -p %t/bin4// RUN: mkdir -p %t/lib5// RUN: touch %t/lib/libLTO.dylib6// RUN: %clang -fuse-ld= --target=x86_64-apple-darwin10 -### %s \7// RUN: -ccc-install-dir %t/bin -mlinker-version=133 2> %t.log8// RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log9//10// LINK_LTOLIB_PATH: {{ld(.exe)?"}}11// LINK_LTOLIB_PATH: "-lto_library"12 13// Also pass -lto_library even if the file doesn't exist; if it's needed at14// link time, ld will complain instead.15// RUN: %clang -fuse-ld= --target=x86_64-apple-darwin10 -### %s \16// RUN: -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log17// RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log18 19 20// Check that -object_lto_path is passed correctly to ld6421// RUN: %clang -fuse-ld= --target=x86_64-apple-darwin10 %s -flto=full \22// RUN: -mlinker-version=116 -### 2>&1 \23// RUN: | FileCheck -check-prefix=FULL_LTO_OBJECT_PATH %s24// FULL_LTO_OBJECT_PATH: {{ld(.exe)?"}}25// FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto"26// FULL_LTO_OBJECT_PATH-SAME: {{cc\-[a-zA-Z0-9_]+.o}}"27// RUN: %clang -fuse-ld= --target=x86_64-apple-darwin10 %s -flto=thin \28// RUN: -mlinker-version=116 -### 2>&1 \29// RUN: | FileCheck -check-prefix=THIN_LTO_OBJECT_PATH %s30// THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}}31// THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto"32// THIN_LTO_OBJECT_PATH-SAME: {{thinlto\-[a-zA-Z0-9_]+}}33 34 35// Check that we pass through -fglobal-isel flags to libLTO.36// RUN: %clang --target=arm64-apple-darwin %s -flto -fglobal-isel -### 2>&1 | \37// RUN: FileCheck --check-prefix=GISEL %s38// GISEL: {{ld(.exe)?"}}39// GISEL: "-mllvm" "-global-isel"40// GISEL: "-mllvm" "-global-isel-abort=0"41 42 43// Check that we disable atexit()-based global destructor lowering when44// compiling/linking for kernel/kext/freestanding.45// RUN: %clang --target=arm64-apple-darwin %s -flto -fapple-kext -### 2>&1 | \46// RUN: FileCheck --check-prefix=KEXT %s47// KEXT: {{ld(.exe)?"}}48// KEXT: "-mllvm" "-disable-atexit-based-global-dtor-lowering"49