Skip to content

Commit d5ca160

Browse files
committedAug 1, 2023
[Driver] Fix test usages of --rtlib= without --unwindlib=
These errors surfaced after D156363. The error "--rtlib=libgcc requires --unwindlib=libgcc" happens only when `CLANG_DEFAULT_UNWINDLIB` has been specified at build time. Differential Revision: https://reviews.llvm.org/D156792
1 parent 668e33c commit d5ca160

13 files changed

+102
-102
lines changed
 

‎clang/test/Driver/csky-toolchain.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// In the below tests, --rtlib=platform is used so that the driver ignores
88
// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib
99

10-
// RUN: %clang -### %s -fuse-ld=ld -no-pie --target=csky-unknown-linux-gnu --rtlib=platform \
10+
// RUN: %clang -### %s -fuse-ld=ld -no-pie --target=csky-unknown-linux-gnu --rtlib=platform --unwindlib=platform \
1111
// RUN: --gcc-toolchain=%S/Inputs/multilib_csky_linux_sdk 2>&1 | FileCheck -check-prefix=C-CSKY-LINUX-MULTI %s
1212

1313
// C-CSKY-LINUX-MULTI: "{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/bin{{/|\\\\}}ld"
@@ -23,7 +23,7 @@
2323
// C-CSKY-LINUX-MULTI: "-L{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/libc/lib"
2424
// C-CSKY-LINUX-MULTI: "-L{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/libc/usr/lib"
2525

26-
// RUN: %clang -### %s -fuse-ld=ld -fno-pic -no-pie --target=csky-unknown-linux-gnu --rtlib=platform -march=ck860v \
26+
// RUN: %clang -### %s -fuse-ld=ld -fno-pic -no-pie --target=csky-unknown-linux-gnu --rtlib=platform --unwindlib=platform -march=ck860v \
2727
// RUN: --gcc-toolchain=%S/Inputs/multilib_csky_linux_sdk 2>&1 | FileCheck -check-prefix=C-CSKY-LINUX-CK860V %s
2828

2929
// C-CSKY-LINUX-CK860V: "{{.*}}/Inputs/multilib_csky_linux_sdk/lib/gcc/csky-linux-gnuabiv2/6.3.0/../../..{{/|\\\\}}..{{/|\\\\}}csky-linux-gnuabiv2/bin{{/|\\\\}}ld"

‎clang/test/Driver/env.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" CLANG_NO_DEFAULT_CONFIG=1 \
88
// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \
99
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
10-
// RUN: --rtlib=platform -no-pie \
10+
// RUN: --rtlib=platform --unwindlib=platform -no-pie \
1111
// RUN: --gcc-toolchain="" 2>&1 | FileCheck --check-prefix=CHECK-LD-32 %s
1212
//
1313
// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" CLANG_NO_DEFAULT_CONFIG=1 \
1414
// RUN: %clang %s -### -o %t.o --target=i386-unknown-linux \
1515
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
16-
// RUN: --rtlib=platform -no-pie \
16+
// RUN: --rtlib=platform --unwindlib=platform -no-pie \
1717
// RUN: --gcc-toolchain="" 2>&1 | FileCheck --check-prefix=CHECK-LD-32 %s
1818
//
1919
// CHECK-LD-32-NOT: warning:

‎clang/test/Driver/gcc-install-dir.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/// Test native GCC installation on Arch Linux i686.
44
// RUN: %clang -### %s --target=i686-linux-gnu --sysroot=%S/Inputs/archlinux_i686_tree -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
5-
// RUN: --stdlib=platform --rtlib=platform \
5+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform \
66
// RUN: --gcc-install-dir=%S/Inputs/archlinux_i686_tree/usr/lib/gcc/i686-pc-linux-gnu/11.1.0 2>&1 | FileCheck %s --check-prefix=ARCH_I686
77
// ARCH_I686: "-internal-isystem"
88
// ARCH_I686-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/i686-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0"
@@ -14,7 +14,7 @@
1414

