Home | History | Annotate | Download | only in jni
      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  */
      5 int 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 #else
     33 #  error "This unit test is broken!"
     34 #endif
     35 
     36 #if defined(CHECK_NEON)
     37 #  ifndef __ARM_NEON__
     38 #    error "This source file should be compiled with NEON support!"
     39 #  endif
     40 #else
     41 #  ifdef __ARM_NEON__
     42 #    error "This source file should be compiled without NEON support!"
     43 #  endif
     44 #endif
     45 
     46 #ifndef __ANDROID__
     47 #  error "This toolchain doesn't define the __ANDROID__ built-in macro!"
     48 #endif
     49     return 0;
     50 }
     51