Skip to content

Commit 5ce85e6

Browse files
committed
Fix driver test from e16c0a9
The test failed silently if lld wasn't built alongside clang. But the test uses -###, so the "invalid linker name in -fuse-ld=lld" diag didn't make clang fail, and something else happened to match "-demangle", so the test passed. To fix, pass -B to a directory with two empty +x files (which works on non-Windows), and look for `"-demangle"` instead of just `-demangle`. Also force linker_version to 0 and pass a darwin triple. Differential Revision: https://reviews.llvm.org/D92028
1 parent 9c3b68d commit 5ce85e6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

clang/test/Driver/Inputs/lld/ld64.lld

Whitespace-only changes.

clang/test/Driver/Inputs/lld/ld64.lld.darwinnew

Whitespace-only changes.
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// With -fuse-ld=lld, -demangle is always passed to the linker on Darwin.
2+
// REQUIRES: shell
23

3-
// RUN: %clang -### -fuse-ld=lld %s 2>&1 | FileCheck %s
4+
// RUN: %clang --target=x86_64-apple-darwin -### \
5+
// RUN: -fuse-ld=lld -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \
6+
// RUN: | FileCheck %s
47
// FIXME: Remove ld.darwinnew once it's the default (and only) mach-o lld.
5-
// RUN: %clang -### -fuse-ld=lld.darwinnew %s 2>&1 | FileCheck %s
6-
// CHECK: -demangle
8+
// RUN: %clang --target=x86_64-apple-darwin -### \
9+
// RUN: -fuse-ld=lld.darwinnew -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \
10+
// RUN: | FileCheck %s
11+
12+
// CHECK: "-demangle"

0 commit comments

Comments
 (0)