1515
/// Test native GCC installation on Debian amd64. --gcc-install-dir= may end with /.
1616
// RUN: %clangxx %s -### --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/debian_multiarch_tree \
17-
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir --stdlib=platform --rtlib=platform \
17+
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir --stdlib=platform --rtlib=platform --unwindlib=platform \
1818
// RUN: --gcc-install-dir=%S/Inputs/debian_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/10/ 2>&1 | FileCheck %s --check-prefix=DEBIAN_X86_64
1919
// DEBIAN_X86_64: "-internal-isystem"
2020
// DEBIAN_X86_64-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10"
@@ -28,7 +28,7 @@
2828

2929
/// Test -m32.
3030
// RUN: %clangxx %s -### --target=x86_64-unknown-linux-gnu -m32 --sysroot=%S/Inputs/debian_multiarch_tree \
31-
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir --stdlib=platform --rtlib=platform \
31+
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir --stdlib=platform --rtlib=platform --unwindlib=platform \
3232
// RUN: --gcc-install-dir=%S/Inputs/debian_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/10/ 2>&1 | FileCheck %s --check-prefix=DEBIAN_X86_64_M32
3333
// DEBIAN_X86_64_M32: "-internal-isystem"
3434
// DEBIAN_X86_64_M32-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10"

‎clang/test/Driver/gcc-toolchain.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
/// Without --rtlib=libgcc the driver may pick clang_rt.crtbegin.o if
44
/// -DCLANG_DEFAULT_RTLIB=compiler-rt.
55
// RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \
6-
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc -no-pie 2>&1 | \
6+
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc --unwindlib=libgcc -no-pie 2>&1 | \
77
// RUN: FileCheck %s
88
//
99
// Additionally check that the legacy spelling of the flag works.
1010
// RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \
11-
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc -no-pie 2>&1 | \
11+
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc --unwindlib=libgcc -no-pie 2>&1 | \
1212
// RUN: FileCheck %s
1313
//
1414
// Test for header search toolchain detection.

‎clang/test/Driver/linux-cross.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// Test native GCC installation on Arch Linux i686.
44
// RUN: %clang -### %s --target=i686-linux-gnu --sysroot=%S/Inputs/archlinux_i686_tree \
55
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir \
6-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=ARCH_I686
6+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=ARCH_I686
77
// ARCH_I686: "-resource-dir" "[[RESOURCE:[^"]+]]"
88
// ARCH_I686: "-internal-isystem"
99
// ARCH_I686-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/i686-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0"
@@ -25,7 +25,7 @@
2525
/// Test native x86-64 in the tree.
2626
// RUN: %clang -### %s --target=x86_64-linux-gnu --sysroot=%S/Inputs/debian_multiarch_tree \
2727
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir \
28-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_X86_64
28+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_X86_64
2929
// DEBIAN_X86_64: "-resource-dir" "[[RESOURCE:[^"]+]]"
3030
// DEBIAN_X86_64: "-internal-isystem"
3131
// DEBIAN_X86_64-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10"
@@ -54,7 +54,7 @@
5454
/// Test -m32.
5555
// RUN: %clang -### %s --target=x86_64-linux-gnu -m32 --sysroot=%S/Inputs/debian_multiarch_tree \
5656
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir \
57-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_X86_64_M32
57+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_X86_64_M32
5858
// DEBIAN_X86_64_M32: "-resource-dir" "[[RESOURCE:[^"]+]]"
5959
// DEBIAN_X86_64_M32: "-internal-isystem"
6060
// DEBIAN_X86_64_M32-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10"
@@ -78,7 +78,7 @@
7878
/// Test native GCC installation on Debian i386.
7979
// RUN: %clang -### %s --target=i686-linux-gnu --sysroot=%S/Inputs/debian_i386_tree \
8080
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir \
81-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_I686
81+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_I686
8282
// DEBIAN_I686: "-resource-dir" "[[RESOURCE:[^"]+]]"
8383
// DEBIAN_I686: "-internal-isystem"
8484
// DEBIAN_I686-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/i686-linux-gnu/10/../../../../include/c++/10"
@@ -103,7 +103,7 @@
103103
/// Test -m64 on Debian i386.
104104
// RUN: %clang -### %s --target=i686-linux-gnu --sysroot=%S/Inputs/debian_i386_tree -m64 \
105105
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir \
106-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_I686_M64
106+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_I686_M64
107107
// DEBIAN_I686_M64: "-resource-dir" "[[RESOURCE:[^"]+]]"
108108
// DEBIAN_I686_M64: "-internal-isystem"
109109
// DEBIAN_I686_M64-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc/i686-linux-gnu/10/../../../../include/c++/10"
@@ -129,7 +129,7 @@
129129
/// Test a cross compiler.
130130
// RUN: %clang -### %s --target=aarch64-linux-gnu --sysroot=%S/Inputs/debian_multiarch_tree \
131131
// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin -resource-dir=%S/Inputs/resource_dir \
132-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_AARCH64
132+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=DEBIAN_AARCH64
133133
// DEBIAN_AARCH64: "-resource-dir" "[[RESOURCE:[^"]+]]"
134134
// DEBIAN_AARCH64: "-internal-isystem"
135135
// DEBIAN_AARCH64-SAME: {{^}} "[[SYSROOT:[^"]+]]/usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/include/c++/10"
@@ -202,13 +202,13 @@
202202

