xref: /xnu-10002.1.13/tests/posix_spawn_archpref_helper.c (revision 1031c584a5e37aff177559b9f69dbd3c8c3fd30a)
1*1031c584SApple OSS Distributions #include <spawn.h>
2*1031c584SApple OSS Distributions /*
3*1031c584SApple OSS Distributions  * Returns the subcpu type for the architecture for which the
4*1031c584SApple OSS Distributions  * binary was compiled.
5*1031c584SApple OSS Distributions  */
6*1031c584SApple OSS Distributions int
main(void)7*1031c584SApple OSS Distributions main(void)
8*1031c584SApple OSS Distributions {
9*1031c584SApple OSS Distributions #if defined(__x86_64__)
10*1031c584SApple OSS Distributions 	return CPU_SUBTYPE_X86_64_ALL;
11*1031c584SApple OSS Distributions #elif __arm64e__
12*1031c584SApple OSS Distributions 	return CPU_SUBTYPE_ARM64E;
13*1031c584SApple OSS Distributions #elif defined(__arm64__) && defined(__LP64__)
14*1031c584SApple OSS Distributions 	return CPU_SUBTYPE_ARM64_ALL;
15*1031c584SApple OSS Distributions #elif defined(__arm64__)
16*1031c584SApple OSS Distributions 	return CPU_SUBTYPE_ARM64_32_ALL;
17*1031c584SApple OSS Distributions #else
18*1031c584SApple OSS Distributions #error unknown architecture
19*1031c584SApple OSS Distributions #endif
20*1031c584SApple OSS Distributions }
21