[clang] 7f7f4be - [Clang] Set -mlinker-version explicitly in the lto test

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 18:34:22 PDT 2022


Author: Petr Hosek
Date: 2022-03-21T18:33:50-07:00
New Revision: 7f7f4be78abcad4558367b22693ea55cfc5bb547

URL: https://github.com/llvm/llvm-project/commit/7f7f4be78abcad4558367b22693ea55cfc5bb547
DIFF: https://github.com/llvm/llvm-project/commit/7f7f4be78abcad4558367b22693ea55cfc5bb547.diff

LOG: [Clang] Set -mlinker-version explicitly in the lto test

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.

Differential Revision: https://reviews.llvm.org/D122110

Added: 
    

Modified: 
    clang/test/Driver/darwin-ld-lto.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/darwin-ld-lto.c b/clang/test/Driver/darwin-ld-lto.c
index 441a07d0a7e56..efa28b6746fac 100644
--- a/clang/test/Driver/darwin-ld-lto.c
+++ b/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"


        


More information about the cfe-commits mailing list