203203
/// LDSO_ARCH is i386 for all x86-32 variants.
204204
// RUN: %clang -### %s --target=i686-linux-musl --sysroot= \
205-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=MUSL_I686
205+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=MUSL_I686
206206
// MUSL_I686: "-dynamic-linker" "/lib/ld-musl-i386.so.1"
207207

208208
// RUN: %clang -### %s --target=x86_64-linux-muslx32 --sysroot= \
209-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=MUSL_X32
209+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=MUSL_X32
210210
// RUN: %clang -### %s --target=i686-linux-musl -mx32 --sysroot= \
211-
// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=MUSL_X32
211+
// RUN: --stdlib=platform --rtlib=platform --unwindlib=platform 2>&1 | FileCheck %s --check-prefix=MUSL_X32
212212
// MUSL_X32: "-dynamic-linker" "/lib/ld-musl-x32.so.1"
213213

214214
/// -r suppresses -dynamic-linker, default -l, and crt*.o like -nostdlib.

‎clang/test/Driver/linux-ld.c

+44-44
Large diffs are not rendered by default.

‎clang/test/Driver/loongarch-toolchain.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib.
1111

1212
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld -no-pie -mabi=lp64d \
13-
// RUN: --target=loongarch64-unknown-linux-gnu --rtlib=platform \
13+
// RUN: --target=loongarch64-unknown-linux-gnu --rtlib=platform --unwindlib=platform \
1414
// RUN: --gcc-toolchain=%S/Inputs/multilib_loongarch_linux_sdk \
1515
// RUN: --sysroot=%S/Inputs/multilib_loongarch_linux_sdk/sysroot 2>&1 \
1616
// RUN: | FileCheck --check-prefix=LA64 %s

‎clang/test/Driver/miamcu-opt.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform %s 2>&1 | FileCheck %s
2-
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform -m32 %s 2>&1 | FileCheck %s
3-
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --target=x86_64-unknown-linux-gnu %s 2>&1 | FileCheck %s
4-
// RUN: %clang -### --target=x86_64 -mno-iamcu -miamcu -rtlib=platform %s 2>&1 | FileCheck %s
5-
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform -m64 %s 2>&1 | FileCheck %s -check-prefix=M64
6-
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform -dynamic %s 2>&1 | FileCheck %s -check-prefix=DYNAMIC
7-
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --target=armv8-eabi %s 2>&1 | FileCheck %s -check-prefix=NOT-X86
1+
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --unwindlib=platform %s 2>&1 | FileCheck %s
2+
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --unwindlib=platform -m32 %s 2>&1 | FileCheck %s
3+
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --unwindlib=platform --target=x86_64-unknown-linux-gnu %s 2>&1 | FileCheck %s
4+
// RUN: %clang -### --target=x86_64 -mno-iamcu -miamcu -rtlib=platform --unwindlib=platform %s 2>&1 | FileCheck %s
5+
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --unwindlib=platform -m64 %s 2>&1 | FileCheck %s -check-prefix=M64
6+
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --unwindlib=platform -dynamic %s 2>&1 | FileCheck %s -check-prefix=DYNAMIC
7+
// RUN: %clang -### --target=x86_64 -miamcu -rtlib=platform --unwindlib=platform --target=armv8-eabi %s 2>&1 | FileCheck %s -check-prefix=NOT-X86
88
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -miamcu -mno-iamcu %s 2>&1 | FileCheck %s -check-prefix=MNOIAMCU
99

