1 /* This simple file is used to check that compiler flags are properly 2 * set when using the NDK build system. Look at Android.mk to see how 3 * the various CHECK_XXX macros are supposed to be defined. 4 */ main(void)5int main(void) 6 { 7 #if defined(CHECK_THUMB) 8 # ifndef __arm__ 9 # error "This source file should be compiled with an ARM toolchain" 10 # endif 11 # ifndef __thumb__ 12 # error "This source file should be built in thumb mode!" 13 # endif 14 #elif defined(CHECK_THUMB2) 15 # ifndef __arm__ 16 # error "This source file should be compiled with an ARM toolchain" 17 # endif 18 # ifndef __thumb2__ 19 # error "This source file should be built in thumb2 mode!" 20 # endif 21 #elif defined(CHECK_ARM) 22 # ifndef __arm__ 23 # error "This source file should be compiled with an ARM toolchain" 24 # endif 25 # if defined(__thumb__) || defined(__thumb2__) 26 # error "This source file should be compiled to 32-bit ARM instructions" 27 # endif 28 #elif defined(CHECK_X86) 29 # ifndef __i386__ 30 # error "This source file should be compiled with an x86 toolchain" 31 # endif 32 #elif defined(CHECK_MIPS) 33 # ifndef __mips__ 34 # error "This source file should be compiled with a MIPS toolchain" 35 # endif 36 #else 37 # error "This unit test is broken!" 38 #endif 39 40 #if defined(CHECK_NEON) 41 # ifndef __ARM_NEON__ 42 # error "This source file should be compiled with NEON support!" 43 # endif 44 #else 45 # ifdef __ARM_NEON__ 46 # error "This source file should be compiled without NEON support!" 47 # endif 48 #endif 49 50 #ifndef __ANDROID__ 51 # error "This toolchain doesn't define the __ANDROID__ built-in macro!" 52 #endif 53 return 0; 54 } 55