r321099 - [driver][darwin] Take the OS version specified in "-target" as the target

Alex L via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 21 11:11:31 PST 2017


Thanks for raising your concerns.

We decided to avoid -m<os>-version-min flag in favor of -target to simplify
the driver logic and to encourage the adoption of -target. Now after r321145
we only warn about -m<os>-version-min flag when the OS version specified in
it is different to the OS version specified in target, or when target has
no OS version.

There are two possible solutions here:
1) You can still use -target with -mios-simulator-version-min as before but
you'd have to use '-target=x86_64-apple-darwin' to ensure that the iOS
version specified by  '-mios-simulator-version-min' is used.
2) I also do have a patch that implements the logic that you propose (use
the OS version in -m<os>-version-min flag if target has none). If you
believe that the first solution is not suitable for your code then I can
commit it. At the same time I believe that we would rather not use this
patch, but if it's urgent for your projects then maybe I can land it now
and then we can establish some sort of timeline for when it can be reverted?

Thanks,
Alex


On 21 December 2017 at 08:00, James Y Knight <jyknight at google.com> wrote:

> I think if a version number isn't explicitly specified in the -target
> value, the value from -m<platform>-version-min ought to still be used, as
> it was before.
>
> Currently, clang will ignore the -m<platform>-version-min version number
> if the target has a particular OS specified, even if it has no version
> number as part of it.
>
> (We should be able to workaround this change backwards-compatibly by
> specifying in both the -target argument and in the -m<platform>-version-min
> arguments, but I do think the behavior should be fixed.)
>
> On Thu, Dec 21, 2017 at 10:45 AM, Martin Böhme <mboehme at google.com> wrote:
>
>> This is causing problems in some internal builds that specify both
>> -mios-simulator-version-min=9.0 and --target=x86_64-apple-ios
>>
>> My expectation would be for the code to take the minimum OS version
>> number from the -mios-simulator-version-min flag. In fact, however, the
>> code seems to be completely ignoring this flag.
>>
>> Is my expectation wrong or does the code need to be modified to take this
>> situation into account?
>>
>>
>> On 19 December 2017 at 20:05, Alex Lorenz via cfe-commits <
>> cfe-commits at lists.llvm.org> wrote:
>>
>>> Author: arphaman
>>> Date: Tue Dec 19 11:05:04 2017
>>> New Revision: 321099
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=321099&view=rev
>>> Log:
>>> [driver][darwin] Take the OS version specified in "-target" as the target
>>> OS instead of inferring it from SDK / environment
>>>
>>> The OS version is specified in -target should be used instead of the one
>>> in an
>>> environment variable / SDK name.
>>>
>>> rdar://35813850
>>>
>>> Differential Revision: https://reviews.llvm.org/D40998
>>>
>>> Modified:
>>>     cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
>>>     cfe/trunk/test/Driver/darwin-version.c
>>>     cfe/trunk/test/Driver/objc-weak.m
>>>     cfe/trunk/test/Driver/pic.c
>>>     cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
>>>
>>> Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
>>> lChains/Darwin.cpp?rev=321099&r1=321098&r2=321099&view=diff
>>> ============================================================
>>> ==================
>>> --- cfe/trunk/lib/Driver/ToolChains/Darwin.cpp (original)
>>> +++ cfe/trunk/lib/Driver/ToolChains/Darwin.cpp Tue Dec 19 11:05:04 2017
>>> @@ -1233,6 +1233,10 @@ struct DarwinPlatform {
>>>      llvm_unreachable("Unsupported Darwin Source Kind");
>>>    }
>>>
>>> +  static DarwinPlatform createFromTarget(llvm::Triple::OSType OS,
>>> +                                         StringRef OSVersion, Arg *A) {
>>> +    return DarwinPlatform(TargetArg, getPlatformFromOS(OS), OSVersion,
>>> A);
>>> +  }
>>>    static DarwinPlatform createOSVersionArg(DarwinPlatformKind Platform,
>>>                                             Arg *A) {
>>>      return DarwinPlatform(OSVersionArg, Platform, A);
>>> @@ -1250,33 +1254,32 @@ struct DarwinPlatform {
>>>    }
>>>    static DarwinPlatform createFromArch(llvm::Triple::OSType OS,
>>>                                         StringRef Value) {
>>> -    DarwinPlatformKind Platform;
>>> +    return DarwinPlatform(InferredFromArch, getPlatformFromOS(OS),
>>> Value);
>>> +  }
>>> +
>>> +private:
>>> +  DarwinPlatform(SourceKind Kind, DarwinPlatformKind Platform, Arg
>>> *Argument)
>>> +      : Kind(Kind), Platform(Platform), Argument(Argument) {}
>>> +  DarwinPlatform(SourceKind Kind, DarwinPlatformKind Platform,
>>> StringRef Value,
>>> +                 Arg *Argument = nullptr)
>>> +      : Kind(Kind), Platform(Platform), OSVersion(Value),
>>> Argument(Argument) {}
>>> +
>>> +  static DarwinPlatformKind getPlatformFromOS(llvm::Triple::OSType OS)
>>> {
>>>      switch (OS) {
>>>      case llvm::Triple::Darwin:
>>>      case llvm::Triple::MacOSX:
>>> -      Platform = DarwinPlatformKind::MacOS;
>>> -      break;
>>> +      return DarwinPlatformKind::MacOS;
>>>      case llvm::Triple::IOS:
>>> -      Platform = DarwinPlatformKind::IPhoneOS;
>>> -      break;
>>> +      return DarwinPlatformKind::IPhoneOS;
>>>      case llvm::Triple::TvOS:
>>> -      Platform = DarwinPlatformKind::TvOS;
>>> -      break;
>>> +      return DarwinPlatformKind::TvOS;
>>>      case llvm::Triple::WatchOS:
>>> -      Platform = DarwinPlatformKind::WatchOS;
>>> -      break;
>>> +      return DarwinPlatformKind::WatchOS;
>>>      default:
>>>        llvm_unreachable("Unable to infer Darwin variant");
>>>      }
>>> -    return DarwinPlatform(InferredFromArch, Platform, Value);
>>>    }
>>>
>>> -private:
>>> -  DarwinPlatform(SourceKind Kind, DarwinPlatformKind Platform, Arg
>>> *Argument)
>>> -      : Kind(Kind), Platform(Platform), Argument(Argument) {}
>>> -  DarwinPlatform(SourceKind Kind, DarwinPlatformKind Platform,
>>> StringRef Value)
>>> -      : Kind(Kind), Platform(Platform), OSVersion(Value),
>>> Argument(nullptr) {}
>>> -
>>>    SourceKind Kind;
>>>    DarwinPlatformKind Platform;
>>>    std::string OSVersion;
>>> @@ -1449,20 +1452,15 @@ inferDeploymentTargetFromArch(DerivedArg
>>>                                const Driver &TheDriver) {
>>>    llvm::Triple::OSType OSTy = llvm::Triple::UnknownOS;
>>>
>>> -  // Set the OSTy based on -target if -arch isn't present.
>>> -  if (Args.hasArg(options::OPT_target) &&
>>> !Args.hasArg(options::OPT_arch)) {
>>> -    OSTy = Triple.getOS();
>>> -  } else {
>>> -    StringRef MachOArchName = Toolchain.getMachOArchName(Args);
>>> -    if (MachOArchName == "armv7" || MachOArchName == "armv7s" ||
>>> -        MachOArchName == "arm64")
>>> -      OSTy = llvm::Triple::IOS;
>>> -    else if (MachOArchName == "armv7k")
>>> -      OSTy = llvm::Triple::WatchOS;
>>> -    else if (MachOArchName != "armv6m" && MachOArchName != "armv7m" &&
>>> -             MachOArchName != "armv7em")
>>> -      OSTy = llvm::Triple::MacOSX;
>>> -  }
>>> +  StringRef MachOArchName = Toolchain.getMachOArchName(Args);
>>> +  if (MachOArchName == "armv7" || MachOArchName == "armv7s" ||
>>> +      MachOArchName == "arm64")
>>> +    OSTy = llvm::Triple::IOS;
>>> +  else if (MachOArchName == "armv7k")
>>> +    OSTy = llvm::Triple::WatchOS;
>>> +  else if (MachOArchName != "armv6m" && MachOArchName != "armv7m" &&
>>> +           MachOArchName != "armv7em")
>>> +    OSTy = llvm::Triple::MacOSX;
>>>
>>>    if (OSTy == llvm::Triple::UnknownOS)
>>>      return None;
>>> @@ -1470,6 +1468,19 @@ inferDeploymentTargetFromArch(DerivedArg
>>>                                          getOSVersion(OSTy, Triple,
>>> TheDriver));
>>>  }
>>>
>>> +/// Returns the deployment target that's specified using the -target
>>> option.
>>> +Optional<DarwinPlatform> getDeploymentTargetFromTargetArg(
>>> +    DerivedArgList &Args, const llvm::Triple &Triple, const Driver
>>> &TheDriver) {
>>> +  if (!Args.hasArg(options::OPT_target))
>>> +    return None;
>>> +  if (Triple.getOS() == llvm::Triple::Darwin ||
>>> +      Triple.getOS() == llvm::Triple::UnknownOS)
>>> +    return None;
>>> +  std::string OSVersion = getOSVersion(Triple.getOS(), Triple,
>>> TheDriver);
>>> +  return DarwinPlatform::createFromTarget(Triple.getOS(), OSVersion,
>>> +                                          Args.getLastArg(options::OPT_t
>>> arget));
>>> +}
>>> +
>>>  } // namespace
>>>
>>>  void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
>>> @@ -1494,24 +1505,35 @@ void Darwin::AddDeploymentTarget(Derived
>>>      }
>>>    }
>>>
>>> -  // The OS target can be specified using the -m<os>version-min
>>> argument.
>>> +  // The OS and the version can be specified using the -target argument.
>>>    Optional<DarwinPlatform> OSTarget =
>>> -      getDeploymentTargetFromOSVersionArg(Args, getDriver());
>>> -  // If no deployment target was specified on the command line, check
>>> for
>>> -  // environment defines.
>>> -  if (!OSTarget)
>>> -    OSTarget =
>>> -        getDeploymentTargetFromEnvironmentVariables(getDriver(),
>>> getTriple());
>>> -  // If there is no command-line argument to specify the Target version
>>> and
>>> -  // no environment variable defined, see if we can set the default
>>> based
>>> -  // on -isysroot.
>>> -  if (!OSTarget)
>>> -    OSTarget = inferDeploymentTargetFromSDK(Args);
>>> -  // If no OS targets have been specified, try to guess platform from
>>> -target
>>> -  // or arch name and compute the version from the triple.
>>> -  if (!OSTarget)
>>> -    OSTarget =
>>> -        inferDeploymentTargetFromArch(Args, *this, getTriple(),
>>> getDriver());
>>> +      getDeploymentTargetFromTargetArg(Args, getTriple(), getDriver());
>>> +  if (OSTarget) {
>>> +    // Warn about superfluous -m<os>-version-min arg.
>>> +    Optional<DarwinPlatform> OSVersionArgTarget =
>>> +        getDeploymentTargetFromOSVersionArg(Args, getDriver());
>>> +    if (OSVersionArgTarget)
>>> +      getDriver().Diag(clang::diag::warn_drv_unused_argument)
>>> +          << OSVersionArgTarget->getAsString(Args, Opts);
>>> +  } else {
>>> +    // The OS target can be specified using the -m<os>version-min
>>> argument.
>>> +    OSTarget = getDeploymentTargetFromOSVersionArg(Args, getDriver());
>>> +    // If no deployment target was specified on the command line, check
>>> for
>>> +    // environment defines.
>>> +    if (!OSTarget)
>>> +      OSTarget =
>>> +          getDeploymentTargetFromEnvironmentVariables(getDriver(),
>>> getTriple());
>>> +    // If there is no command-line argument to specify the Target
>>> version and
>>> +    // no environment variable defined, see if we can set the default
>>> based
>>> +    // on -isysroot.
>>> +    if (!OSTarget)
>>> +      OSTarget = inferDeploymentTargetFromSDK(Args);
>>> +    // If no OS targets have been specified, try to guess platform from
>>> -target
>>> +    // or arch name and compute the version from the triple.
>>> +    if (!OSTarget)
>>> +      OSTarget =
>>> +          inferDeploymentTargetFromArch(Args, *this, getTriple(),
>>> getDriver());
>>> +  }
>>>
>>>    assert(OSTarget && "Unable to infer Darwin variant");
>>>    OSTarget->addOSVersionMinArgument(Args, Opts);
>>>
>>> Modified: cfe/trunk/test/Driver/darwin-version.c
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/da
>>> rwin-version.c?rev=321099&r1=321098&r2=321099&view=diff
>>> ============================================================
>>> ==================
>>> --- cfe/trunk/test/Driver/darwin-version.c (original)
>>> +++ cfe/trunk/test/Driver/darwin-version.c Tue Dec 19 11:05:04 2017
>>> @@ -12,11 +12,15 @@
>>>  // CHECK-VERSION-IOS3: "armv6k-apple-ios3.0.0"
>>>
>>>  // RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \
>>> -// RUN:   %clang -target armv7-apple-ios9.0 -c -### %s 2> %t.err
>>> +// RUN:   %clang -target armv7-apple-darwin -c -### %s 2> %t.err
>>>  // RUN:   FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS4
>>> %s
>>>  // CHECK-VERSION-IOS4: invalid iOS deployment version
>>> 'IPHONEOS_DEPLOYMENT_TARGET=11.0'
>>>
>>> -// RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0
>>> -c -### %s 2> %t.err
>>> +// RUN: %clang -target armv7-apple-ios11.0 -c -### %s 2> %t.err
>>> +// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS41
>>> %s
>>> +// CHECK-VERSION-IOS41: invalid iOS deployment version
>>> '--target=armv7-apple-ios11.0'
>>> +
>>> +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=11.0
>>> -c -### %s 2> %t.err
>>>  // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS5
>>> %s
>>>  // CHECK-VERSION-IOS5: invalid iOS deployment version
>>> '-miphoneos-version-min=11.0'
>>>
>>> @@ -25,13 +29,14 @@
>>>  // CHECK-VERSION-IOS6: invalid iOS deployment version
>>> '-mios-simulator-version-min=11.0'
>>>
>>>  // RUN: %clang -target armv7-apple-ios11.1 -c -### %s 2>&1 | \
>>> -// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS7 %s
>>> -// RUN: %clang -target armv7-apple-ios9 -Wno-missing-sysroot -isysroot
>>> SDKs/iPhoneOS11.0.sdk -c -### %s 2>&1 | \
>>> +// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS71 %s
>>> +// CHECK-VERSION-IOS71: invalid iOS deployment version
>>> +// RUN: %clang -target armv7-apple-darwin -Wno-missing-sysroot
>>> -isysroot SDKs/iPhoneOS11.0.sdk -c -### %s 2>&1 | \
>>>  // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS7 %s
>>>  // CHECK-VERSION-IOS7: thumbv7-apple-ios10.99.99
>>>
>>>  // RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \
>>> -// RUN:   %clang -target arm64-apple-ios11.0 -c -### %s 2>&1 | \
>>> +// RUN:   %clang -target arm64-apple-darwin -c -### %s 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-IOS8 %s
>>>  // CHECK-VERSION-IOS8: arm64-apple-ios11.0.0
>>>
>>> @@ -49,7 +54,7 @@
>>>
>>>  // RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0
>>> -c -Wno-invalid-ios-deployment-target -### %s 2>&1 | \
>>>  // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS12 %s
>>> -// CHECK-VERSION-IOS12: thumbv7-apple-ios11.0.0
>>> +// CHECK-VERSION-IOS12: thumbv7-apple-ios9.0.0
>>>
>>>  // RUN: %clang -target i686-apple-darwin8 -c %s -### 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX4 %s
>>> @@ -68,14 +73,14 @@
>>>  // CHECK-VERSION-OSX6: "i386-apple-macosx10.6.0"
>>>  // RUN: %clang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.10
>>> -c %s -### 2>&1 | \
>>> +// RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min=10.10
>>> -c %s -### 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacos-version-min=10.10 -c
>>> %s -### 2>&1 | \
>>> +// RUN: %clang -target x86_64-apple-darwin -mmacos-version-min=10.10 -c
>>> %s -### 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
>>>  // CHECK-VERSION-OSX10: "x86_64-apple-macosx10.10.0"
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min= -c %s
>>> -### 2>&1 | \
>>> +// RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min= -c %s
>>> -### 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-MISSING %s
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacos-version-min= -c %s
>>> -### 2>&1 | \
>>> +// RUN: %clang -target x86_64-apple-darwin -mmacos-version-min= -c %s
>>> -### 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-MISSING %s
>>>  // CHECK-VERSION-MISSING: invalid version number
>>>  // RUN: %clang -target armv7k-apple-darwin -mwatchos-version-min=2.0 -c
>>> %s -### 2>&1 | \
>>> @@ -144,3 +149,116 @@
>>>  // RUN:   %clang -target x86_64-apple-darwin -c %s -### 2>&1 | \
>>>  // RUN:   FileCheck --check-prefix=CHECK-VERSION-INVALID-ENV %s
>>>  // CHECK-VERSION-INVALID-ENV: invalid version number in
>>> 'MACOSX_DEPLOYMENT_TARGET=1000.1000'
>>> +
>>> +
>>> +
>>> +// Target can specify the OS version:
>>> +
>>> +// RUN: %clang -target x86_64-apple-macos10.11.2 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TMAC2 %s
>>> +// CHECK-VERSION-TMAC2: "x86_64-apple-macosx10.11.2"
>>> +
>>> +// RUN: %clang -target arm64-apple-ios11.1 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TIOS1 %s
>>> +// CHECK-VERSION-TIOS1: "arm64-apple-ios11.1.0"
>>> +
>>> +// RUN: %clang -target arm64-apple-tvos10.3 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TTVOS1 %s
>>> +// CHECK-VERSION-TTVOS1: "arm64-apple-tvos10.3.0"
>>> +
>>> +// RUN: %clang -target armv7k-apple-watchos4.1 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TWATCHOS1 %s
>>> +// CHECK-VERSION-TWATCHOS1: "thumbv7k-apple-watchos4.1.0"
>>> +
>>> +// "darwin" always back to the -m<os>version-min and environment:
>>> +
>>> +// RUN: %clang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL1 %s
>>> +// CHECK-VERSION-TDARWIN-FALL1: "x86_64-apple-macosx10.10.0"
>>> +
>>> +// RUN: %clang -target x86_64-apple-darwin14
>>> -miphoneos-version-min=10.1 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL2 %s
>>> +// CHECK-VERSION-TDARWIN-FALL2: "x86_64-apple-ios10.1.0-simulator"
>>> +
>>> +// RUN: env IPHONEOS_DEPLOYMENT_TARGET=9.1 \
>>> +// RUN:   %clang -target arm64-apple-darwin14 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL3 %s
>>> +// CHECK-VERSION-TDARWIN-FALL3: "arm64-apple-ios9.1.0"
>>> +
>>> +// RUN: %clang -target arm64-apple-darwin14 -isysroot
>>> SDKs/iPhoneOS11.0.sdk -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL4 %s
>>> +// CHECK-VERSION-TDARWIN-FALL4: "arm64-apple-ios11.0.0"
>>> +
>>> +// RUN: %clang -target unknown-apple-darwin12  -arch armv7  -c %s -###
>>> 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL5 %s
>>> +// CHECK-VERSION-TDARWIN-FALL5: "thumbv7-apple-ios5.0.0"
>>> +
>>> +// Warn about -m<os>-version-min when it's used with target:
>>> +
>>> +// RUN: %clang -target x86_64-apple-macos10.11.2
>>> -mmacos-version-min=10.6 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TNO-OSV1 %s
>>> +// CHECK-VERSION-TNO-OSV1: argument unused during compilation:
>>> '-mmacosx-version-min=10.6'
>>> +
>>> +// RUN: %clang -target x86_64-apple-macos -miphoneos-version-min=9.1 -c
>>> %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TNO-OSV2 %s
>>> +// CHECK-VERSION-TNO-OSV2: argument unused during compilation:
>>> '-miphoneos-version-min=9.1'
>>> +
>>> +// Target with OS version is not overriden by -m<os>-version-min
>>> variables:
>>> +
>>> +// RUN: %clang -target x86_64-apple-macos10.11.2
>>> -mmacos-version-min=10.6 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV1 %s
>>> +// CHECK-VERSION-TIGNORE-OSV1: "x86_64-apple-macosx10.11.2"
>>> +
>>> +// RUN: %clang -target arm64-apple-ios11.0 -mios-version-min=9.0 -c %s
>>> -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV2 %s
>>> +// CHECK-VERSION-TIGNORE-OSV2: "arm64-apple-ios11.0.0"
>>> +
>>> +// RUN: %clang -target arm64-apple-tvos11.0 -mtvos-version-min=9.0 -c
>>> %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV3 %s
>>> +// CHECK-VERSION-TIGNORE-OSV3: "arm64-apple-tvos11.0.0"
>>> +
>>> +// RUN: %clang -target armv7k-apple-watchos3 -mwatchos-version-min=4 -c
>>> %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV4 %s
>>> +// CHECK-VERSION-TIGNORE-OSV4: "thumbv7k-apple-watchos3.0.0"
>>> +
>>> +// Target with OS version is not overriden by environment variables:
>>> +
>>> +// RUN: env MACOSX_DEPLOYMENT_TARGET=10.1 \
>>> +// RUN:   %clang -target i386-apple-macos10.5 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TMACOS-CMD %s
>>> +// CHECK-VERSION-TMACOS-CMD: "i386-apple-macosx10.5.0"
>>> +
>>> +// RUN: env IPHONEOS_DEPLOYMENT_TARGET=10.1 \
>>> +// RUN:   %clang -target arm64-apple-ios11 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TIOS-CMD %s
>>> +// CHECK-VERSION-TIOS-CMD: "arm64-apple-ios11.0.0"
>>> +
>>> +// RUN: env TVOS_DEPLOYMENT_TARGET=8.3.1 \
>>> +// RUN:   %clang -target arm64-apple-tvos9 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TTVOS-CMD %s
>>> +// CHECK-VERSION-TTVOS-CMD: "arm64-apple-tvos9.0.0"
>>> +
>>> +// RUN: env WATCHOS_DEPLOYMENT_TARGET=2 \
>>> +// RUN:   %clang -target armv7k-apple-watchos3 -c %s -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TWATCHOS-CMD %s
>>> +// CHECK-VERSION-TWATCHOS-CMD: "thumbv7k-apple-watchos3.0.0"
>>> +
>>> +// Target with OS version is not overriden by the SDK:
>>> +
>>> +// RUN: %clang -target armv7-apple-ios9 -Wno-missing-sysroot -isysroot
>>> SDKs/iPhoneOS11.0.sdk -c -### %s 2>&1 | \
>>> +// RUN: FileCheck --check-prefix=CHECK-VERSION-TIOS-SDK %s
>>> +// CHECK-VERSION-TIOS-SDK: thumbv7-apple-ios9
>>> +
>>> +// RUN: %clang -target armv7k-apple-watchos4 -Wno-missing-sysroot
>>> -isysroot SDKs/WatchOS3.0.sdk -c -### %s 2>&1 | \
>>> +// RUN: FileCheck --check-prefix=CHECK-VERSION-TWATCHOS-SDK %s
>>> +// CHECK-VERSION-TWATCHOS-SDK: thumbv7k-apple-watchos4
>>> +
>>> +// RUN: %clang -target armv7-apple-tvos9 -Wno-missing-sysroot -isysroot
>>> SDKs/AppleTVOS11.0.sdk -c -### %s 2>&1 | \
>>> +// RUN: FileCheck --check-prefix=CHECK-VERSION-TTVOS-SDK %s
>>> +// CHECK-VERSION-TTVOS-SDK: thumbv7-apple-tvos9
>>> +
>>> +// Target with OS version is not overriden by arch:
>>> +
>>> +// RUN: %clang -target uknown-apple-macos10.11.2 -arch=armv7k -c %s
>>> -### 2>&1 | \
>>> +// RUN:   FileCheck --check-prefix=CHECK-VERSION-TIGNORE-ARCH1 %s
>>> +// CHECK-VERSION-TIGNORE-ARCH1: "unknown-apple-macosx10.11.2"
>>>
>>> Modified: cfe/trunk/test/Driver/objc-weak.m
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ob
>>> jc-weak.m?rev=321099&r1=321098&r2=321099&view=diff
>>> ============================================================
>>> ==================
>>> --- cfe/trunk/test/Driver/objc-weak.m (original)
>>> +++ cfe/trunk/test/Driver/objc-weak.m Tue Dec 19 11:05:04 2017
>>> @@ -1,27 +1,27 @@
>>>  // Check miscellaneous Objective-C options.
>>>
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fobjc-arc -fobjc-weak 2>&1 | FileCheck %s --check-prefix ARC-WEAK
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fno-objc-weak -fobjc-weak -fobjc-arc  2>&1 | FileCheck %s
>>> --check-prefix ARC-WEAK
>>> +// RUN: %clang -target x86_64-apple-macosx10.7 -S -### %s -fobjc-arc
>>> -fobjc-weak 2>&1 | FileCheck %s --check-prefix ARC-WEAK
>>> +// RUN: %clang -target x86_64-apple-macosx10.7 -S -### %s
>>> -fno-objc-weak -fobjc-weak -fobjc-arc  2>&1 | FileCheck %s --check-prefix
>>> ARC-WEAK
>>>  // ARC-WEAK: -fobjc-arc
>>>  // ARC-WEAK: -fobjc-weak
>>>
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fobjc-arc -fno-objc-weak 2>&1 | FileCheck %s --check-prefix
>>> ARC-NO-WEAK
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fobjc-weak -fno-objc-weak -fobjc-arc  2>&1 | FileCheck %s
>>> --check-prefix ARC-NO-WEAK
>>> +// RUN: %clang -target x86_64-apple-macos10.7 -S -### %s -fobjc-arc
>>> -fno-objc-weak 2>&1 | FileCheck %s --check-prefix ARC-NO-WEAK
>>> +// RUN: %clang -target x86_64-apple-macos10.7 -S -### %s -fobjc-weak
>>> -fno-objc-weak -fobjc-arc  2>&1 | FileCheck %s --check-prefix ARC-NO-WEAK
>>>  // ARC-NO-WEAK: -fobjc-arc
>>>  // ARC-NO-WEAK: -fno-objc-weak
>>>
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.5 -S
>>> -### %s -fobjc-arc -fobjc-weak 2>&1 | FileCheck %s --check-prefix
>>> ARC-WEAK-NOTSUPPORTED
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.5 -S
>>> -### %s -fno-objc-weak -fobjc-weak -fobjc-arc  2>&1 | FileCheck %s
>>> --check-prefix ARC-WEAK-NOTSUPPORTED
>>> +// RUN: %clang -target x86_64-apple-macosx10.5 -S -### %s -fobjc-arc
>>> -fobjc-weak 2>&1 | FileCheck %s --check-prefix ARC-WEAK-NOTSUPPORTED
>>> +// RUN: %clang -target x86_64-apple-macosx10.5 -S -### %s
>>> -fno-objc-weak -fobjc-weak -fobjc-arc  2>&1 | FileCheck %s --check-prefix
>>> ARC-WEAK-NOTSUPPORTED
>>>  // ARC-WEAK-NOTSUPPORTED: error: -fobjc-weak is not supported on the
>>> current deployment target
>>>
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fobjc-weak 2>&1 | FileCheck %s --check-prefix MRC-WEAK
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fno-objc-weak -fobjc-weak 2>&1 | FileCheck %s --check-prefix
>>> MRC-WEAK
>>> +// RUN: %clang -target x86_64-apple-macos10.7 -S -### %s -fobjc-weak
>>> 2>&1 | FileCheck %s --check-prefix MRC-WEAK
>>> +// RUN: %clang -target x86_64-apple-macos10.7 -S -### %s -fno-objc-weak
>>> -fobjc-weak 2>&1 | FileCheck %s --check-prefix MRC-WEAK
>>>  // MRC-WEAK: -fobjc-weak
>>>
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fno-objc-weak 2>&1 | FileCheck %s --check-prefix MRC-NO-WEAK
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.7 -S
>>> -### %s -fobjc-weak -fno-objc-weak 2>&1 | FileCheck %s --check-prefix
>>> MRC-NO-WEAK
>>> +// RUN: %clang -target x86_64-apple-macosx10.7 -S -### %s
>>> -fno-objc-weak 2>&1 | FileCheck %s --check-prefix MRC-NO-WEAK
>>> +// RUN: %clang -target x86_64-apple-macosx10.7 -S -### %s -fobjc-weak
>>> -fno-objc-weak 2>&1 | FileCheck %s --check-prefix MRC-NO-WEAK
>>>  // MRC-NO-WEAK: -fno-objc-weak
>>>
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.5 -S
>>> -### %s -fobjc-weak 2>&1 | FileCheck %s --check-prefix MRC-WEAK-NOTSUPPORTED
>>> -// RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.5 -S
>>> -### %s -fno-objc-weak -fobjc-weak 2>&1 | FileCheck %s --check-prefix
>>> MRC-WEAK-NOTSUPPORTED
>>> +// RUN: %clang -target x86_64-apple-macosx10.5 -S -### %s -fobjc-weak
>>> 2>&1 | FileCheck %s --check-prefix MRC-WEAK-NOTSUPPORTED
>>> +// RUN: %clang -target x86_64-apple-macosx10.5 -S -### %s
>>> -fno-objc-weak -fobjc-weak 2>&1 | FileCheck %s --check-prefix
>>> MRC-WEAK-NOTSUPPORTED
>>>  // MRC-WEAK-NOTSUPPORTED: error: -fobjc-weak is not supported on the
>>> current deployment target
>>>
>>> Modified: cfe/trunk/test/Driver/pic.c
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/pi
>>> c.c?rev=321099&r1=321098&r2=321099&view=diff
>>> ============================================================
>>> ==================
>>> --- cfe/trunk/test/Driver/pic.c (original)
>>> +++ cfe/trunk/test/Driver/pic.c Tue Dec 19 11:05:04 2017
>>> @@ -221,19 +221,19 @@
>>>  //
>>>  // Checks for ARM+Apple+IOS including -fapple-kext, -mkernel, and
>>> iphoneos
>>>  // version boundaries.
>>> -// RUN: %clang -c %s -target armv7-apple-ios -fapple-kext
>>> -miphoneos-version-min=6.0.0 -### 2>&1 \
>>> +// RUN: %clang -c %s -target armv7-apple-ios6 -fapple-kext -### 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
>>> -// RUN: %clang -c %s -target armv7-apple-ios -mkernel
>>> -miphoneos-version-min=6.0.0 -### 2>&1 \
>>> +// RUN: %clang -c %s -target armv7-apple-ios6 -mkernel -### 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
>>> -// RUN: %clang -c %s -target arm64-apple-ios -mkernel
>>> -miphoneos-version-min=7.0.0 -### 2>&1 \
>>> +// RUN: %clang -c %s -target arm64-apple-ios7 -mkernel -### 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
>>> -// RUN: %clang -x assembler -c %s -target arm64-apple-ios -mkernel
>>> -miphoneos-version-min=7.0.0 -no-integrated-as -### 2>&1 \
>>> +// RUN: %clang -x assembler -c %s -target arm64-apple-ios7 -mkernel
>>> -no-integrated-as -### 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-NO-STATIC
>>> -// RUN: %clang -c %s -target armv7k-apple-watchos -fapple-kext
>>> -mwatchos-version-min=1.0.0 -### 2>&1 \
>>> +// RUN: %clang -c %s -target armv7k-apple-watchos1 -fapple-kext -###
>>> 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
>>> -// RUN: %clang -c %s -target armv7-apple-ios -fapple-kext
>>> -miphoneos-version-min=5.0.0 -### 2>&1 \
>>> +// RUN: %clang -c %s -target armv7-apple-ios5 -fapple-kext -### 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC
>>> -// RUN: %clang -c %s -target armv7-apple-ios -fapple-kext
>>> -miphoneos-version-min=6.0.0 -static -### 2>&1 \
>>> +// RUN: %clang -c %s -target armv7-apple-ios6 -fapple-kext -static -###
>>> 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC
>>>  // RUN: %clang -c %s -target armv7-apple-unknown-macho -static -###
>>> 2>&1 \
>>>  // RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC
>>>
>>> Modified: cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/un
>>> available_aligned_allocation.cpp?rev=321099&r1=321098&r2=321
>>> 099&view=diff
>>> ============================================================
>>> ==================
>>> --- cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp (original)
>>> +++ cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp Tue Dec 19
>>> 11:05:04 2017
>>> @@ -10,15 +10,15 @@
>>>  // RUN: %clang -target thumbv7-apple-watchos3 -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
>>>  //
>>> -// RUN: %clang -target x86_64-apple-macosx10.13
>>> -mios-simulator-version-min=10 \
>>> +// RUN: %clang -target x86_64-apple-darwin
>>> -mios-simulator-version-min=10 \
>>>  // RUN:  -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
>>>  //
>>> -// RUN: %clang -target x86_64-apple-macosx10.13
>>> -mtvos-simulator-version-min=10 \
>>> +// RUN: %clang -target x86_64-apple-darwin
>>> -mtvos-simulator-version-min=10 \
>>>  // RUN: -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
>>>  //
>>> -// RUN: %clang -target x86_64-apple-macosx10.13
>>> -mwatchos-simulator-version-min=3 \
>>> +// RUN: %clang -target x86_64-apple-darwin
>>> -mwatchos-simulator-version-min=3 \
>>>  // RUN: -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=UNAVAILABLE
>>>  //
>>> @@ -39,15 +39,15 @@
>>>  // RUN: %clang -target x86_64-unknown-linux-gnu -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=AVAILABLE
>>>  //
>>> -// RUN: %clang -target x86_64-apple-macosx10.12
>>> -mios-simulator-version-min=11 \
>>> +// RUN: %clang -target x86_64-apple-darwin
>>> -mios-simulator-version-min=11 \
>>>  // RUN:  -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=AVAILABLE
>>>  //
>>> -// RUN: %clang -target x86_64-apple-macosx10.12
>>> -mtvos-simulator-version-min=11 \
>>> +// RUN: %clang -target x86_64-apple-darwin
>>> -mtvos-simulator-version-min=11 \
>>>  // RUN: -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=AVAILABLE
>>>  //
>>> -// RUN: %clang -target x86_64-apple-macosx10.12
>>> -mwatchos-simulator-version-min=4 \
>>> +// RUN: %clang -target x86_64-apple-darwin
>>> -mwatchos-simulator-version-min=4 \
>>>  // RUN: -c -### %s 2>&1 \
>>>  // RUN:   | FileCheck %s -check-prefix=AVAILABLE
>>>  //
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>>
>>
>>
>>
>> --
>>
>> Martin Böhme
>>
>> Software Engineer
>>
>> mboehme at google.com
>>
>> Google Germany GmbH
>> Erika-Mann-Straße 33
>> <https://maps.google.com/?q=Erika-Mann-Stra%C3%9Fe+33&entry=gmail&source=g>
>> 80363 München
>>
>> Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
>>
>> Registergericht und -nummer: Hamburg, HRB 86891
>>
>> Sitz der Gesellschaft: Hamburg
>>
>> Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind,
>> leiten Sie diese bitte nicht weiter, informieren Sie den Absender und
>> löschen Sie die E-Mail und alle Anhänge. Vielen Dank.
>>
>>
>>
>> This e-mail is confidential. If you are not the right addressee please do
>> not forward it, please inform the sender, and please erase this e-mail
>> including any attachments. Thanks.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171221/4ea0504b/attachment-0001.html>


More information about the cfe-commits mailing list