1010
// M64: error: invalid argument '-miamcu' not allowed with '-m64'

‎clang/test/Driver/nolibc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang -target i686-pc-linux-gnu -### -rtlib=libgcc -nolibc %s 2>&1 | FileCheck %s
1+
// RUN: %clang -target i686-pc-linux-gnu -### -rtlib=libgcc --unwindlib=libgcc -nolibc %s 2>&1 | FileCheck %s
22
// CHECK: crtbegin
33
// CHECK: "-lgcc"
44
// CHECK-NOT: "-lc"

‎clang/test/Driver/pic.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@
132132
// RUN: --sysroot=%S/Inputs/basic_freebsd_tree 2>&1 \
133133
// RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
134134
// RUN: %clang %s -target i386-linux-gnu -fPIE -pie -### \
135-
// RUN: --gcc-toolchain="" -rtlib=platform \
135+
// RUN: --gcc-toolchain="" -rtlib=platform --unwindlib=platform \
136136
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
137137
// RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
138138
// RUN: %clang %s -target i386-linux-gnu -fPIC -pie -### \
139-
// RUN: --gcc-toolchain="" -rtlib=platform \
139+
// RUN: --gcc-toolchain="" -rtlib=platform --unwindlib=platform \
140140
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
141141
// RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
142142
//

‎clang/test/Driver/riscv32-toolchain.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-linux-gnu/8.0.1{{/|\\\\}}crtend.o"
7878

7979
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld -no-pie \
80-
// RUN: --target=riscv32-unknown-linux-gnu --rtlib=platform -mabi=ilp32 \
80+
// RUN: --target=riscv32-unknown-linux-gnu --rtlib=platform --unwindlib=platform -mabi=ilp32 \
8181
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
8282
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
8383
// RUN: | FileCheck -check-prefix=C-RV32-LINUX-MULTI-ILP32 %s
@@ -92,7 +92,7 @@
9292
// C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32"
9393

9494
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld -no-pie \
95-
// RUN: --target=riscv32-unknown-linux-gnu --rtlib=platform -march=rv32imafd \
95+
// RUN: --target=riscv32-unknown-linux-gnu --rtlib=platform --unwindlib=platform -march=rv32imafd \
9696
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
9797
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
9898
// RUN: | FileCheck -check-prefix=C-RV32-LINUX-MULTI-ILP32D %s
@@ -107,7 +107,7 @@
107107
// C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d"
108108

109109
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld \
110-
// RUN: --target=riscv32-unknown-elf --rtlib=platform --sysroot= \
110+
// RUN: --target=riscv32-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \
111111
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
112112
// RUN: | FileCheck -check-prefix=C-RV32I-BAREMETAL-MULTI-ILP32 %s
113113

@@ -121,7 +121,7 @@
121121
// C-RV32I-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32{{/|\\\\}}crtend.o"
122122

123123
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld \
124-
// RUN: --target=riscv32-unknown-elf --rtlib=platform --sysroot= \
124+
// RUN: --target=riscv32-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \
125125
// RUN: -march=rv32im -mabi=ilp32\
126126
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
127127
// RUN: | FileCheck -check-prefix=C-RV32IM-BAREMETAL-MULTI-ILP32 %s
@@ -136,7 +136,7 @@
136136
// C-RV32IM-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32im/ilp32{{/|\\\\}}crtend.o"
137137

