dmajor created this revision.
dmajor added reviewers: arphaman, steven_wu, dexonsmith.
dmajor added projects: clang, LLVM.
Herald added a subscriber: cfe-commits.

(Note, I don't currently have commit access.)

The code in llvmorg-10-init-12188-g25ce33a6e4f is a breaking change for users 
of older linkers who don't pass a version parameter, which prevents a drop-in 
clang upgrade. Old tools can't know about what future tools will do, so as a 
general principle the burden should be new tools to be compatible by default. 
Also, for comparison, none of the other tests of `Version` within `AddLinkArgs` 
add any new behaviors unless the version is explicitly specified. Therefore, 
this patch changes the `-platform_version` behavior from opt-out to opt-in.

In light of the test fixup in llvmorg-10-init-12213-gbe88a20c900, I've used 
`-mlinker-version=0` instead of doing a straight revert of the additions of 
`-mlinker-version=400`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74784

Files:
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/test/Driver/darwin-infer-simulator-sdkroot.c
  clang/test/Driver/darwin-ld-platform-version-macos.c
  clang/test/Driver/darwin-ld.c
  clang/test/Driver/darwin-sdkroot.c
  clang/test/Driver/target-triple-deployment.c

Index: clang/test/Driver/target-triple-deployment.c
===================================================================
--- clang/test/Driver/target-triple-deployment.c
+++ clang/test/Driver/target-triple-deployment.c
@@ -1,14 +1,14 @@
 // RUN: touch %t.o
-// RUN: %clang -target x86_64-apple-macosx10.4 -mlinker-version=400 -### %t.o 2> %t.log
-// RUN: %clang -target x86_64-apple-darwin9 -mlinker-version=400 -### %t.o 2>> %t.log
-// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target x86_64-apple-macosx10.4 -mlinker-version=0 -### %t.o 2> %t.log
+// RUN: %clang -target x86_64-apple-darwin9 -mlinker-version=0 -### %t.o 2>> %t.log
+// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=0 -### %t.o 2>> %t.log
 //
-// RUN: %clang -target armv7-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios0.0 -mlinker-version=400 -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios1.2.3 -mlinker-version=400 -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios5.0 -mlinker-version=400 -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios7.0 -mlinker-version=400 -### %t.o 2>> %t.log
-// RUN: %clang -target arm64-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios -mlinker-version=0 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios0.0 -mlinker-version=0 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios1.2.3 -mlinker-version=0 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios5.0 -mlinker-version=0 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios7.0 -mlinker-version=0 -### %t.o 2>> %t.log
+// RUN: %clang -target arm64-apple-ios -mlinker-version=0 -### %t.o 2>> %t.log
 //
 // RUN: FileCheck %s < %t.log
 
Index: clang/test/Driver/darwin-sdkroot.c
===================================================================
--- clang/test/Driver/darwin-sdkroot.c
+++ clang/test/Driver/darwin-sdkroot.c
@@ -43,7 +43,7 @@
 //
 // RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
 // RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin -mlinker-version=0 --sysroot="" %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-IPHONE %s
 //
 // CHECK-IPHONE: clang
@@ -55,7 +55,7 @@
 //
 // RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
 // RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=0 --sysroot="" %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-SIMULATOR %s
 //
 // CHECK-SIMULATOR: clang
@@ -66,7 +66,7 @@
 //
 // RUN: rm -rf %t/SDKs/MacOSX10.10.0.sdk
 // RUN: mkdir -p %t/SDKs/MacOSX10.10.0.sdk
-// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=0 --sysroot="" %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-MACOSX %s
 //
 // CHECK-MACOSX: clang
Index: clang/test/Driver/darwin-ld.c
===================================================================
--- clang/test/Driver/darwin-ld.c
+++ clang/test/Driver/darwin-ld.c
@@ -11,9 +11,9 @@
 
 // Check linker changes that came with new linkedit format.
 // RUN: touch %t.o
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
 // RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log
 
 // LINK_IPHONE_3_0: {{ld(.exe)?"}}
@@ -30,9 +30,9 @@
 // LINK_IPHONE_3_0: -lbundle1.o
 // LINK_IPHONE_3_0: -lSystem
 
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
 // RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log
 
 // LINK_IPHONE_3_1: {{ld(.exe)?"}}
@@ -49,9 +49,9 @@
 // LINK_IPHONE_3_1-NOT: -lbundle1.o
 // LINK_IPHONE_3_1: -lSystem
 
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch i386 -mios-simulator-version-min=3.0 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=0 -### -arch i386 -mios-simulator-version-min=3.0 -bundle %t.o 2>> %t.log
 // RUN: FileCheck -check-prefix=LINK_IOSSIM_3_0 %s < %t.log
 
 // LINK_IOSSIM_3_0: {{ld(.exe)?"}}
@@ -132,8 +132,8 @@
 // LINK_LAZY_LIBRARY: {{ld(.exe)?"}}
 // LINK_LAZY_LIBRARY: "-lazy_library" "Library"
 
-// RUN: %clang -target x86_64-apple-darwin10 -mlinker-version=400 -### %t.o 2> %t.log
-// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target x86_64-apple-darwin10 -mlinker-version=0 -### %t.o 2> %t.log
+// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=0 -### %t.o 2>> %t.log
 // RUN: FileCheck -check-prefix=LINK_VERSION_MIN %s < %t.log
 // LINK_VERSION_MIN: {{ld(.exe)?"}}
 // LINK_VERSION_MIN: "-macosx_version_min" "10.6.0"
@@ -158,7 +158,7 @@
 // LINK_IOSSIM_PROFILE: libclang_rt.profile_iossim.a
 // LINK_IOSSIM_PROFILE: libclang_rt.ios.a
 
-// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
+// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=0 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_TVOS_ARM64 %s < %t.log
 // LINK_TVOS_ARM64: {{ld(.exe)?"}}
 // LINK_TVOS_ARM64: -tvos_version_min
@@ -166,19 +166,19 @@
 // LINK_TVOS_ARM64-NOT: lgcc_s.1
 // LINK_TVOS_ARM64: libclang_rt.tvos.a
 
-// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir  -### %t.o 2> %t.log
+// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=0 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir  -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_TVOS_PROFILE %s < %t.log
 // LINK_TVOS_PROFILE: {{ld(.exe)?"}}
 // LINK_TVOS_PROFILE: libclang_rt.profile_tvos.a
 // LINK_TVOS_PROFILE: libclang_rt.tvos.a
 
-// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
+// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=0 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_TVOS_KEXT %s < %t.log
 // LINK_TVOS_KEXT: {{ld(.exe)?"}}
 // LINK_TVOS_KEXT: libclang_rt.cc_kext_tvos.a
 // LINK_TVOS_KEXT: libclang_rt.tvos.a
 
-// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
+// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_WATCHOS_ARM %s < %t.log
 // LINK_WATCHOS_ARM: {{ld(.exe)?"}}
 // LINK_WATCHOS_ARM: -watchos_version_min
@@ -186,13 +186,13 @@
 // LINK_WATCHOS_ARM-NOT: lgcc_s.1
 // LINK_WATCHOS_ARM: libclang_rt.watchos.a
 
-// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log
+// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_WATCHOS_PROFILE %s < %t.log
 // LINK_WATCHOS_PROFILE: {{ld(.exe)?"}}
 // LINK_WATCHOS_PROFILE: libclang_rt.profile_watchos.a
 // LINK_WATCHOS_PROFILE: libclang_rt.watchos.a
 
-// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
+// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_WATCHOS_KEXT %s < %t.log
 // LINK_WATCHOS_KEXT: {{ld(.exe)?"}}
 // LINK_WATCHOS_KEXT: libclang_rt.cc_kext_watchos.a
@@ -251,30 +251,30 @@
 // IPHONEOS_DEPLOYMENT_TARGET variable is used instead of the command-line
 // deployment target options.
 // RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
-// RUN:   %clang -target arm64-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
+// RUN:   %clang -target arm64-apple-darwin -mlinker-version=0 -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_IPHONEOS_VERSION_MIN %s < %t.log
 // RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
-// RUN:   %clang -target i386-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
+// RUN:   %clang -target i386-apple-darwin -mlinker-version=0 -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
 // LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
 // LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min
 
 // Ditto for tvOS....
 // RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
-// RUN:   %clang -target armv7-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
+// RUN:   %clang -target armv7-apple-darwin -mlinker-version=0 -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_TVOS_VERSION_MIN %s < %t.log
 // RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
-// RUN:   %clang -target x86_64-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
+// RUN:   %clang -target x86_64-apple-darwin -mlinker-version=0 -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_TVOS_SIMULATOR_VERSION_MIN %s < %t.log
 // LINK_TVOS_VERSION_MIN: -tvos_version_min
 // LINK_TVOS_SIMULATOR_VERSION_MIN: -tvos_simulator_version_min
 
 // ...and for watchOS.
 // RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
-// RUN:   %clang -target armv7k-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
+// RUN:   %clang -target armv7k-apple-darwin -mlinker-version=0 -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_WATCHOS_VERSION_MIN %s < %t.log
 // RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
-// RUN:   %clang -target i386-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
+// RUN:   %clang -target i386-apple-darwin -mlinker-version=0 -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_WATCHOS_SIMULATOR_VERSION_MIN %s < %t.log
 // LINK_WATCHOS_VERSION_MIN: -watchos_version_min
 // LINK_WATCHOS_SIMULATOR_VERSION_MIN: -watchos_simulator_version_min
Index: clang/test/Driver/darwin-ld-platform-version-macos.c
===================================================================
--- clang/test/Driver/darwin-ld-platform-version-macos.c
+++ clang/test/Driver/darwin-ld-platform-version-macos.c
@@ -1,6 +1,6 @@
 // RUN: touch %t.o
 
-// RUN: %clang -target x86_64-apple-macos10.13 -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=0 -### %t.o 2>&1 \
+// RUN: %clang -target x86_64-apple-macos10.13 -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=520 -### %t.o 2>&1 \
 // RUN:   | FileCheck %s
 // RUN: env SDKROOT=%S/Inputs/MacOSX10.14.sdk %clang -target x86_64-apple-macos10.13.0.1 -mlinker-version=520 -### %t.o 2>&1 \
 // RUN:   | FileCheck %s
Index: clang/test/Driver/darwin-infer-simulator-sdkroot.c
===================================================================
--- clang/test/Driver/darwin-infer-simulator-sdkroot.c
+++ clang/test/Driver/darwin-infer-simulator-sdkroot.c
@@ -4,9 +4,9 @@
 //
 // RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
 // RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-IPHONE %s
-// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang %s -mlinker-version=400 -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang %s -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-IPHONE %s
 // CHECK-IPHONE: clang
 // CHECK-IPHONE: "-cc1"
@@ -17,7 +17,7 @@
 //
 // RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
 // RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang %s -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-SIMULATOR %s
 //
 // CHECK-SIMULATOR: clang
@@ -29,9 +29,9 @@
 //
 // RUN: rm -rf %t/SDKs/WatchOS3.0.sdk
 // RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk
-// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-WATCH %s
-// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=400 -### 2>&1 \
+// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-WATCH %s
 //
 // CHECK-WATCH: clang
@@ -43,7 +43,7 @@
 //
 // RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk
 // RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk
-// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s
 //
 // CHECK-WATCH-SIMULATOR: clang
@@ -55,7 +55,7 @@
 //
 // RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk
 // RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk
-// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-TV %s
 //
 // CHECK-TV: clang
@@ -67,7 +67,7 @@
 //
 // RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk
 // RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk
-// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -mlinker-version=0 -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s
 //
 // CHECK-TV-SIMULATOR: clang
Index: clang/lib/Driver/ToolChains/Darwin.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Darwin.cpp
+++ clang/lib/Driver/ToolChains/Darwin.cpp
@@ -335,7 +335,7 @@
   Args.AddAllArgs(CmdArgs, options::OPT_init);
 
   // Add the deployment target.
-  if (!Version[0] || Version[0] >= 520)
+  if (Version[0] >= 520)
     MachOTC.addPlatformVersionArgs(Args, CmdArgs);
   else
     MachOTC.addMinVersionArgs(Args, CmdArgs);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to