[PATCH] D93023: Replace deprecated %T in 2 tests.
Hafiz Abid Qadeer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 11 06:03:34 PST 2021
abidh updated this revision to Diff 322970.
abidh added a comment.
Changes in this version.
1. Added an explicit --sysroot argument.
2. Shortened "testroot-riscv{len}-baremetal-nogcc" string
As pointed out by @MaskRay that some tests were failing when gcc-10-riscv64-linux-gnu was installed. This was happening because the test was checking a case when --gcc-toolchain is not provided. In this case, code does check the path alongside clang installation. But it also checks for a system wide installation in /usr. It prefers a higher version number too. So to make the test more robust, I have provided an explicit --sysroot argument. Its value has been chosen to match the existing pattern.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93023/new/
https://reviews.llvm.org/D93023
Files:
clang/test/Driver/riscv32-toolchain-extra.c
clang/test/Driver/riscv64-toolchain-extra.c
Index: clang/test/Driver/riscv64-toolchain-extra.c
===================================================================
--- clang/test/Driver/riscv64-toolchain-extra.c
+++ clang/test/Driver/riscv64-toolchain-extra.c
@@ -11,25 +11,26 @@
// The test below checks that the driver correctly finds the linker and
// runtime if and only if they exist.
//
-// RUN: rm -rf %T/testroot-riscv64-baremetal-nogcc
-// RUN: mkdir -p %T/testroot-riscv64-baremetal-nogcc/bin
-// RUN: ln -s %clang %T/testroot-riscv64-baremetal-nogcc/bin/clang
-// RUN: ln -s %S/Inputs/basic_riscv64_nogcc_tree/bin/riscv64-unknown-elf-ld %T/testroot-riscv64-baremetal-nogcc/bin/riscv64-unknown-elf-ld
-// RUN: ln -s %S/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf %T/testroot-riscv64-baremetal-nogcc/riscv64-unknown-elf
-// RUN: %T/testroot-riscv64-baremetal-nogcc/bin/clang %s -### -no-canonical-prefixes \
-// RUN: --gcc-toolchain=%T/testroot-riscv64-baremetal-nogcc/invalid \
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/riscv64-nogcc/bin
+// RUN: ln -s %clang %t/riscv64-nogcc/bin/clang
+// RUN: ln -s %S/Inputs/basic_riscv64_nogcc_tree/bin/riscv64-unknown-elf-ld %t/riscv64-nogcc/bin/riscv64-unknown-elf-ld
+// RUN: ln -s %S/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf %t/riscv64-nogcc/riscv64-unknown-elf
+// RUN: %t/riscv64-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: --gcc-toolchain=%t/riscv64-nogcc/invalid \
// RUN: -target riscv64-unknown-elf --rtlib=platform -fuse-ld= 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV64-BAREMETAL-LP64-NOGCC %s
-// RUN: %T/testroot-riscv64-baremetal-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: %t/riscv64-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: --sysroot=%t/riscv64-nogcc/bin/../riscv64-unknown-elf \
// RUN: -target riscv64-unknown-elf --rtlib=platform -fuse-ld= 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV64-BAREMETAL-LP64-NOGCC %s
-// C-RV64-BAREMETAL-LP64-NOGCC: "-internal-isystem" "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/../riscv64-unknown-elf/include"
-// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/riscv64-unknown-elf-ld"
-// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/../riscv64-unknown-elf/lib/crt0.o"
-// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/{{.*}}/lib/clang_rt.crtbegin-riscv64.o"
-// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/../riscv64-unknown-elf/lib"
+// C-RV64-BAREMETAL-LP64-NOGCC: "-internal-isystem" "{{.*}}/riscv64-nogcc/bin/../riscv64-unknown-elf/include"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}/riscv64-nogcc/bin/riscv64-unknown-elf-ld"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}/riscv64-nogcc/bin/../riscv64-unknown-elf/lib/crt0.o"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}/riscv64-nogcc/{{.*}}/lib/clang_rt.crtbegin-riscv64.o"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}/riscv64-nogcc/bin/../riscv64-unknown-elf/lib"
// C-RV64-BAREMETAL-LP64-NOGCC: "--start-group" "-lc" "-lgloss" "--end-group"
-// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/{{.*}}/lib/libclang_rt.builtins-riscv64.a"
-// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/{{.*}}/lib/clang_rt.crtend-riscv64.o"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}/riscv64-nogcc/{{.*}}/lib/libclang_rt.builtins-riscv64.a"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}/riscv64-nogcc/{{.*}}/lib/clang_rt.crtend-riscv64.o"
Index: clang/test/Driver/riscv32-toolchain-extra.c
===================================================================
--- clang/test/Driver/riscv32-toolchain-extra.c
+++ clang/test/Driver/riscv32-toolchain-extra.c
@@ -11,25 +11,26 @@
// The test below checks that the driver correctly finds the linker and
// runtime if and only if they exist.
//
-// RUN: rm -rf %T/testroot-riscv32-baremetal-nogcc
-// RUN: mkdir -p %T/testroot-riscv32-baremetal-nogcc/bin
-// RUN: ln -s %clang %T/testroot-riscv32-baremetal-nogcc/bin/clang
-// RUN: ln -s %S/Inputs/basic_riscv32_nogcc_tree/bin/riscv32-unknown-elf-ld %T/testroot-riscv32-baremetal-nogcc/bin/riscv32-unknown-elf-ld
-// RUN: ln -s %S/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf %T/testroot-riscv32-baremetal-nogcc/riscv32-unknown-elf
-// RUN: %T/testroot-riscv32-baremetal-nogcc/bin/clang %s -### -no-canonical-prefixes \
-// RUN: --gcc-toolchain=%T/testroot-riscv32-baremetal-nogcc/invalid \
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/riscv32-nogcc/bin
+// RUN: ln -s %clang %t/riscv32-nogcc/bin/clang
+// RUN: ln -s %S/Inputs/basic_riscv32_nogcc_tree/bin/riscv32-unknown-elf-ld %t/riscv32-nogcc/bin/riscv32-unknown-elf-ld
+// RUN: ln -s %S/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf %t/riscv32-nogcc/riscv32-unknown-elf
+// RUN: %t/riscv32-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: --gcc-toolchain=%t/riscv32-nogcc/invalid \
// RUN: -target riscv32-unknown-elf --rtlib=platform -fuse-ld= 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV32-BAREMETAL-ILP32-NOGCC %s
-// RUN: %T/testroot-riscv32-baremetal-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: %t/riscv32-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: --sysroot=%t/riscv32-nogcc/bin/../riscv32-unknown-elf \
// RUN: -target riscv32-unknown-elf --rtlib=platform -fuse-ld= 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV32-BAREMETAL-ILP32-NOGCC %s
-// C-RV32-BAREMETAL-ILP32-NOGCC: "-internal-isystem" "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/../riscv32-unknown-elf/include"
-// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/riscv32-unknown-elf-ld"
-// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/../riscv32-unknown-elf/lib/crt0.o"
-// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/{{.*}}/lib/clang_rt.crtbegin-riscv32.o"
-// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/../riscv32-unknown-elf/lib"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "-internal-isystem" "{{.*}}/riscv32-nogcc/bin/../riscv32-unknown-elf/include"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}/riscv32-nogcc/bin/riscv32-unknown-elf-ld"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}/riscv32-nogcc/bin/../riscv32-unknown-elf/lib/crt0.o"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}/riscv32-nogcc/{{.*}}/lib/clang_rt.crtbegin-riscv32.o"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}/riscv32-nogcc/bin/../riscv32-unknown-elf/lib"
// C-RV32-BAREMETAL-ILP32-NOGCC: "--start-group" "-lc" "-lgloss" "--end-group"
-// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/{{.*}}/lib/libclang_rt.builtins-riscv32.a"
-// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/{{.*}}/lib/clang_rt.crtend-riscv32.o"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}/riscv32-nogcc/{{.*}}/lib/libclang_rt.builtins-riscv32.a"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}/riscv32-nogcc/{{.*}}/lib/clang_rt.crtend-riscv32.o"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93023.322970.patch
Type: text/x-patch
Size: 7031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210211/6f7d9ad6/attachment-0001.bin>
More information about the cfe-commits
mailing list