138138
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld \
139-
// RUN: --target=riscv32-unknown-elf --rtlib=platform --sysroot= \
139+
// RUN: --target=riscv32-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \
140140
// RUN: -march=rv32iac -mabi=ilp32\
141141
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
142142
// RUN: | FileCheck -check-prefix=C-RV32IAC-BAREMETAL-MULTI-ILP32 %s
@@ -151,7 +151,7 @@
151151
// C-RV32IAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32iac/ilp32{{/|\\\\}}crtend.o"
152152

153153
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld \
154-
// RUN: --target=riscv32-unknown-elf --rtlib=platform --sysroot= \
154+
// RUN: --target=riscv32-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \
155155
// RUN: -march=rv32imac -mabi=ilp32\
156156
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
157157
// RUN: | FileCheck -check-prefix=C-RV32IMAC-BAREMETAL-MULTI-ILP32 %s
@@ -166,7 +166,7 @@
166166
// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32{{/|\\\\}}crtend.o"
167167

168168
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld \
169-
// RUN: --target=riscv32-unknown-elf --rtlib=platform --sysroot= \
169+
// RUN: --target=riscv32-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \
170170
// RUN: -march=rv32imafc -mabi=ilp32f \
171171
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
172172
// RUN: | FileCheck -check-prefix=C-RV32IMAFC-BAREMETAL-MULTI-ILP32F %s
@@ -183,7 +183,7 @@
183183
// Check that --rtlib can be used to override the used runtime library
184184
// RUN: %clang -### %s \
185185
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \
186-
// RUN: --target=riscv32-unknown-elf --rtlib=libgcc 2>&1 \
186+
// RUN: --target=riscv32-unknown-elf --rtlib=libgcc --unwindlib=libgcc 2>&1 \
187187
// RUN: | FileCheck -check-prefix=C-RV32-RTLIB-LIBGCC-ILP32 %s
188188
// C-RV32-RTLIB-LIBGCC-ILP32: "{{.*}}crt0.o"
189189
// C-RV32-RTLIB-LIBGCC-ILP32: "{{.*}}crtbegin.o"
@@ -192,7 +192,7 @@
192192

193193
// RUN: %clang -### %s \
194194
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \
195-
// RUN: --target=riscv32-unknown-elf --rtlib=compiler-rt 2>&1 \
195+
// RUN: --target=riscv32-unknown-elf --rtlib=compiler-rt --unwindlib=compiler-rt 2>&1 \
196196
// RUN: | FileCheck -check-prefix=C-RV32-RTLIB-COMPILERRT-ILP32 %s
197197
// C-RV32-RTLIB-COMPILERRT-ILP32: "{{.*}}crt0.o"
198198
// C-RV32-RTLIB-COMPILERRT-ILP32: "{{.*}}clang_rt.crtbegin-riscv32.o"

‎clang/test/Driver/riscv64-toolchain.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-linux-gnu/8.0.1{{/|\\\\}}crtend.o"
7878

7979
// RUN: env "PATH=" %clang -### %s -fuse-ld= -no-pie \
80-
// RUN: --target=riscv64-unknown-linux-gnu --rtlib=platform -mabi=lp64 \
80+
// RUN: --target=riscv64-unknown-linux-gnu --rtlib=platform --unwindlib=platform -mabi=lp64 \
8181
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
8282
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
8383
// RUN: | FileCheck -check-prefix=C-RV64-LINUX-MULTI-LP64 %s
@@ -92,7 +92,7 @@
9292
// C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64"
9393

9494
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld -no-pie \
95-
// RUN: --target=riscv64-unknown-linux-gnu --rtlib=platform -march=rv64imafd \
95+
// RUN: --target=riscv64-unknown-linux-gnu --rtlib=platform --unwindlib=platform -march=rv64imafd \
9696
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
9797
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
9898
// RUN: | FileCheck -check-prefix=C-RV64-LINUX-MULTI-LP64D %s
@@ -107,7 +107,7 @@
107107
// C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d"
108108

