From 38d71b5b496882878eed03bb3f741af2797fa83c Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 14 Mar 2017 17:53:37 +0000 Subject: [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 --- .../Darwin/os_version_check_test_no_core_foundation.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/builtins/TestCases/Darwin/os_version_check_test_no_core_foundation.c (limited to 'test/builtins') 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; +} -- cgit v1.2.3