phosek created this revision. phosek added reviewers: smeenai, int3, oontvoo, thakis. Herald added subscribers: ormris, steven_wu, hiraditya, inglorion. Herald added a project: All. phosek requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
This test assumes that the driver will set -object_path_lto linker flag and it requests the platform linker with -fuse-ld=. When lld is used as the host linker, the host linker version is unset and so Clang won't set -object_path_lto since that flag is set conditionally only when linker version is at least 116. We set the linker version explicitly to make sure that -object_path_lto is set. That approach is already used elsewhere in the test. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D122110 Files: clang/test/Driver/darwin-ld-lto.c Index: clang/test/Driver/darwin-ld-lto.c =================================================================== --- clang/test/Driver/darwin-ld-lto.c +++ clang/test/Driver/darwin-ld-lto.c @@ -20,12 +20,14 @@ // Check that -object_lto_path is passed correctly to ld64 -// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=full -### 2>&1 \ +// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=full \ +// RUN: -mlinker-version=116 -### 2>&1 \ // RUN: | FileCheck -check-prefix=FULL_LTO_OBJECT_PATH %s // FULL_LTO_OBJECT_PATH: {{ld(.exe)?"}} // FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto" // FULL_LTO_OBJECT_PATH-SAME: {{cc\-[a-zA-Z0-9_]+.o}}" -// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=thin -### 2>&1 \ +// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=thin \ +// RUN: -mlinker-version=116 -### 2>&1 \ // RUN: | FileCheck -check-prefix=THIN_LTO_OBJECT_PATH %s // THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}} // THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto"
Index: clang/test/Driver/darwin-ld-lto.c =================================================================== --- clang/test/Driver/darwin-ld-lto.c +++ clang/test/Driver/darwin-ld-lto.c @@ -20,12 +20,14 @@ // Check that -object_lto_path is passed correctly to ld64 -// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=full -### 2>&1 \ +// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=full \ +// RUN: -mlinker-version=116 -### 2>&1 \ // RUN: | FileCheck -check-prefix=FULL_LTO_OBJECT_PATH %s // FULL_LTO_OBJECT_PATH: {{ld(.exe)?"}} // FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto" // FULL_LTO_OBJECT_PATH-SAME: {{cc\-[a-zA-Z0-9_]+.o}}" -// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=thin -### 2>&1 \ +// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 %s -flto=thin \ +// RUN: -mlinker-version=116 -### 2>&1 \ // RUN: | FileCheck -check-prefix=THIN_LTO_OBJECT_PATH %s // THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}} // THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto"
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits