]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_get_sdk_version.dtest/main.c
2 // BUILD: $CC main.c -o $BUILD_DIR/sdk-check.exe
4 // RUN: ./sdk-check.exe
8 #include <mach-o/dyld_priv.h>
10 #include "test_support.h"
12 extern struct mach_header __dso_handle
;
14 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
16 if ( dyld_get_sdk_version(&__dso_handle
) == 0 ) {
17 FAIL("dyld_get_sdk_version: expected SDK");
21 const char* text
= "bad text";
22 if ( dyld_get_sdk_version((struct mach_header
*)text
) != 0 ) {
23 FAIL("dyld_get_sdk_version: expected failure");
28 uint32_t iosVersion
= dyld_get_program_sdk_version();
29 uint32_t watchOSVersion
= dyld_get_program_sdk_watch_os_version();
30 if (iosVersion
!= (watchOSVersion
+ 0x00070000)) {
31 FAIL("dyld_get_program_sdk_watch_os_version");
35 uint32_t iosVersion
= dyld_get_program_sdk_version();
36 uint32_t bridgeOSVersion
= dyld_get_program_sdk_bridge_os_version();
37 if (bridgeOSVersion
!= (watchOSVersion
+ 0x00090000)) {
38 FAIL("dyld_get_program_sdk_watch_os_version");