From 38cda981a28db61ca1c9c262d7c1bfb2205099c9 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Mon, 17 Dec 2018 21:01:04 +0000 Subject: [PATCH] Make test/Driver/darwin-sdk-version.c pass on hosts < macOS10.14 The test test/Driver/darwin-sdk-version.c from r349380 checks if the macOS deployment target can be correctly inferred from the SDK version. When the SDK version is > host version, the driver will pick the host version, so the old test failed on macOS < 10.14. This commit makes this test more resilient by using an older SDK version. llvm-svn: 349393 --- clang/test/Driver/darwin-sdk-version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/test/Driver/darwin-sdk-version.c b/clang/test/Driver/darwin-sdk-version.c index a80ed39..89f587e 100644 --- a/clang/test/Driver/darwin-sdk-version.c +++ b/clang/test/Driver/darwin-sdk-version.c @@ -7,7 +7,7 @@ // RUN: mkdir -p %t/SDKs/MacOSX10.10.sdk // RUN: %clang -isysroot %t/SDKs/MacOSX10.10.sdk -c -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=INFER_SDK_VERSION %s -// RUN: cp %S/Inputs/MacOSX10.14.sdk/SDKSettings.json %t/SDKs/MacOSX10.10.sdk +// RUN: sed -e 's/10\.14/10\.8/g' %S/Inputs/MacOSX10.14.sdk/SDKSettings.json > %t/SDKs/MacOSX10.10.sdk/SDKSettings.json // RUN: %clang -isysroot %t/SDKs/MacOSX10.10.sdk -c -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=INFER_DEPLOYMENT_TARGET_VERSION %s // REQUIRES: system-darwin && native @@ -32,6 +32,6 @@ // CHECK: -target-sdk-version=10.14 // INFER_SDK_VERSION: "-triple" "x86_64-apple-macosx10.10.0" // INFER_SDK_VERSION-SAME: -target-sdk-version=10.10 -// INFER_DEPLOYMENT_TARGET_VERSION: "-triple" "x86_64-apple-macosx10.14.0" +// INFER_DEPLOYMENT_TARGET_VERSION: "-triple" "x86_64-apple-macosx10.8.0" // NO_VERSION-NOT: target-sdk-version // ERROR: warning: SDK settings were ignored as 'SDKSettings.json' could not be parsed -- 2.7.4