Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / builtins / TestCases / Darwin / os_version_check_test.c
blob2f0ca04ec48fef99289d7e32cfb6780b9d46f7ac
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
4 int __isOSVersionAtLeast(int Major, int Minor, int Subminor);
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;
18 return 0;