forked from OSchip/llvm-project
[clang][driver][darwin] support -target with Mac Catalyst triple without OS version
Some users might omit the version and assume the compiler will target the initial Mac Catalyst version.
This commit is contained in:
parent
6e04ec801b
commit
3d0d7d8c5b
|
@ -1820,6 +1820,11 @@ std::string getOSVersion(llvm::Triple::OSType OS, const llvm::Triple &Triple,
|
|||
<< Triple.getOSName();
|
||||
break;
|
||||
case llvm::Triple::IOS:
|
||||
if (Triple.isMacCatalystEnvironment() && !Triple.getOSMajorVersion()) {
|
||||
Major = 13;
|
||||
Minor = 1;
|
||||
Micro = 0;
|
||||
} else
|
||||
Triple.getiOSVersion(Major, Minor, Micro);
|
||||
break;
|
||||
case llvm::Triple::TvOS:
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
// RUN: %clang -target x86_64-apple-ios13.1-macabi -c %s -### 2>&1 | \
|
||||
// RUN: FileCheck --check-prefix=CHECK-VERSION1 %s
|
||||
// RUN: %clang -target x86_64-apple-ios-macabi -c %s -### 2>&1 | \
|
||||
// RUN: FileCheck --check-prefix=CHECK-VERSION1 %s
|
||||
// RUN: %clang -target x86_64-apple-ios13.0-macabi -c %s -### 2>&1 | \
|
||||
// RUN: FileCheck --check-prefix=CHECK-ERROR %s
|
||||
// RUN: %clang -target x86_64-apple-ios12.0-macabi -c %s -### 2>&1 | \
|
||||
// RUN: FileCheck --check-prefix=CHECK-ERROR %s
|
||||
|
||||
// CHECK-VERSION1-NOT: error:
|
||||
// CHECK-VERSION1: "x86_64-apple-ios13.1.0-macabi"
|
||||
// CHECK-ERROR: error: invalid version number in '-target x86_64-apple-ios
|
||||
|
|
Loading…
Reference in New Issue