xref: /xnu-8792.41.9/tests/ptrauth_data_tests.c (revision 5c2921b07a2480ab43ec66f5b9e41cb872bc554f)
1*5c2921b0SApple OSS Distributions #include <darwintest.h>
2*5c2921b0SApple OSS Distributions #include <sys/sysctl.h>
3*5c2921b0SApple OSS Distributions 
4*5c2921b0SApple OSS Distributions T_GLOBAL_META(
5*5c2921b0SApple OSS Distributions 	T_META_NAMESPACE("xnu.arm"),
6*5c2921b0SApple OSS Distributions 	T_META_RADAR_COMPONENT_NAME("xnu"),
7*5c2921b0SApple OSS Distributions 	T_META_RADAR_COMPONENT_VERSION("arm"),
8*5c2921b0SApple OSS Distributions 	T_META_OWNER("mwm")
9*5c2921b0SApple OSS Distributions 	);
10*5c2921b0SApple OSS Distributions 
11*5c2921b0SApple OSS Distributions T_DECL(ptrauth_data_tests, "invoke the PAC unit tests", T_META_ASROOT(true))
12*5c2921b0SApple OSS Distributions {
13*5c2921b0SApple OSS Distributions #if __has_feature(ptrauth_calls)
14*5c2921b0SApple OSS Distributions 	int ret, dummy = 1;
15*5c2921b0SApple OSS Distributions 	ret = sysctlbyname("kern.run_ptrauth_data_tests", NULL, NULL, &dummy, sizeof(dummy));
16*5c2921b0SApple OSS Distributions 	T_ASSERT_POSIX_SUCCESS(ret, "run ptrauth data tests");
17*5c2921b0SApple OSS Distributions #else
18*5c2921b0SApple OSS Distributions 	T_SKIP("Running on non-ptrauth system. Skipping...");
19*5c2921b0SApple OSS Distributions #endif //__has_feature(ptrauth_calls)
20*5c2921b0SApple OSS Distributions }
21