Builder.defineMacro("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", Str);
}
- // Tell users about the kernel if there is one.
- if (Triple.isOSDarwin())
+ if (Triple.isOSDarwin()) {
+ // Any darwin OS defines a general darwin OS version macro in addition
+ // to the other OS specific macros.
+ assert(OsVersion.getMinor().value_or(0) < 100 &&
+ OsVersion.getSubminor().value_or(0) < 100 && "Invalid version!");
+ Builder.defineMacro("__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__", Str);
+
+ // Tell users about the kernel if there is one.
Builder.defineMacro("__MACH__");
+ }
PlatformMinVersion = OsVersion;
}
// RUN: %clang_cc1 -triple arm64-apple-ios99.99.99 -dM -E %s | FileCheck --check-prefix=IOS99 %s
// IOS99: __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ 999999
+// IOS99-NEXT: __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ 999999
// RUN: %clang_cc1 -triple arm64-apple-watchos99.9 -dM -E %s | FileCheck --check-prefix=WATCHOS99 %s
-// WATCHOS99: __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ 990900
+// WATCHOS99: __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ 990900
+// WATCHOS99-NEXT: __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ 990900
+
+// RUN: %clang_cc1 -triple arm64-apple-macos12.4 -dM -E %s | FileCheck --check-prefix=MACOS124 %s
+// MACOS124: __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ 120400