summaryrefslogtreecommitdiff
path: root/test/Driver/arclite-link-external-toolchain.c
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2019-04-26 22:40:47 +0000
committerAlex Lorenz <arphaman@gmail.com>2019-04-26 22:40:47 +0000
commit6c1a7472fe28f11e86b8e44e41da52660b7a5719 (patch)
tree43dc9c17dd1fdebcba9a0a9b69e77d962d5a1174 /test/Driver/arclite-link-external-toolchain.c
parent1e503de6aa612b6178a938b5b9711b52e592b60a (diff)
downloadclang-6c1a7472fe28f11e86b8e44e41da52660b7a5719.tar.gz
[driver][macOS] Link libarclite from the default toolchain when clang
is running in a toolchain outside of xcode 'libarclite' usually lives in the same toolchain as 'clang'. However, the Swift open source toolchains for macOS distribute Clang without 'libarclite'. In that case, to allow the linker to find 'libarclite', we point to the 'libarclite' that should be in the XcodeDefault toolchain instead. The path to the toolchain is inferred from the SDK path if it's specified. https://bugs.swift.org/browse/SR-9972 rdar://49947573 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/arclite-link-external-toolchain.c')
-rw-r--r--test/Driver/arclite-link-external-toolchain.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Driver/arclite-link-external-toolchain.c b/test/Driver/arclite-link-external-toolchain.c
new file mode 100644
index 0000000000..2e6f8c10fc
--- /dev/null
+++ b/test/Driver/arclite-link-external-toolchain.c
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t.tmpdir
+// RUN: mkdir -p %t.tmpdir/Xcode.app/Contents/Developers/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
+// RUN: %clang -### -target x86_64-apple-macos10.10 -fobjc-link-runtime -lfoo \
+// RUN: -isysroot %t.tmpdir/Xcode.app/Contents/Developers/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \
+// RUN: %s 2>&1 | FileCheck %s
+
+// CHECK: -lfoo
+// CHECK: .tmpdir/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a