109109
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld \
110-
// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \
110+
// RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \
111111
// RUN: -march=rv64imac -mabi=lp64\
112112
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
113113
// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-MULTI-LP64 %s
@@ -122,7 +122,7 @@
122122
// C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64{{/|\\\\}}crtend.o"
123123

124124
// RUN: env "PATH=" %clang -### %s -fuse-ld=ld \
125-
// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \
125+
// RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \
126126
// RUN: -march=rv64imafdc -mabi=lp64d \
127127
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
128128
// RUN: | FileCheck -check-prefix=C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D %s
@@ -139,7 +139,7 @@
139139
// Check that --rtlib can be used to override the used runtime library
140140
// RUN: %clang -### %s \
141141
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \
142-
// RUN: --target=riscv64-unknown-elf --rtlib=libgcc 2>&1 \
142+
// RUN: --target=riscv64-unknown-elf --rtlib=libgcc --unwindlib=libgcc 2>&1 \
143143
// RUN: | FileCheck -check-prefix=C-RV64-RTLIB-LIBGCC-LP64 %s
144144
// C-RV64-RTLIB-LIBGCC-LP64: "{{.*}}crt0.o"
145145
// C-RV64-RTLIB-LIBGCC-LP64: "{{.*}}crtbegin.o"
@@ -148,7 +148,7 @@
148148

149149
// RUN: %clang -### %s \
150150
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \
151-
// RUN: --target=riscv64-unknown-elf --rtlib=compiler-rt 2>&1 \
151+
// RUN: --target=riscv64-unknown-elf --rtlib=compiler-rt --unwindlib=compiler-rt 2>&1 \
152152
// RUN: | FileCheck -check-prefix=C-RV64-RTLIB-COMPILERRT-LP64 %s
153153
// C-RV64-RTLIB-COMPILERRT-LP64: "{{.*}}crt0.o"
154154
// C-RV64-RTLIB-COMPILERRT-LP64: "{{.*}}clang_rt.crtbegin-riscv64.o"

‎clang/test/OpenMP/linking.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,52 @@
44
// FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time.
55
//
66
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
7-
// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \
7+
// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform --unwindlib=platform \
88
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
99
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}"
1010
// CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
1111
// CHECK-LD-32: "-lpthread" "-lc"
1212
//
1313
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
14-
// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \
14+
// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
1515
// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
1616
// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}"
1717
// CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
1818
// CHECK-LD-64: "-lpthread" "-lc"
1919
//
2020
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
21-
// RUN: -fopenmp=libgomp -target i386-unknown-linux -rtlib=platform \
21+
// RUN: -fopenmp=libgomp -target i386-unknown-linux -rtlib=platform --unwindlib=platform \
2222
// RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s
2323

24-
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target i386-unknown-linux -rtlib=platform | FileCheck --check-prefix SIMD-ONLY2 %s
24+
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target i386-unknown-linux -rtlib=platform --unwindlib=platform | FileCheck --check-prefix SIMD-ONLY2 %s
2525
// SIMD-ONLY2-NOT: lgomp
2626
// SIMD-ONLY2-NOT: lomp
2727
// SIMD-ONLY2-NOT: liomp
2828
// CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}"
2929
// CHECK-GOMP-LD-32: "-lgomp" "-lrt"
3030
// CHECK-GOMP-LD-32: "-lpthread" "-lc"
3131

