[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Driver / darwin-ld-lto.c
blobefa28b6746fac66185a5e5638c805acfc066a71e
1 // REQUIRES: system-darwin
3 // Check that ld gets "-lto_library".
5 // RUN: mkdir -p %t/bin
6 // RUN: mkdir -p %t/lib
7 // RUN: touch %t/lib/libLTO.dylib
8 // RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 -### %s \
9 // RUN: -ccc-install-dir %t/bin -mlinker-version=133 2> %t.log
10 // RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log
12 // LINK_LTOLIB_PATH: {{ld(.exe)?"}}
13 // LINK_LTOLIB_PATH: "-lto_library"
15 // Also pass -lto_library even if the file doesn't exist; if it's needed at
16 // link time, ld will complain instead.
17 // RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 -### %s \
18 // RUN: -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log
19 // RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log
22 // Check that -object_lto_path is passed correctly to ld64
23 // RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=full \
24 // RUN: -mlinker-version=116 -### 2>&1 \
25 // RUN: | FileCheck -check-prefix=FULL_LTO_OBJECT_PATH %s
26 // FULL_LTO_OBJECT_PATH: {{ld(.exe)?"}}
27 // FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto"
28 // FULL_LTO_OBJECT_PATH-SAME: {{cc\-[a-zA-Z0-9_]+.o}}"
29 // RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=thin \
30 // RUN: -mlinker-version=116 -### 2>&1 \
31 // RUN: | FileCheck -check-prefix=THIN_LTO_OBJECT_PATH %s
32 // THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}}
33 // THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto"
34 // THIN_LTO_OBJECT_PATH-SAME: {{thinlto\-[a-zA-Z0-9_]+}}
37 // Check that we pass through -fglobal-isel flags to libLTO.
38 // RUN: %clang -target arm64-apple-darwin %s -flto -fglobal-isel -### 2>&1 | \
39 // RUN: FileCheck --check-prefix=GISEL %s
40 // GISEL: {{ld(.exe)?"}}
41 // GISEL: "-mllvm" "-global-isel"
42 // GISEL: "-mllvm" "-global-isel-abort=0"