1 | // RUN: %clang %s -o %t -mmacosx-version-min=10.7 -framework CoreFoundation -DMAJOR=%macos_version_major -DMINOR=%macos_version_minor -DSUBMINOR=%macos_version_subminor |
2 | // RUN: %run %t |
3 | |
4 | int __isOSVersionAtLeast(int Major, int Minor, int Subminor); |
5 | |
6 | int main() { |
7 | if (!__isOSVersionAtLeast(MAJOR, MINOR, SUBMINOR)) |
8 | return 1; |
9 | if (__isOSVersionAtLeast(MAJOR, MINOR, SUBMINOR + 1)) |
10 | return 1; |
11 | if (SUBMINOR && __isOSVersionAtLeast(MAJOR + 1, MINOR, SUBMINOR - 1)) |
12 | return 1; |
13 | if (SUBMINOR && !__isOSVersionAtLeast(MAJOR, MINOR, SUBMINOR - 1)) |
14 | return 1; |
15 | if (MAJOR && !__isOSVersionAtLeast(MAJOR - 1, MINOR + 1, SUBMINOR)) |
16 | return 1; |
17 | |
18 | return 0; |
19 | } |
20 | |