32-
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target i386-unknown-linux -rtlib=platform | FileCheck --check-prefix SIMD-ONLY2 %s
32+
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target i386-unknown-linux -rtlib=platform --unwindlib=platform | FileCheck --check-prefix SIMD-ONLY2 %s
3333
// SIMD-ONLY2-NOT: lgomp
3434
// SIMD-ONLY2-NOT: lomp
3535
// SIMD-ONLY2-NOT: liomp
3636
//
3737
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
38-
// RUN: -fopenmp=libgomp -target x86_64-unknown-linux -rtlib=platform \
38+
// RUN: -fopenmp=libgomp -target x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
3939
// RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s
4040
// CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}"
4141
// CHECK-GOMP-LD-64: "-lgomp" "-lrt"
4242
// CHECK-GOMP-LD-64: "-lpthread" "-lc"
4343
//
4444
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
45-
// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \
45+
// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform --unwindlib=platform \
4646
// RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s
4747
// CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}"
4848
// CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
4949
// CHECK-IOMP5-LD-32: "-lpthread" "-lc"
5050
//
5151
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
52-
// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \
52+
// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
5353
// RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s
5454
// CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}"
5555
// CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
@@ -67,39 +67,39 @@
6767
//
6868
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
6969
// RUN: -fopenmp -fopenmp=libgomp -target i386-unknown-linux \
70-
// RUN: -rtlib=platform \
70+
// RUN: -rtlib=platform --unwindlib=platform \
7171
// RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-32 %s
7272
// CHECK-LD-OVERRIDE-32: "{{.*}}ld{{(.exe)?}}"
7373
// CHECK-LD-OVERRIDE-32: "-lgomp" "-lrt"
7474
// CHECK-LD-OVERRIDE-32: "-lpthread" "-lc"
7575
//
7676
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
7777
// RUN: -fopenmp -fopenmp=libgomp -target x86_64-unknown-linux \
78-
// RUN: -rtlib=platform \
78+
// RUN: -rtlib=platform --unwindlib=platform \
7979
// RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-64 %s
8080
// CHECK-LD-OVERRIDE-64: "{{.*}}ld{{(.exe)?}}"
8181
// CHECK-LD-OVERRIDE-64: "-lgomp" "-lrt"
8282
// CHECK-LD-OVERRIDE-64: "-lpthread" "-lc"
8383
//
8484
// RUN: %clang -no-canonical-prefixes -fuse-ld=link %s -### -o %t.o 2>&1 \
85-
// RUN: -fopenmp=libomp -target x86_64-msvc-win32 -rtlib=platform \
85+
// RUN: -fopenmp=libomp -target x86_64-msvc-win32 -rtlib=platform --unwindlib=platform \
8686
// RUN: | FileCheck --check-prefix=CHECK-MSVC-LINK-64 %s
8787
// CHECK-MSVC-LINK-64: link.exe
8888
// CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcomp.lib
8989
// CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcompd.lib
9090
// CHECK-MSVC-LINK-64-SAME: -libpath:{{.+}}/../lib
9191
// CHECK-MSVC-LINK-64-SAME: -defaultlib:libomp.lib
9292

93-
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target x86_64-msvc-win32 -rtlib=platform | FileCheck --check-prefix SIMD-ONLY11 %s
93+
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target x86_64-msvc-win32 -rtlib=platform --unwindlib=platform | FileCheck --check-prefix SIMD-ONLY11 %s
9494
// SIMD-ONLY11-NOT: libiomp
9595
// SIMD-ONLY11-NOT: libomp
9696
// SIMD-ONLY11-NOT: libgomp
9797
//
9898
// RUN: %clang -no-canonical-prefixes %s -fuse-ld=link -### -o %t.o 2>&1 \
99-
// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 -rtlib=platform \
99+
// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 -rtlib=platform --unwindlib=platform \
100100
// RUN: | FileCheck --check-prefix=CHECK-MSVC-ILINK-64 %s
101101

102-
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target x86_64-msvc-win32 -rtlib=platform | FileCheck --check-prefix SIMD-ONLY11 %s
102+
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target x86_64-msvc-win32 -rtlib=platform --unwindlib=platform | FileCheck --check-prefix SIMD-ONLY11 %s
103103
// SIMD-ONLY11-NOT: libiomp
104104
// SIMD-ONLY11-NOT: libomp
105105
// SIMD-ONLY11-NOT: libgomp

0 commit comments

Comments
 (0)
Please sign in to comment.