[clang] 75cce50 - [Driver] Fix test for use of ld from devtoolset (NFC)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 04:53:25 PDT 2023


Author: Nikita Popov
Date: 2023-05-23T13:53:17+02:00
New Revision: 75cce50fd2d3869b97d66c280dc2b2c34f9b2818

URL: https://github.com/llvm/llvm-project/commit/75cce50fd2d3869b97d66c280dc2b2c34f9b2818
DIFF: https://github.com/llvm/llvm-project/commit/75cce50fd2d3869b97d66c280dc2b2c34f9b2818.diff

LOG: [Driver] Fix test for use of ld from devtoolset (NFC)

The test added in c5fe10f365247c3dd9416b7ec8bad73a60b5946e contains
some typos in the check lines, due to which it never actually
verified what was intended.

Fix the test by adding the required input tree and adjusting the
check lines appropriately.

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

Added: 
    clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/bin/ld
    clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o
    clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/crtend.o

Modified: 
    clang/test/Driver/linux-ld.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/bin/ld b/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/bin/ld
new file mode 100755
index 0000000000000..e69de29bb2d1d

diff  --git a/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o b/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o
new file mode 100644
index 0000000000000..e69de29bb2d1d

diff  --git a/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/crtend.o b/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/crtend.o
new file mode 100644
index 0000000000000..e69de29bb2d1d

diff  --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index 512fccbd6503d..18ad0b9aa07b7 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -1794,12 +1794,11 @@
 // RUN: %clang -### %s -no-pie 2>&1 \
 // RUN:     --target=x86_64-unknown-linux-gnu \
 // RUN:     --gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
-// RUN:     --sysroot=%S/Inputs/rhel_7_tree \
+// RUN:     --sysroot="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root" \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s
-// CHECK-LD-RHEL7-DTS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-LD-RHLE7-DTS: Selected GCC installation: [[GCC_INSTALL:[[SYSROOT]]/lib/gcc/x86_64-redhat-linux/7]]
+// CHECK-LD-RHEL7-DTS: "-isysroot" "[[SYSROOT:[^"]+]]"
 // CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld
-// CHECK-LD-RHLE7-DTS: [[GCC_INSTALL]/../../../bin/ld
+// CHECK-LD-RHEL7-DTS: [[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7/../../../../bin/ld
 
 // Check whether gcc7 install works fine on Amazon Linux AMI
 // RUN: %clang -### %s -no-pie 2>&1 \


        


More information about the cfe-commits mailing list