summaryrefslogtreecommitdiff
path: root/test/builtins
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-03-14 17:53:37 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-03-14 17:53:37 +0000
commit38d71b5b496882878eed03bb3f741af2797fa83c (patch)
tree4e861213392200fef6c8b6d5d02777ee5b8ec2ed /test/builtins
parentd112f65e1dd555f069e8f3e33ab3dafbacb5435b (diff)
[compiler-rt][builtins] __isOSVersionAtLeast should load CoreFoundation
symbols dynamically The CoreFoundation symbols uses by __isOSVersionAtLeast should be loaded at runtime to ensure that the programs that don't use @available won't have to be linked to CoreFoundation. The Clang frontend IRGen library will need to emit a CoreFoundation symbol when @available is used to ensure that programs that actually use @available are linked to CoreFoundation. rdar://31039554 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@297760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/builtins')
-rw-r--r--test/builtins/TestCases/Darwin/os_version_check_test_no_core_foundation.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/builtins/TestCases/Darwin/os_version_check_test_no_core_foundation.c b/test/builtins/TestCases/Darwin/os_version_check_test_no_core_foundation.c
new file mode 100644
index 000000000..4e0da35cd
--- /dev/null
+++ b/test/builtins/TestCases/Darwin/os_version_check_test_no_core_foundation.c
@@ -0,0 +1,12 @@
+// RUN: %clang %s -o %t -mmacosx-version-min=10.5
+// RUN: %run %t
+
+int __isOSVersionAtLeast(int Major, int Minor, int Subminor);
+
+int main() {
+ // When CoreFoundation isn't linked, we expect the system version to be 0, 0,
+ // 0.
+ if (__isOSVersionAtLeast(1, 0, 0))
+ return 1;
+ return 0;
+}